]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio: sync the dataplane vring state to the virtqueue before virtio_save
authorPavel Butsykin <pbutsykin@virtuozzo.com>
Mon, 26 Oct 2015 11:42:57 +0000 (14:42 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sat, 31 Oct 2015 17:39:47 +0000 (12:39 -0500)
commitfc63922556a5064173411d8cea1e303256ee3c8c
treebc6bbb59a7ab2259cd416f11a8e59d043d6a35ae
parent36e1eee7603ad1683df9446e104c6f5849d854c6
virtio: sync the dataplane vring state to the virtqueue before virtio_save

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 <pbutsykin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Message-id: 1445859777-2982-1-git-send-email-den@openvz.org
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 10a06fd65f667a972848ebbbcac11bdba931b544)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/block/virtio-blk.c
hw/scsi/virtio-scsi.c