]> git.proxmox.com Git - pve-qemu-kvm.git/blobdiff - debian/patches/revert_virtio_dont_call_device_on_not_vm_running.patch
apply patches/hotfix for virtio-net migration problem in 2.1.1
[pve-qemu-kvm.git] / debian / patches / revert_virtio_dont_call_device_on_not_vm_running.patch
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 (file)
index 0000000..d27fd49
--- /dev/null
@@ -0,0 +1,55 @@
+Date: Thu, 11 Sep 2014 19:18:37 +0300\r
+From: "Michael S. Tsirkin" <mst@redhat.com>\r
+To: <qemu-devel@nongnu.org>\r
+\r
+This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8.\r
+    virtio: don't call device on !vm_running\r
+It turns out that virtio net assumes that vm_running\r
+is updated before device status callback in many places,\r
+so this change leads to asserts.\r
+Previous commit fixes the root issue that motivated\r
+a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently,\r
+so there's no longer a need for this change.\r
+\r
+In the future, we might be able to drop checking vm_running\r
+completely, and check vm state directly.\r
+\r
+Reported-by: Dietmar Maurer <dietmar@proxmox.com>\r
+Cc: qemu-stable@nongnu.org\r
+Cc: Jason Wang <jasowang@redhat.com>\r
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>\r
+---\r
+ hw/virtio/virtio.c | 9 +--------\r
+ 1 file changed, 1 insertion(+), 8 deletions(-)\r
+\r
+diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c\r
+index ac22238..5c98180 100644\r
+--- a/hw/virtio/virtio.c\r
++++ b/hw/virtio/virtio.c\r
+@@ -1108,10 +1108,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)\r
+     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));\r
+     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);\r
+     bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);\r
+-\r
+-    if (running) {\r
+-        vdev->vm_running = running;\r
+-    }\r
++    vdev->vm_running = running;\r
\r
+     if (backend_run) {\r
+         virtio_set_status(vdev, vdev->status);\r
+@@ -1124,10 +1121,6 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)\r
+     if (!backend_run) {\r
+         virtio_set_status(vdev, vdev->status);\r
+     }\r
+-\r
+-    if (!running) {\r
+-        vdev->vm_running = running;\r
+-    }\r
+ }\r
\r
+ void virtio_init(VirtIODevice *vdev, const char *name,\r
+-- \r
+MST\r
+\r
+\r