aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2021-08-16 21:35:52 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2021-09-30 15:30:24 +0200
commit142518bda515c132a46ce5826e73fbd2a5b154d9 (patch)
treeabc85b88e464cd7c8b380158daf229dbba00061e /hw/virtio
parent523a3d9524d5edd49dbec50c634b6e3872ad7d84 (diff)
memory: Name all the memory listeners
Provide a name field for all the memory listeners. It can be used to identify which memory listener is which. Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Message-Id: <20210817013553.30584-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/vhost-vdpa.c1
-rw-r--r--hw/virtio/vhost.c2
-rw-r--r--hw/virtio/virtio.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 7633ea66d1..47d7a5a23d 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -246,6 +246,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener,
* depends on the addnop().
*/
static const MemoryListener vhost_vdpa_memory_listener = {
+ .name = "vhost-vdpa",
.commit = vhost_vdpa_listener_commit,
.region_add = vhost_vdpa_listener_region_add,
.region_del = vhost_vdpa_listener_region_del,
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index b4b29413e6..437347ad01 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1366,6 +1366,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
hdev->features = features;
hdev->memory_listener = (MemoryListener) {
+ .name = "vhost",
.begin = vhost_begin,
.commit = vhost_commit,
.region_add = vhost_region_addnop,
@@ -1381,6 +1382,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
};
hdev->iommu_listener = (MemoryListener) {
+ .name = "vhost-iommu",
.region_add = vhost_iommu_region_add,
.region_del = vhost_iommu_region_del,
};
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 3a1f6c520c..240759ff0b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3670,6 +3670,7 @@ static void virtio_device_realize(DeviceState *dev, Error **errp)
}
vdev->listener.commit = virtio_memory_listener_commit;
+ vdev->listener.name = "virtio";
memory_listener_register(&vdev->listener, vdev->dma_as);
}