]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
When a VBD unplug event is caught by the event thread, it issues a VDI.detach but...
authorJon Ludlam <Jonathan.Ludlam@eu.citrix.com>
Thu, 8 Jul 2010 11:55:00 +0000 (12:55 +0100)
committerJon Ludlam <Jonathan.Ludlam@eu.citrix.com>
Thu, 8 Jul 2010 11:55:00 +0000 (12:55 +0100)
Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
ocaml/xapi/events.ml
ocaml/xapi/vbdops.ml

index 26767f712e6f2b7ddffe3031ef32d2c237ebbec6..65878eb023e893ea77388a20b78fa00a2cf8e7a7 100644 (file)
@@ -253,7 +253,7 @@ module Resync = struct
             Device.Generic.rm_device_state ~xs device;
             let vdi = Db.VBD.get_VDI ~__context ~self:vbd in
             if exists
-            then Storage_access.VDI.detach ~__context ~self:vdi
+            then Storage_access.deactivate_and_detach ~__context ~vdi
             else debug "VBD %s: Skipping VDI.detach of %s since device doesn't exist" (Ref.string_of vbd) (Ref.string_of vdi)
           );
           (* If VM is suspended, leave currently_attached and the VDI lock
index f046b204cca6be2eacd330ad4c2436f6feebf663..b6e0e4a46653d0916f9e7ab68f37eef33fbc91ef 100644 (file)
@@ -232,7 +232,7 @@ let eject_vbd ~__context ~self =
                                        let cmd = [| "eject"; location |] in
                                        ignore (Unixext.spawnvp cmd.(0) cmd)
                                );
-                               Storage_access.VDI.detach ~__context ~self:vdi;
+                               Storage_access.deactivate_and_detach ~__context ~vdi;
                        )
                ) else (
                        Db.VBD.set_empty ~__context ~self ~value:true;