WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 7 of 9] CA-31528: Specialise the Xal DevThread event to

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 7 of 9] CA-31528: Specialise the Xal DevThread event to be VBD-specific ("vbd" and "tap" but not "vif")
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 15:45:54 +0000
Delivery-date: Mon, 30 Nov 2009 07:44:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259595947@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259595837 0
# Node ID 2f9d20a3828896e99c82899235d7f9efb9292043
# Parent  d2d2c13b70f543e423d6652ac5025c82cd52f25d
CA-31528: Specialise the Xal DevThread event to be VBD-specific ("vbd" and 
"tap" but not "vif").

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r d2d2c13b70f5 -r 2f9d20a38288 ocaml/xapi/events.ml
--- a/ocaml/xapi/events.ml      Mon Nov 30 15:43:57 2009 +0000
+++ b/ocaml/xapi/events.ml      Mon Nov 30 15:43:57 2009 +0000
@@ -402,7 +402,7 @@
 let interesting_device_event = function
   | Xal.HotplugChanged("vif", _, _, _) 
   | Xal.DevShutdownDone(_, _)
-  | Xal.DevThread(("vbd" | "tap"), _, _) 
+  | Xal.DevThread(_, _) 
   | Xal.DevEject(_)
   | Xal.ChangeRtc(_, _)
   | Xal.Message(_, _, _, _)
@@ -458,7 +458,7 @@
                      debug "ignoring because VBD does not exist in DB"
                  end
                    
-             | Xal.DevThread (ty, devid, pid) when ty = "vbd" || ty = "tap" ->
+             | Xal.DevThread (devid, pid) ->
                  let vm = vm_of_domid ~__context domid in
                  begin
                    try
@@ -468,7 +468,7 @@
                        Vbdops.set_vbd_qos ~__context ~self:vbd domid devid pid
                      in
                      debug "Adding Vbdops.set_vbd_qos to queue";
-                     let description = Printf.sprintf "DevThread(%s, %s, %d) 
domid %d" ty devid pid domid in
+                     let description = Printf.sprintf "DevThread(%s, %d) domid 
%d" devid pid domid in
                      push vm Local_work_queue.normal_vm_queue description 
work_item 
                    with Xen_helpers.Device_has_no_VBD ->
                      debug "ignoring because VBD does not exist in DB"
diff -r d2d2c13b70f5 -r 2f9d20a38288 ocaml/xenops/xal.ml
--- a/ocaml/xenops/xal.ml       Mon Nov 30 15:43:57 2009 +0000
+++ b/ocaml/xenops/xal.ml       Mon Nov 30 15:43:57 2009 +0000
@@ -30,7 +30,7 @@
        (* devices : backend / type / devid *)
        | DevEject of string
        (* device thread start : type / devid / pid *)
-       | DevThread of string * string * int
+       | DevThread of string * int
        (* blkback and blktap now provide an explicit flush signal (type / 
devid) *)
        | DevShutdownDone of string * string
        (* uuid, data *)
@@ -69,8 +69,8 @@
        match ev with
        | DevEject i ->
                sprintf "device eject {%s}" i
-       | DevThread (s, i, pid) ->
-               sprintf "device thread {%s,%s} pid=%d" s i pid
+       | DevThread (i, pid) ->
+               sprintf "device thread {%s} pid=%d" i pid
        | DevShutdownDone (s, i) ->
                sprintf "device shutdown {%s,%s}" s i
        | ChangeRtc (uuid, data) ->
@@ -416,14 +416,14 @@
        | "" :: "local" :: "domain" :: "0" :: "backend" :: "vbd" :: domid :: 
devid :: [ "kthread-pid" ] ->
                begin try
                        let kthread_pid = int_of_string (xs.Xs.read w) in
-                       Some (int_of_string domid, BackThread kthread_pid, 
"vbd", devid)
+                       Some (int_of_string domid, BackThread kthread_pid, "", 
devid)
                with _ ->
                        None
                end
        | "" :: "local" :: "domain" :: "0" :: "backend" :: "tap" :: domid :: 
devid :: [ "tapdisk-pid" ] ->
                begin try
                        let tapdisk_pid = int_of_string (xs.Xs.read w) in
-                       Some (int_of_string domid, BackThread tapdisk_pid, 
"tap", devid)
+                       Some (int_of_string domid, BackThread tapdisk_pid, "", 
devid)
                with _ ->
                        None
                end
@@ -563,8 +563,8 @@
                ctx.callback_devices ctx domid (ChangeUncooperative x)
        | Some (_, IntMessage (uuid, name, priority, body), _, _) ->
                ctx.callback_devices ctx (-1) (Message (uuid, name, priority, 
body))
-       | Some (domid, BackThread (pid), ty, devid) ->
-               ctx.callback_devices ctx domid (DevThread (ty, devid, pid))
+       | Some (domid, BackThread (pid), _, devid) ->
+               ctx.callback_devices ctx domid (DevThread (devid, pid))
        | Some (domid, BackEject, _, devid) ->
                ctx.callback_devices ctx domid (DevEject (devid))
        | Some (domid, ev, ty, devid) -> (
diff -r d2d2c13b70f5 -r 2f9d20a38288 ocaml/xenops/xal.mli
--- a/ocaml/xenops/xal.mli      Mon Nov 30 15:43:57 2009 +0000
+++ b/ocaml/xenops/xal.mli      Mon Nov 30 15:43:57 2009 +0000
@@ -38,7 +38,7 @@
 
 type dev_event =
        | DevEject of string
-       | DevThread of string * string * int
+       | DevThread of string * int
        | DevShutdownDone of string * string
        | ChangeRtc of string * string
        | Message of string * string * int64 * string
3 files changed, 11 insertions(+), 11 deletions(-)
ocaml/xapi/events.ml |    6 +++---
ocaml/xenops/xal.ml  |   14 +++++++-------
ocaml/xenops/xal.mli |    2 +-


Attachment: xen-api.hg-9.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api