aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-04-06 10:20:43 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-04-19 10:31:05 +0200
commitfcf104a74cb8d6d39dc935ab692afface3beab30 (patch)
tree6dbf2bd1a98d00a32432711f256bf87d443f0efc /hw
parentb7c8c35f0afb62efcacd18a64067fe164e3206b6 (diff)
downloadqemu-fcf104a74cb8d6d39dc935ab692afface3beab30.zip
qemu-fcf104a74cb8d6d39dc935ab692afface3beab30.tar.gz
qemu-fcf104a74cb8d6d39dc935ab692afface3beab30.tar.bz2
virtio-scsi: prepare migration format for multiqueue
In order to restore requests correctly from a multitude of virtqueues, we need to store the id of the request queue that each request came from. Do this even for single-queue, by storing a hard-coded zero, to simplify future implementation of multiqueue. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio-scsi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 45d54fa..0d90d9c 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -240,7 +240,9 @@ static VirtIOSCSIReq *virtio_scsi_pop_req(VirtIOSCSI *s, VirtQueue *vq)
static void virtio_scsi_save_request(QEMUFile *f, SCSIRequest *sreq)
{
VirtIOSCSIReq *req = sreq->hba_private;
+ uint32_t n = 0;
+ qemu_put_be32s(f, &n);
qemu_put_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
}
@@ -249,8 +251,11 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
SCSIBus *bus = sreq->bus;
VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);
VirtIOSCSIReq *req;
+ uint32_t n;
req = g_malloc(sizeof(*req));
+ qemu_get_be32s(f, &n);
+ assert(n == 0);
qemu_get_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
virtio_scsi_parse_req(s, s->cmd_vq, req);