mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
vhost: Merge and delete unused callbacks
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 <dgilbert@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
06709c120c
commit
938eeb640c
1 changed files with 5 additions and 28 deletions
|
@ -560,8 +560,9 @@ static void vhost_region_add_section(struct vhost_dev *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vhost_region_add(MemoryListener *listener,
|
/* Used for both add and nop callbacks */
|
||||||
MemoryRegionSection *section)
|
static void vhost_region_addnop(MemoryListener *listener,
|
||||||
|
MemoryRegionSection *section)
|
||||||
{
|
{
|
||||||
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
|
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
|
||||||
memory_listener);
|
memory_listener);
|
||||||
|
@ -572,29 +573,6 @@ static void vhost_region_add(MemoryListener *listener,
|
||||||
vhost_region_add_section(dev, section);
|
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)
|
static void vhost_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb)
|
||||||
{
|
{
|
||||||
struct vhost_iommu *iommu = container_of(n, struct vhost_iommu, n);
|
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) {
|
hdev->memory_listener = (MemoryListener) {
|
||||||
.begin = vhost_begin,
|
.begin = vhost_begin,
|
||||||
.commit = vhost_commit,
|
.commit = vhost_commit,
|
||||||
.region_add = vhost_region_add,
|
.region_add = vhost_region_addnop,
|
||||||
.region_del = vhost_region_del,
|
.region_nop = vhost_region_addnop,
|
||||||
.region_nop = vhost_region_nop,
|
|
||||||
.log_start = vhost_log_start,
|
.log_start = vhost_log_start,
|
||||||
.log_stop = vhost_log_stop,
|
.log_stop = vhost_log_stop,
|
||||||
.log_sync = vhost_log_sync,
|
.log_sync = vhost_log_sync,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue