[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH 6 of 9] CA-31528: Specialise the Xal DevEject event to be VBD-specific ("vbd" and "tap" but not "vif")



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259595837 0
# Node ID d2d2c13b70f543e423d6652ac5025c82cd52f25d
# Parent  94920cc0874527f6b9186542ded1d7ecb4186cbe
CA-31528: Specialise the Xal DevEject event to be VBD-specific ("vbd" and "tap" 
but not "vif").

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

diff -r 94920cc08745 -r d2d2c13b70f5 ocaml/xapi/events.ml
--- a/ocaml/xapi/events.ml      Mon Nov 30 15:43:56 2009 +0000
+++ b/ocaml/xapi/events.ml      Mon Nov 30 15:43:57 2009 +0000
@@ -403,7 +403,7 @@
   | Xal.HotplugChanged("vif", _, _, _) 
   | Xal.DevShutdownDone(_, _)
   | Xal.DevThread(("vbd" | "tap"), _, _) 
-  | Xal.DevEject(("vbd" | "tap"), _)
+  | Xal.DevEject(_)
   | Xal.ChangeRtc(_, _)
   | Xal.Message(_, _, _, _)
   | Xal.ChangeUncooperative _ -> true
@@ -474,7 +474,7 @@
                      debug "ignoring because VBD does not exist in DB"
                  end
                    
-             | Xal.DevEject (ty, devid) when ty = "vbd" || ty = "tap" ->
+             | Xal.DevEject devid ->
                  let vm = vm_of_domid ~__context domid in
                  begin
                    try
@@ -483,7 +483,7 @@
                        Vbdops.eject_vbd ~__context ~self:vbd
                      in
                      debug "Adding Vbdops.eject_vbd to queue";
-                     let description = Printf.sprintf "DevEject(%s, %s) domid 
%d" ty devid domid in
+                     let description = Printf.sprintf "DevEject(%s) domid %d" 
devid 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 94920cc08745 -r d2d2c13b70f5 ocaml/xenops/xal.ml
--- a/ocaml/xenops/xal.ml       Mon Nov 30 15:43:56 2009 +0000
+++ b/ocaml/xenops/xal.ml       Mon Nov 30 15:43:57 2009 +0000
@@ -28,7 +28,7 @@
 
 type dev_event =
        (* devices : backend / type / devid *)
-       | DevEject of string * string
+       | DevEject of string
        (* device thread start : type / devid / pid *)
        | DevThread of string * string * int
        (* blkback and blktap now provide an explicit flush signal (type / 
devid) *)
@@ -67,8 +67,8 @@
        let string_of_string_opt = function None -> "\"\"" | Some s -> s in
        let string_of_b b = if b then "B" else "F" in
        match ev with
-       | DevEject (s, i) ->
-               sprintf "device eject {%s,%s}" s i
+       | DevEject i ->
+               sprintf "device eject {%s}" i
        | DevThread (s, i, pid) ->
                sprintf "device thread {%s,%s} pid=%d" s i pid
        | DevShutdownDone (s, i) ->
@@ -429,10 +429,10 @@
                end
        | "" :: "local" :: "domain" :: "0" :: "backend" :: ty :: domid :: devid 
:: [ "shutdown-done" ] ->
                Some (int_of_string domid, BackShutdown, ty, devid)
-       | "" :: "local" :: "domain" :: "0" :: "backend" :: ty :: domid :: devid 
:: [ "params" ] ->
+       | "" :: "local" :: "domain" :: "0" :: "backend" :: ( "vbd" | "tap" ) :: 
domid :: devid :: [ "params" ] ->
                begin try
                        if xs.Xs.read w = "" then
-                               Some (int_of_string domid, BackEject, ty, devid)
+                               Some (int_of_string domid, BackEject, "", devid)
                        else
                                None
                with _ ->
@@ -565,8 +565,8 @@
                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, BackEject, ty, devid) ->
-               ctx.callback_devices ctx domid (DevEject (ty, devid))
+       | Some (domid, BackEject, _, devid) ->
+               ctx.callback_devices ctx domid (DevEject (devid))
        | Some (domid, ev, ty, devid) -> (
                let devstate = get_devstate ctx domid ty devid in
 
diff -r 94920cc08745 -r d2d2c13b70f5 ocaml/xenops/xal.mli
--- a/ocaml/xenops/xal.mli      Mon Nov 30 15:43:56 2009 +0000
+++ b/ocaml/xenops/xal.mli      Mon Nov 30 15:43:57 2009 +0000
@@ -37,7 +37,7 @@
 exception Timeout
 
 type dev_event =
-       | DevEject of string * string
+       | DevEject of string
        | DevThread of string * string * int
        | DevShutdownDone of string * string
        | ChangeRtc of string * 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.