aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-user-fs.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-user-fs.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-user-fs.c')
-rw-r--r--hw/virtio/vhost-user-fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c
index d2bebba..ad0f91c 100644
--- a/hw/virtio/vhost-user-fs.c
+++ b/hw/virtio/vhost-user-fs.c
@@ -20,6 +20,7 @@
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"
#include "qemu/error-report.h"
+#include "hw/virtio/vhost.h"
#include "hw/virtio/vhost-user-fs.h"
#include "monitor/monitor.h"
#include "sysemu/sysemu.h"
@@ -124,7 +125,7 @@ static void vuf_set_status(VirtIODevice *vdev, uint8_t status)
VHostUserFS *fs = VHOST_USER_FS(vdev);
bool should_start = virtio_device_started(vdev, status);
- if (fs->vhost_dev.started == should_start) {
+ if (vhost_dev_is_started(&fs->vhost_dev) == should_start) {
return;
}