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] CA-50383: Don't write physical-device to hvm cdrom VBD

To: Xen-API <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] CA-50383: Don't write physical-device to hvm cdrom VBDs.
From: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Date: Tue, 22 Feb 2011 15:26:26 -0800
Cc: Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>
Delivery-date: Tue, 22 Feb 2011 15:26:40 -0800
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
To prevent blkback from pinning the device node. A Vbd.media_eject
will only make qemu close it again and assume the node is in
detachable state.

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Cc: Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>
---
 ocaml/xenops/device.ml |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ocaml/xenops/device.ml b/ocaml/xenops/device.ml
index 734ef08..6ed4fc3 100644
--- a/ocaml/xenops/device.ml
+++ b/ocaml/xenops/device.ml
@@ -527,6 +527,12 @@ let add ~xs ~hvm ~mode ~virtpath ~phystype ~physpath 
~dev_type ~unpluggable
        if protocol <> Protocol_Native then
                Hashtbl.add front_tbl "protocol" (string_of_protocol protocol);
 
+       if hvm && dev_type = CDROM then
+         (* CA-50383: Don't place physical-device in the HVM CDROM
+            case, to prevent blkback from pinning the device node. A
+            Vbd.media_eject will only make qemu close it again. *)
+         Hashtbl.remove back_tbl "physical-device";
+
        let back = Hashtbl.to_list back_tbl in
        let front = Hashtbl.to_list front_tbl in
 
-- 
1.7.0.4


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>