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