aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-vsock-common.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2022-08-02 10:49:59 +0100
committerMichael S. Tsirkin <mst@redhat.com>2022-10-07 09:41:51 -0400
commitb8f3e6a18de6ad5cb668c5430b4933f1e40783cf (patch)
tree5dae60d01c48a72924737b17221176a1020be804 /hw/virtio/vhost-vsock-common.c
parent9f6bcfd99f46377888059d8539befec9505f57fb (diff)
downloadqemu-b8f3e6a18de6ad5cb668c5430b4933f1e40783cf.zip
qemu-b8f3e6a18de6ad5cb668c5430b4933f1e40783cf.tar.gz
qemu-b8f3e6a18de6ad5cb668c5430b4933f1e40783cf.tar.bz2
hw/virtio: move vhd->started check into helper and add FIXME
The `started` field is manipulated internally within the vhost code except for one place, vhost-user-blk via f5b22d06fb (vhost: recheck dev state in the vhost_migration_log routine). Mark that as a FIXME because it introduces a potential race. I think the referenced fix should be tracking its state locally. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220802095010.3330793-12-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Raphael Norwitz <raphael.norwittz@nutanix.com>
Diffstat (limited to 'hw/virtio/vhost-vsock-common.c')
-rw-r--r--hw/virtio/vhost-vsock-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/virtio/vhost-vsock-common.c b/hw/virtio/vhost-vsock-common.c
index 7394818..29b9ab4 100644
--- a/hw/virtio/vhost-vsock-common.c
+++ b/hw/virtio/vhost-vsock-common.c
@@ -14,6 +14,7 @@
#include "hw/virtio/virtio-access.h"
#include "qemu/error-report.h"
#include "hw/qdev-properties.h"
+#include "hw/virtio/vhost.h"
#include "hw/virtio/vhost-vsock.h"
#include "qemu/iov.h"
#include "monitor/monitor.h"
@@ -199,7 +200,7 @@ int vhost_vsock_common_pre_save(void *opaque)
* At this point, backend must be stopped, otherwise
* it might keep writing to memory.
*/
- assert(!vvc->vhost_dev.started);
+ assert(!vhost_dev_is_started(&vvc->vhost_dev));
return 0;
}