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] Add missing vdi_deactivate

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Add missing vdi_deactivate
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 8 Jul 2010 12:56:06 +0100
Delivery-date: Thu, 08 Jul 2010 05:04:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Jon Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
# Date 1278590100 -3600
# Node ID 8499f649a11392161b050fa39e0eeb69c58aa84a
# Parent  9a444f4ab686fb2e391138708b32a3853517e130
When a VBD unplug event is caught by the event thread, it issues a VDI.detach 
but not a VDI.deactivate. This fixes this behaviour. Also does the same for 
eject (although no ISO SRs currently use activate/deactivate)

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>

diff -r 9a444f4ab686 -r 8499f649a113 ocaml/xapi/events.ml
--- a/ocaml/xapi/events.ml      Thu Jul 08 12:54:49 2010 +0100
+++ b/ocaml/xapi/events.ml      Thu Jul 08 12:55:00 2010 +0100
@@ -253,7 +253,7 @@
             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
diff -r 9a444f4ab686 -r 8499f649a113 ocaml/xapi/vbdops.ml
--- a/ocaml/xapi/vbdops.ml      Thu Jul 08 12:54:49 2010 +0100
+++ b/ocaml/xapi/vbdops.ml      Thu Jul 08 12:55:00 2010 +0100
@@ -232,7 +232,7 @@
                                        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;
 ocaml/xapi/events.ml |  2 +-
 ocaml/xapi/vbdops.ml |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


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

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Add missing vdi_deactivate, David Scott <=