]> git.proxmox.com Git - pve-qemu-kvm.git/blame - 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
CommitLineData
9a5aa63a
DM
1Date: Thu, 11 Sep 2014 19:18:37 +0300\r
2From: "Michael S. Tsirkin" <mst@redhat.com>\r
3To: <qemu-devel@nongnu.org>\r
4\r
5This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8.\r
6 virtio: don't call device on !vm_running\r
7It turns out that virtio net assumes that vm_running\r
8is updated before device status callback in many places,\r
9so this change leads to asserts.\r
10Previous commit fixes the root issue that motivated\r
11a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently,\r
12so there's no longer a need for this change.\r
13\r
14In the future, we might be able to drop checking vm_running\r
15completely, and check vm state directly.\r
16\r
17Reported-by: Dietmar Maurer <dietmar@proxmox.com>\r
18Cc: qemu-stable@nongnu.org\r
19Cc: Jason Wang <jasowang@redhat.com>\r
20Signed-off-by: Michael S. Tsirkin <mst@redhat.com>\r
21---\r
22 hw/virtio/virtio.c | 9 +--------\r
23 1 file changed, 1 insertion(+), 8 deletions(-)\r
24\r
25diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c\r
26index ac22238..5c98180 100644\r
27--- a/hw/virtio/virtio.c\r
28+++ b/hw/virtio/virtio.c\r
29@@ -1108,10 +1108,7 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)\r
30 BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));\r
31 VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);\r
32 bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);\r
33-\r
34- if (running) {\r
35- vdev->vm_running = running;\r
36- }\r
37+ vdev->vm_running = running;\r
38 \r
39 if (backend_run) {\r
40 virtio_set_status(vdev, vdev->status);\r
41@@ -1124,10 +1121,6 @@ static void virtio_vmstate_change(void *opaque, int running, RunState state)\r
42 if (!backend_run) {\r
43 virtio_set_status(vdev, vdev->status);\r
44 }\r
45-\r
46- if (!running) {\r
47- vdev->vm_running = running;\r
48- }\r
49 }\r
50 \r
51 void virtio_init(VirtIODevice *vdev, const char *name,\r
52-- \r
53MST\r
54\r
55\r