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>
This commit is contained in:
Alex Bennée 2022-08-02 10:49:59 +01:00 committed by Michael S. Tsirkin
parent 9f6bcfd99f
commit b8f3e6a18d
10 changed files with 33 additions and 13 deletions

View file

@ -57,7 +57,7 @@ static void vuv_set_status(VirtIODevice *vdev, uint8_t status)
VHostVSockCommon *vvc = VHOST_VSOCK_COMMON(vdev);
bool should_start = virtio_device_started(vdev, status);
if (vvc->vhost_dev.started == should_start) {
if (vhost_dev_is_started(&vvc->vhost_dev) == should_start) {
return;
}