[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 34/41] vhost: implement vhost_dev_start method
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 34/41] vhost: implement vhost_dev_start method |
Date: |
Sat, 4 Jul 2020 14:30:51 -0400 |
From: Cindy Lu <lulu@redhat.com>
use the vhost_dev_start callback to send the status to backend
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20200701145538.22333-8-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio/vhost.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 10304b583e..32809e54b5 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1685,7 +1685,12 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
goto fail_log;
}
}
-
+ if (hdev->vhost_ops->vhost_dev_start) {
+ r = hdev->vhost_ops->vhost_dev_start(hdev, true);
+ if (r) {
+ goto fail_log;
+ }
+ }
if (vhost_dev_has_iommu(hdev) &&
hdev->vhost_ops->vhost_set_iotlb_callback) {
hdev->vhost_ops->vhost_set_iotlb_callback(hdev, true);
@@ -1723,6 +1728,9 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice
*vdev)
/* should only be called after backend is connected */
assert(hdev->vhost_ops);
+ if (hdev->vhost_ops->vhost_dev_start) {
+ hdev->vhost_ops->vhost_dev_start(hdev, false);
+ }
for (i = 0; i < hdev->nvqs; ++i) {
vhost_virtqueue_stop(hdev,
vdev,
--
MST
- [PULL v2 26/41] docs: vhost-user: add Virtio status protocol feature, (continued)
- [PULL v2 26/41] docs: vhost-user: add Virtio status protocol feature, Michael S. Tsirkin, 2020/07/04
- [PULL v2 28/41] net: introduce qemu_get_peer, Michael S. Tsirkin, 2020/07/04
- [PULL v2 29/41] vhost_net: use the function qemu_get_peer, Michael S. Tsirkin, 2020/07/04
- [PULL v2 30/41] virtio-bus: introduce queue_enabled method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 31/41] virtio-pci: implement queue_enabled method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 32/41] vhost: check the existence of vhost_set_iotlb_callback, Michael S. Tsirkin, 2020/07/04
- [PULL v2 33/41] vhost: introduce new VhostOps vhost_dev_start, Michael S. Tsirkin, 2020/07/04
- [PULL v2 34/41] vhost: implement vhost_dev_start method,
Michael S. Tsirkin <=
- [PULL v2 35/41] vhost: introduce new VhostOps vhost_vq_get_addr, Michael S. Tsirkin, 2020/07/04
- [PULL v2 36/41] vhost: implement vhost_vq_get_addr method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 37/41] vhost: introduce new VhostOps vhost_force_iommu, Michael S. Tsirkin, 2020/07/04
- [PULL v2 39/41] vhost_net: introduce set_config & get_config, Michael S. Tsirkin, 2020/07/04
- [PULL v2 38/41] vhost: implement vhost_force_iommu method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 40/41] vhost-vdpa: introduce vhost-vdpa backend, Michael S. Tsirkin, 2020/07/04
- [PULL v2 41/41] vhost-vdpa: introduce vhost-vdpa net client, Michael S. Tsirkin, 2020/07/04
- [PULL v2 21/41] virtio-mem: Migration sanity checks, Michael S. Tsirkin, 2020/07/04