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

[Xen-API] [PATCH 8 of 9] CA-31528: Specialise the Xal HotplugChanged event to VIFs (no "vbd" or "tap")



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259595838 0
# Node ID 79d2da9328135ea8875e8871505a23193ae0f944
# Parent  2f9d20a3828896e99c82899235d7f9efb9292043
CA-31528: Specialise the Xal HotplugChanged event to VIFs (no "vbd" or "tap").

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

diff -r 2f9d20a38288 -r 79d2da932813 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:58 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("vif", _, _, _) 
+  | Xal.HotplugChanged(_, _, _) 
   | Xal.DevShutdownDone(_, _)
   | Xal.DevThread(_, _) 
   | Xal.DevEject(_)
@@ -420,7 +420,7 @@
         (fun __context -> 
            try
              match dev_event with
-             | Xal.HotplugChanged ("vif", devid, oldextra, newextra) ->  
+             | Xal.HotplugChanged (devid, oldextra, newextra) ->  
                  begin 
                    let vm = vm_of_domid ~__context domid in
                    let backend = { Device_common.domid=0;
diff -r 2f9d20a38288 -r 79d2da932813 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:58 2009 +0000
@@ -37,7 +37,7 @@
        | ChangeRtc of string * string
        (* uuid, name, priority, data *)
        | Message of string * string * int64 * string
-       | HotplugChanged of string * string * string option * string option
+       | HotplugChanged of string * string option * string option
        | ChangeUncooperative of bool
 
 type xs_dev_state =
@@ -77,8 +77,8 @@
                sprintf "change rtc {%s,%s}" uuid data
        | Message (uuid, name, priority, body) ->
                sprintf "message {%s,%Ld,%s}" name priority body
-       | HotplugChanged (s, i, old, n) ->
-               sprintf "HotplugChanged on %s %s {%s->%s}" s i
+       | HotplugChanged (i, old, n) ->
+               sprintf "HotplugChanged on %s {%s->%s}" i
                        (string_of_string_opt old)
                        (string_of_string_opt n)
        | ChangeUncooperative b ->
@@ -441,9 +441,9 @@
        | "" :: "local" :: "domain" :: domid :: "device" :: ty :: devid :: [ 
"state" ] ->
                let xsds = read_state w in
                Some (int_of_string domid, Frontend xsds, ty, devid)
-       | "" :: "xapi" :: domid :: "hotplug" :: ty :: devid :: [ "hotplug" ] ->
+       | "" :: "xapi" :: domid :: "hotplug" :: "vif" :: devid :: [ "hotplug" ] 
->
                let extra = try Some (xs.Xs.read w) with _ -> None in
-               Some (int_of_string domid, (HotplugBackend extra), ty, devid)
+               Some (int_of_string domid, (HotplugBackend extra), "", devid)
        | "" :: "vm" :: uuid :: "rtc" :: [ "timeoffset" ] ->
                let data = xs.Xs.read w in
                Some (-1, (Rtc (uuid, data)), "", "")
@@ -584,7 +584,7 @@
                        let old = devstate.hotplug in
                        devstate.hotplug <- extra;
                        ctx.callback_devices ctx domid
-                                      (HotplugChanged (ty, devid, old, extra))
+                                      (HotplugChanged (devid, old, extra))
        )
 
 (** Internal helper function which wraps the Xs.read_watchevent with
diff -r 2f9d20a38288 -r 79d2da932813 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:58 2009 +0000
@@ -42,7 +42,7 @@
        | DevShutdownDone of string * string
        | ChangeRtc of string * string
        | Message of string * string * int64 * string
-       | HotplugChanged of string * string * string option * string option
+       | HotplugChanged of string * string option * string option
        | ChangeUncooperative of bool
 
 (* type dev_state = Connecting | Connected | Closing | Closed *)
3 files changed, 9 insertions(+), 9 deletions(-)
ocaml/xapi/events.ml |    4 ++--
ocaml/xenops/xal.ml  |   12 ++++++------
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®.