]>
Commit | Line | Data |
---|---|---|
9a5aa63a DM |
1 | Date: Thu, 11 Sep 2014 19:18:37 +0300\r |
2 | From: "Michael S. Tsirkin" <mst@redhat.com>\r | |
3 | To: <qemu-devel@nongnu.org>\r | |
4 | \r | |
5 | This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8.\r | |
6 | virtio: don't call device on !vm_running\r | |
7 | It turns out that virtio net assumes that vm_running\r | |
8 | is updated before device status callback in many places,\r | |
9 | so this change leads to asserts.\r | |
10 | Previous commit fixes the root issue that motivated\r | |
11 | a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently,\r | |
12 | so there's no longer a need for this change.\r | |
13 | \r | |
14 | In the future, we might be able to drop checking vm_running\r | |
15 | completely, and check vm state directly.\r | |
16 | \r | |
17 | Reported-by: Dietmar Maurer <dietmar@proxmox.com>\r | |
18 | Cc: qemu-stable@nongnu.org\r | |
19 | Cc: Jason Wang <jasowang@redhat.com>\r | |
20 | Signed-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 | |
25 | diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c\r | |
26 | index 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 | |
53 | MST\r | |
54 | \r | |
55 | \r |