mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-22 03:11:55 +00:00
vhost: set started flag while start is in progress
This makes it possible to use started flag for sanity checking of callbacks that happen during start/stop. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
1830b80ff2
commit
24f4fe345c
@ -873,6 +873,9 @@ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)
|
|||||||
int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
|
int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
|
||||||
{
|
{
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
|
hdev->started = true;
|
||||||
|
|
||||||
if (!vdev->binding->set_guest_notifiers) {
|
if (!vdev->binding->set_guest_notifiers) {
|
||||||
fprintf(stderr, "binding does not support guest notifiers\n");
|
fprintf(stderr, "binding does not support guest notifiers\n");
|
||||||
r = -ENOSYS;
|
r = -ENOSYS;
|
||||||
@ -918,8 +921,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hdev->started = true;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail_log:
|
fail_log:
|
||||||
fail_vq:
|
fail_vq:
|
||||||
@ -934,6 +935,8 @@ fail_features:
|
|||||||
vdev->binding->set_guest_notifiers(vdev->binding_opaque, hdev->nvqs, false);
|
vdev->binding->set_guest_notifiers(vdev->binding_opaque, hdev->nvqs, false);
|
||||||
fail_notifiers:
|
fail_notifiers:
|
||||||
fail:
|
fail:
|
||||||
|
|
||||||
|
hdev->started = false;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user