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

[Xen-changelog] [xen-unstable] ioemu: Fix usbdevice parameter to encode vbd type.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1213786534 -3600
# Node ID 52592af0204a55abd0898b1fbe390a55036079e2
# Parent  666f5196f0fcb01fb5550aba492f6ebf7fcc01fc
ioemu: Fix usbdevice parameter to encode vbd type.

   usbdevice = "disk:<filename>"
expect a raw device (as this probably is the most usual case) and
   usbdevice = "disk-qcow:<filename>"
expect a COW image (autodetected, probably qcow2).

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/usb-msd.c |    4 ++--
 tools/ioemu/hw/usb.h     |    2 +-
 tools/ioemu/vl.c         |    4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff -r 666f5196f0fc -r 52592af0204a tools/ioemu/hw/usb-msd.c
--- a/tools/ioemu/hw/usb-msd.c  Wed Jun 18 09:46:36 2008 +0100
+++ b/tools/ioemu/hw/usb-msd.c  Wed Jun 18 11:55:34 2008 +0100
@@ -510,7 +510,7 @@ static void usb_msd_handle_destroy(USBDe
     qemu_free(s);
 }
 
-USBDevice *usb_msd_init(const char *filename)
+USBDevice *usb_msd_init(const char *filename, BlockDriver *drv)
 {
     MSDState *s;
     BlockDriverState *bdrv;
@@ -520,7 +520,7 @@ USBDevice *usb_msd_init(const char *file
         return NULL;
 
     bdrv = bdrv_new("usb");
-    if (bdrv_open(bdrv, filename, 0) < 0)
+    if (bdrv_open2(bdrv, filename, 0, drv) < 0)
         goto fail;
     s->bs = bdrv;
 
diff -r 666f5196f0fc -r 52592af0204a tools/ioemu/hw/usb.h
--- a/tools/ioemu/hw/usb.h      Wed Jun 18 09:46:36 2008 +0100
+++ b/tools/ioemu/hw/usb.h      Wed Jun 18 11:55:34 2008 +0100
@@ -217,7 +217,7 @@ USBDevice *usb_tablet_init(void);
 USBDevice *usb_tablet_init(void);
 
 /* usb-msd.c */
-USBDevice *usb_msd_init(const char *filename);
+USBDevice *usb_msd_init(const char *filename, BlockDriver *drv);
 
 /* usb.c */
 void generic_usb_save(QEMUFile* f, void *opaque);
diff -r 666f5196f0fc -r 52592af0204a tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Wed Jun 18 09:46:36 2008 +0100
+++ b/tools/ioemu/vl.c  Wed Jun 18 11:55:34 2008 +0100
@@ -4265,7 +4265,9 @@ static int usb_device_add(const char *de
     } else if (!strcmp(devname, "tablet")) {
        dev = usb_tablet_init();
     } else if (strstart(devname, "disk:", &p)) {
-        dev = usb_msd_init(p);
+        dev = usb_msd_init(p, &bdrv_raw);
+    } else if (strstart(devname, "disk-qcow:", &p)) {
+        dev = usb_msd_init(p, 0);
     } else {
         return -1;
     }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.