aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/vhost-scsi.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/scsi/vhost-scsi.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/scsi/vhost-scsi.c')
-rw-r--r--hw/scsi/vhost-scsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 3059068..bdf337a 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -120,7 +120,7 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
start = false;
}
- if (vsc->dev.started == start) {
+ if (vhost_dev_is_started(&vsc->dev) == start) {
return;
}
@@ -147,7 +147,7 @@ static int vhost_scsi_pre_save(void *opaque)
/* At this point, backend must be stopped, otherwise
* it might keep writing to memory. */
- assert(!vsc->dev.started);
+ assert(!vhost_dev_is_started(&vsc->dev));
return 0;
}