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] [xen-unstable] ioemu: Fix usbdevice parameter to encode

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: Fix usbdevice parameter to encode vbd type.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Jun 2008 10:20:11 -0700
Delivery-date: Wed, 18 Jun 2008 10:20:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: Fix usbdevice parameter to encode vbd type., Xen patchbot-unstable <=