[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 5/5] virtio: Don't change "started" flag on virti
From: |
elohimes |
Subject: |
[Qemu-devel] [PATCH v4 5/5] virtio: Don't change "started" flag on virtio_vmstate_change() |
Date: |
Wed, 26 Jun 2019 10:31:30 +0800 |
From: Xie Yongji <address@hidden>
We will call virtio_set_status() on virtio_vmstate_change().
The "started" flag should not be changed in this case. Otherwise,
we may get an incorrect value when we set "started" flag but
not set DRIVER_OK in source VM.
Signed-off-by: Xie Yongji <address@hidden>
---
hw/virtio/virtio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index e098fc8ef0..18f9f4c372 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1163,7 +1163,10 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val)
}
}
- virtio_set_started(vdev, val & VIRTIO_CONFIG_S_DRIVER_OK);
+ if ((vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) !=
+ (val & VIRTIO_CONFIG_S_DRIVER_OK)) {
+ virtio_set_started(vdev, val & VIRTIO_CONFIG_S_DRIVER_OK);
+ }
if (k->set_status) {
k->set_status(vdev, val);
--
2.17.1
- [Qemu-devel] [PATCH v4 0/5] virtio: fix some issues of "started" and "start_on_kick" flag, elohimes, 2019/06/25
- [Qemu-devel] [PATCH v4 2/5] virtio: Set "start_on_kick" for legacy devices, elohimes, 2019/06/25
- [Qemu-devel] [PATCH v4 3/5] virtio: Set "start_on_kick" on virtio_set_features(), elohimes, 2019/06/25
- [Qemu-devel] [PATCH v4 1/5] virtio: add "use-started" property, elohimes, 2019/06/25
- [Qemu-devel] [PATCH v4 5/5] virtio: Don't change "started" flag on virtio_vmstate_change(),
elohimes <=
- [Qemu-devel] [PATCH v4 4/5] virtio: Make sure we get correct state of device on handle_aio_output(), elohimes, 2019/06/25
- Re: [Qemu-devel] [PATCH v4 0/5] virtio: fix some issues of "started" and "start_on_kick" flag, Laurent Vivier, 2019/06/26