Skip to content

Commit ca71db4

Browse files
lulu-github-namemstsirkin
authored andcommitted
vhost: implement vhost_dev_start method
use the vhost_dev_start callback to send the status to backend Signed-off-by: Cindy Lu <[email protected]> Message-Id: <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent 68513bc commit ca71db4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hw/virtio/vhost.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,12 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
16851685
goto fail_log;
16861686
}
16871687
}
1688-
1688+
if (hdev->vhost_ops->vhost_dev_start) {
1689+
r = hdev->vhost_ops->vhost_dev_start(hdev, true);
1690+
if (r) {
1691+
goto fail_log;
1692+
}
1693+
}
16891694
if (vhost_dev_has_iommu(hdev) &&
16901695
hdev->vhost_ops->vhost_set_iotlb_callback) {
16911696
hdev->vhost_ops->vhost_set_iotlb_callback(hdev, true);
@@ -1723,6 +1728,9 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
17231728
/* should only be called after backend is connected */
17241729
assert(hdev->vhost_ops);
17251730

1731+
if (hdev->vhost_ops->vhost_dev_start) {
1732+
hdev->vhost_ops->vhost_dev_start(hdev, false);
1733+
}
17261734
for (i = 0; i < hdev->nvqs; ++i) {
17271735
vhost_virtqueue_stop(hdev,
17281736
vdev,

0 commit comments

Comments
 (0)