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

[Xen-API] [PATCH 5 of 9] CA-31528: Specialise the Xal HotplugChanged event to only consider backends, remove the frontend handling code



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259595836 0
# Node ID 94920cc0874527f6b9186542ded1d7ecb4186cbe
# Parent  af477faf447cacab57d6eeea7149e53c6e96a427
CA-31528: Specialise the Xal HotplugChanged event to only consider backends, 
remove the frontend handling code.

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

diff -r af477faf447c -r 94920cc08745 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:56 2009 +0000
@@ -400,7 +400,7 @@
 
 (* Used to pre-filter the device events we care about from lots of 
uninteresting ones *)
 let interesting_device_event = function
-  | Xal.HotplugChanged(true, "vif", _, _, _) 
+  | Xal.HotplugChanged("vif", _, _, _) 
   | Xal.DevShutdownDone(_, _)
   | Xal.DevThread(("vbd" | "tap"), _, _) 
   | Xal.DevEject(("vbd" | "tap"), _)
@@ -420,8 +420,7 @@
         (fun __context -> 
            try
              match dev_event with
-               (* NB we don't care about frontend events here *)
-             | Xal.HotplugChanged (true, "vif", devid, oldextra, newextra) ->  
+             | Xal.HotplugChanged ("vif", devid, oldextra, newextra) ->  
                  begin 
                    let vm = vm_of_domid ~__context domid in
                    let backend = { Device_common.domid=0;
diff -r af477faf447c -r 94920cc08745 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:56 2009 +0000
@@ -37,7 +37,7 @@
        | ChangeRtc of string * string
        (* uuid, name, priority, data *)
        | Message of string * string * int64 * string
-       | HotplugChanged of bool * string * string * string option * string 
option
+       | HotplugChanged of string * string * string option * string option
        | ChangeUncooperative of bool
 
 type xs_dev_state =
@@ -55,7 +55,6 @@
        | Rtc of string * string (* uuid, data *)
        | IntMessage of string * string * int64 * string (* uuid, name, 
priority, body *)
        | HotplugBackend of string option
-       | HotplugFrontend of string option
        | Uncooperative of bool
 
 let string_of_dev_state = function
@@ -78,8 +77,8 @@
                sprintf "change rtc {%s,%s}" uuid data
        | Message (uuid, name, priority, body) ->
                sprintf "message {%s,%Ld,%s}" name priority body
-       | HotplugChanged (b, s, i, old, n) ->
-               sprintf "HotplugChanged on %s %s %s {%s->%s}" (string_of_b b) s 
i
+       | HotplugChanged (s, i, old, n) ->
+               sprintf "HotplugChanged on %s %s {%s->%s}" s i
                        (string_of_string_opt old)
                        (string_of_string_opt n)
        | ChangeUncooperative b ->
@@ -445,9 +444,6 @@
        | "" :: "xapi" :: domid :: "hotplug" :: ty :: devid :: [ "hotplug" ] ->
                let extra = try Some (xs.Xs.read w) with _ -> None in
                Some (int_of_string domid, (HotplugBackend extra), ty, devid)
-       | "" :: "xapi" :: domid :: "frontend" :: ty :: devid :: [ "hotplug" ] ->
-               let extra = try Some (xs.Xs.read w) with _ -> None in
-               Some (int_of_string domid, (HotplugFrontend extra), ty, devid)
        | "" :: "vm" :: uuid :: "rtc" :: [ "timeoffset" ] ->
                let data = xs.Xs.read w in
                Some (-1, (Rtc (uuid, data)), "", "")
@@ -588,12 +584,7 @@
                        let old = devstate.hotplug in
                        devstate.hotplug <- extra;
                        ctx.callback_devices ctx domid
-                                      (HotplugChanged (true, ty, devid, old, 
extra))
-               | HotplugFrontend extra ->
-                       let old = devstate.hotplug in
-                       devstate.hotplug <- extra;
-                       ctx.callback_devices ctx domid
-                                      (HotplugChanged (false, ty, devid, old, 
extra))
+                                      (HotplugChanged (ty, devid, old, extra))
        )
 
 (** Internal helper function which wraps the Xs.read_watchevent with
diff -r af477faf447c -r 94920cc08745 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:56 2009 +0000
@@ -42,7 +42,7 @@
        | DevShutdownDone of string * string
        | ChangeRtc of string * string
        | Message of string * string * int64 * string
-       | HotplugChanged of bool * string * string * string option * string 
option
+       | HotplugChanged of string * string * string option * string option
        | ChangeUncooperative of bool
 
 (* type dev_state = Connecting | Connected | Closing | Closed *)
3 files changed, 7 insertions(+), 17 deletions(-)
ocaml/xapi/events.ml |    5 ++---
ocaml/xenops/xal.ml  |   17 ++++-------------
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®.