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-changelog

[Xen-changelog] [qemu-xen-unstable] Fix to eject cdrom on HVM Domain

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] Fix to eject cdrom on HVM Domain
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 4 Sep 2009 08:35:55 -0700
Delivery-date: Fri, 04 Sep 2009 08:35:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit 2836e73adcd994de071f4eec1aa538a5ca849118
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Fri Sep 4 16:19:54 2009 +0100

    Fix to eject cdrom on HVM Domain
    
    We tried to eject cdrom(/dev/hdc) on HVM Domain.
    But, cdrom media are not ejected from the cdrom device on HostOS.
    
    The module to eject the cdrom device has already been implemented in
    qemu-dm.
     But, all devices are opened as raw device for VBD.
    Therefore, the module to eject the cdrom device is not work.
    
    The cdrom device was corrected to open as a physical device on HostOS.
    When eject is executed on HVM Domain, cdrom media are ejected from the
    cdrom device on HostOS.
    
    This patch corrected the problem.
    Signed-off-by: Takanori Kasai <kasai.takanori@xxxxxxxxxxxxxx>
---
 xenstore.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index aee96f0..bdc25c3 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -107,7 +107,14 @@ static void insert_media(void *opaque)
     for (i = 0; i < MAX_DRIVES + 1; i++) {
         bs = drives_table[i].bdrv;
         if (media_filename[i] && bs && bs->filename[0] == '\0') {
-            bdrv_open2(bs, media_filename[i], 0, &bdrv_raw);
+            BlockDriver *format;
+            if ( strstart(media_filename[i], "/dev/cd", NULL) 
+              || strstart(media_filename[i], "/dev/scd", NULL)) 
+                format = &bdrv_host_device;
+            else 
+                format = &bdrv_raw;
+
+            bdrv_open2(bs, media_filename[i], 0, format);
             pstrcpy(bs->filename, sizeof(bs->filename), media_filename[i]);
             free(media_filename[i]);
             media_filename[i] = NULL;
@@ -533,7 +540,11 @@ void xenstore_parse_domain_config(int hvm_domid)
                } else if (!strcmp(drv,"file")) {
                    format = &bdrv_raw;
                } else if (!strcmp(drv,"phy")) {
-                   format = &bdrv_raw;
+                    if (strstart(params, "/dev/cd", NULL) 
+                     || strstart(params, "/dev/scd", NULL)) 
+                        format = &bdrv_host_device;
+                    else
+                        format = &bdrv_raw;
                } else {
                    format = bdrv_find_format(drv);
                    if (!format) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] Fix to eject cdrom on HVM Domain, Ian Jackson <=