Patchwork [5/9] usb storage: first migration support bits.

login
register
mail settings
Submitter Gerd Hoffmann
Date July 20, 2011, 10:09 a.m.
Message ID <1311156579-9814-6-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/105628/
State New
Headers show

Comments

Gerd Hoffmann - July 20, 2011, 10:09 a.m.
Tag vmstate as unmigratable for the time being,
to be removed when mgration support is finished.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb-msd.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Paolo Bonzini - July 29, 2011, 3:56 p.m.
On 07/20/2011 12:09 PM, Gerd Hoffmann wrote:
> Tag vmstate as unmigratable for the time being,
> to be removed when mgration support is finished.

I'm going to handle this at the SCSI level by canceling all transactions 
on pre-load.  Expect patches next week.

Paolo

Patch

diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 86582cc..8ed8594 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -623,11 +623,23 @@  static USBDevice *usb_msd_init(const char *filename)
     return dev;
 }
 
+static const VMStateDescription vmstate_usb_msd = {
+    .name = "usb-storage",
+    .unmigratable = 1, /* FIXME: handle transactions which are in flight */
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField []) {
+        VMSTATE_USB_DEVICE(dev, MSDState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static struct USBDeviceInfo msd_info = {
     .product_desc   = "QEMU USB MSD",
     .qdev.name      = "usb-storage",
     .qdev.fw_name      = "storage",
     .qdev.size      = sizeof(MSDState),
+    .qdev.vmsd      = &vmstate_usb_msd,
     .usb_desc       = &desc,
     .init           = usb_msd_initfn,
     .handle_packet  = usb_generic_handle_packet,