From: Dietmar Maurer Date: Tue, 16 Sep 2014 10:52:43 +0000 (+0200) Subject: apply patches/hotfix for virtio-net migration problem in 2.1.1 X-Git-Url: https://git.proxmox.com/?p=pve-qemu-kvm.git;a=commitdiff_plain;h=9a5aa63a259914942c8839a475f5fd1965729420 apply patches/hotfix for virtio-net migration problem in 2.1.1 --- diff --git a/debian/patches/revert_virtio_dont_call_device_on_not_vm_running.patch b/debian/patches/revert_virtio_dont_call_device_on_not_vm_running.patch new file mode 100644 index 0000000..d27fd49 --- /dev/null +++ b/debian/patches/revert_virtio_dont_call_device_on_not_vm_running.patch @@ -0,0 +1,55 @@ +Date: Thu, 11 Sep 2014 19:18:37 +0300 +From: "Michael S. Tsirkin" +To: + +This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8. + virtio: don't call device on !vm_running +It turns out that virtio net assumes that vm_running +is updated before device status callback in many places, +so this change leads to asserts. +Previous commit fixes the root issue that motivated +a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently, +so there's no longer a need for this change. + +In the future, we might be able to drop checking vm_running +completely, and check vm state directly. + +Reported-by: Dietmar Maurer +Cc: qemu-stable@nongnu.org +Cc: Jason Wang +Signed-off-by: Michael S. Tsirkin +--- + hw/virtio/virtio.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c +index ac22238..5c98180 100644 +--- a/hw/virtio/virtio.c ++++ b/hw/virtio/virtio.c +@@ -1108,10 +1108,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state) + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); + bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK); +- +- if (running) { +- vdev->vm_running = running; +- } ++ vdev->vm_running = running; + + if (backend_run) { + virtio_set_status(vdev, vdev->status); +@@ -1124,10 +1121,6 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state) + if (!backend_run) { + virtio_set_status(vdev, vdev->status); + } +- +- if (!running) { +- vdev->vm_running = running; +- } + } + + void virtio_init(VirtIODevice *vdev, const char *name, +-- +MST + + diff --git a/debian/patches/series b/debian/patches/series index 1381414..a0868a1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -27,3 +27,5 @@ disable-efi-enable-pxe-roms.patch backup-vma-allow-empty-backups.patch glusterfs-daemonize.patch gluster-backupserver.patch +virtio-net_drop_assert_on_vm_stop.patch +revert_virtio_dont_call_device_on_not_vm_running.patch diff --git a/debian/patches/virtio-net_drop_assert_on_vm_stop.patch b/debian/patches/virtio-net_drop_assert_on_vm_stop.patch new file mode 100644 index 0000000..fd22c84 --- /dev/null +++ b/debian/patches/virtio-net_drop_assert_on_vm_stop.patch @@ -0,0 +1,33 @@ +Date: Thu, 11 Sep 2014 19:18:34 +0300 +From: "Michael S. Tsirkin" +To: + +On vm stop, vm_running state set to stopped +before device is notified, so callbacks can get envoked with +vm_running = false; and this is not an error. + +Cc: qemu-stable@nongnu.org +Cc: Jason Wang +Signed-off-by: Michael S. Tsirkin +--- + hw/net/virtio-net.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 826a2a5..2040eac 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -1125,8 +1125,6 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q) + return num_packets; + } + +- assert(vdev->vm_running); +- + if (q->async_tx.elem.out_num) { + virtio_queue_set_notification(q->tx_vq, 0); + return num_packets; +-- +MST + + +