[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/24] vhost: introduce vhost_dev_virtqueue_stop()
From: |
Kangjie Xu |
Subject: |
[PATCH v2 09/24] vhost: introduce vhost_dev_virtqueue_stop() |
Date: |
Tue, 16 Aug 2022 09:06:21 +0800 |
Introduce vhost_dev_virtqueue_stop(), which can ummap the
vrings and the desc of it.
Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
hw/virtio/vhost.c | 9 +++++++++
include/hw/virtio/vhost.h | 3 +++
2 files changed, 12 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index e467dfc7bc..1bca9ff48d 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1904,3 +1904,12 @@ int vhost_net_set_backend(struct vhost_dev *hdev,
return -ENOSYS;
}
+
+void vhost_dev_virtqueue_stop(struct vhost_dev *hdev, VirtIODevice *vdev,
+ int idx)
+{
+ vhost_virtqueue_unmap(hdev,
+ vdev,
+ hdev->vqs + idx,
+ idx);
+}
diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
index a346f23d13..574888440c 100644
--- a/include/hw/virtio/vhost.h
+++ b/include/hw/virtio/vhost.h
@@ -288,4 +288,7 @@ int vhost_dev_set_inflight(struct vhost_dev *dev,
struct vhost_inflight *inflight);
int vhost_dev_get_inflight(struct vhost_dev *dev, uint16_t queue_size,
struct vhost_inflight *inflight);
+
+void vhost_dev_virtqueue_stop(struct vhost_dev *hdev, VirtIODevice *vdev,
+ int idx);
#endif
--
2.32.0
- Re: [PATCH v2 03/24] virtio: introduce virtio_queue_reset(), (continued)
- [PATCH v2 07/24] virtio-pci: support queue enable, Kangjie Xu, 2022/08/15
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Jason Wang, 2022/08/23
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Kangjie Xu, 2022/08/23
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Jason Wang, 2022/08/24
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Kangjie Xu, 2022/08/24
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Jason Wang, 2022/08/24
- Re: [PATCH v2 07/24] virtio-pci: support queue enable, Kangjie Xu, 2022/08/24
[PATCH v2 04/24] virtio: introduce virtio_queue_enable(), Kangjie Xu, 2022/08/15
[PATCH v2 09/24] vhost: introduce vhost_dev_virtqueue_stop(),
Kangjie Xu <=
[PATCH v2 10/24] vhost: introduce vhost_dev_virtqueue_restart(), Kangjie Xu, 2022/08/15
[PATCH v2 11/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_stop(), Kangjie Xu, 2022/08/15