[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/26] vhost: Merge and delete unused callbacks
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 09/26] vhost: Merge and delete unused callbacks |
Date: |
Thu, 8 Feb 2018 21:09:03 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
Now that the olf vhost_set_memory code is gone, the _nop and _add
callbacks are identical and can be merged. The _del callback is
no longer needed.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost.c | 33 +++++----------------------------
1 file changed, 5 insertions(+), 28 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index c7814d1..326f168 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -560,8 +560,9 @@ static void vhost_region_add_section(struct vhost_dev *dev,
}
}
-static void vhost_region_add(MemoryListener *listener,
- MemoryRegionSection *section)
+/* Used for both add and nop callbacks */
+static void vhost_region_addnop(MemoryListener *listener,
+ MemoryRegionSection *section)
{
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
memory_listener);
@@ -572,29 +573,6 @@ static void vhost_region_add(MemoryListener *listener,
vhost_region_add_section(dev, section);
}
-/* Called on regions that have not changed */
-static void vhost_region_nop(MemoryListener *listener,
- MemoryRegionSection *section)
-{
- struct vhost_dev *dev = container_of(listener, struct vhost_dev,
- memory_listener);
-
- if (!vhost_section(section)) {
- return;
- }
-
- vhost_region_add_section(dev, section);
-}
-
-static void vhost_region_del(MemoryListener *listener,
- MemoryRegionSection *section)
-{
- if (!vhost_section(section)) {
- return;
- }
-
-}
-
static void vhost_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb)
{
struct vhost_iommu *iommu = container_of(n, struct vhost_iommu, n);
@@ -1163,9 +1141,8 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
hdev->memory_listener = (MemoryListener) {
.begin = vhost_begin,
.commit = vhost_commit,
- .region_add = vhost_region_add,
- .region_del = vhost_region_del,
- .region_nop = vhost_region_nop,
+ .region_add = vhost_region_addnop,
+ .region_nop = vhost_region_addnop,
.log_start = vhost_log_start,
.log_stop = vhost_log_stop,
.log_sync = vhost_log_sync,
--
MST
- [Qemu-devel] [PULL 00/26] virtio, vhost, pci, pc: features, fixes and cleanups, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 01/26] Revert "vhost: add traces for memory listeners", Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 04/26] vhost: Build temporary section list and deref after commit, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 02/26] virtio: remove event notifier cleanup call on de-assign, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 05/26] vhost: Simplify ring verification checks, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 06/26] vhost: Merge sections added to temporary list, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 07/26] vhost: Regenerate region list from changed sections list, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 09/26] vhost: Merge and delete unused callbacks,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 10/26] vhost: Move log_dirty check, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 11/26] pci-bridge/i82801b11: clear bridge registers on platform reset, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 08/26] vhost: Clean out old vhost_set_memory and friends, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 13/26] virtio-blk: enable multiple vectors when using multiple I/O queues, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 12/26] pci/bus: let it has higher migration priority, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 17/26] cryptodev-vhost-user: add crypto session handler, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 16/26] cryptodev: add vhost support, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 15/26] cryptodev: add vhost-user as a new cryptodev backend, Michael S. Tsirkin, 2018/02/08
- [Qemu-devel] [PULL 20/26] libvhost-user: Fix resource leak, Michael S. Tsirkin, 2018/02/08