[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/12] virtio: sync the dataplane vring state to the
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 08/12] virtio: sync the dataplane vring state to the virtqueue before virtio_save |
Date: |
Thu, 29 Oct 2015 18:09:21 +0000 |
From: Pavel Butsykin <address@hidden>
When creating snapshot with the dataplane enabled, the snapshot file gets
not the actual state of virtqueue, because the current state is stored in
VirtIOBlockDataPlane. Therefore, before saving snapshot need to sync
the dataplane vring state to the virtqueue. The dataplane will resume its
work at the next notify virtqueue.
When snapshot loads with loadvm we get a message:
VQ 0 size 0x80 Guest index 0x15f5 inconsistent with Host index 0x0:
delta 0x15f5
error while loading state for instance 0x0 of device
'0000:00:08.0/virtio-blk'
Error -1 while loading VM state
to reproduce the error I used the following hmp commands:
savevm snap1
loadvm snap1
qemu parameters:
--enable-kvm -smp 4 -m 1024 -drive
file=/var/lib/libvirt/images/centos6.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=native
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0
-set device.virtio-disk0.x-data-plane=on
Signed-off-by: Pavel Butsykin <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
Message-id: address@hidden
CC: Stefan Hajnoczi <address@hidden>
CC: "Michael S. Tsirkin" <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Paolo Bonzini <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/block/virtio-blk.c | 5 +++++
hw/scsi/virtio-scsi.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 45a24e4..093e475 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -798,6 +798,11 @@ static void virtio_blk_set_status(VirtIODevice *vdev,
uint8_t status)
static void virtio_blk_save(QEMUFile *f, void *opaque)
{
VirtIODevice *vdev = VIRTIO_DEVICE(opaque);
+ VirtIOBlock *s = VIRTIO_BLK(vdev);
+
+ if (s->dataplane) {
+ virtio_blk_data_plane_stop(s->dataplane);
+ }
virtio_save(vdev, f);
}
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 46553e1..7655401 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -653,6 +653,11 @@ static void virtio_scsi_reset(VirtIODevice *vdev)
static void virtio_scsi_save(QEMUFile *f, void *opaque)
{
VirtIODevice *vdev = VIRTIO_DEVICE(opaque);
+ VirtIOSCSI *s = VIRTIO_SCSI(vdev);
+
+ if (s->dataplane_started) {
+ virtio_scsi_dataplane_stop(s);
+ }
virtio_save(vdev, f);
}
--
2.4.3
- [Qemu-devel] [PULL 00/12] Block patches, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 01/12] qemu-gdb: allow using glibc_pointer_guard() on core dumps, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 02/12] qemu-gdb: extract parts of "qemu coroutine" implementation, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 04/12] s390x: include HW_COMPAT_* props, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 06/12] virtio-blk: switch off scsi-passthrough by default, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 03/12] qemu-gdb: add $qemu_coroutine_sp and $qemu_coroutine_pc, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 05/12] ppc/spapr: add 2.4 compat props, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 07/12] gdb command: qemu handlers, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 08/12] virtio: sync the dataplane vring state to the virtqueue before virtio_save,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 11/12] target-arm: xlnx-zynqmp: Add sdhci support., Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 10/12] sdhci: Split sdhci.h for public and internal device usage, Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 12/12] block: Consider all child nodes in bdrv_requests_pending(), Stefan Hajnoczi, 2015/10/29
- [Qemu-devel] [PULL 09/12] sd.h: Move sd.h to include/hw/sd/, Stefan Hajnoczi, 2015/10/29
- Re: [Qemu-devel] [PULL 00/12] Block patches, Peter Maydell, 2015/10/30