aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-10-02 20:13:51 +0200
committerAvi Kivity <avi@redhat.com>2012-10-22 14:50:07 +0200
commitf6790af6bcfa35fa9ea3c565a0a2aed54337aef5 (patch)
treea26b7a7c52d483f083c7672af26e62f774e1b706 /hw
parent1d71148eace669827ba15101819b54b20fcca616 (diff)
memory: use AddressSpace for MemoryListener filtering
Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/vfio_pci.c3
-rw-r--r--hw/vhost.c2
-rw-r--r--hw/xen_pt.c4
3 files changed, 4 insertions, 5 deletions
diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c
index 49e11e7db3..f5db4a8567 100644
--- a/hw/vfio_pci.c
+++ b/hw/vfio_pci.c
@@ -1507,8 +1507,7 @@ static int vfio_connect_container(VFIOGroup *group)
container->iommu_data.listener = vfio_memory_listener;
container->iommu_data.release = vfio_listener_release;
- memory_listener_register(&container->iommu_data.listener,
- get_system_memory());
+ memory_listener_register(&container->iommu_data.listener, &address_space_memory);
} else {
error_report("vfio: No available IOMMU models\n");
g_free(container);
diff --git a/hw/vhost.c b/hw/vhost.c
index 100f7659a0..0b4ac3f1df 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -792,7 +792,7 @@ int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath,
hdev->log_size = 0;
hdev->log_enabled = false;
hdev->started = false;
- memory_listener_register(&hdev->memory_listener, get_system_memory());
+ memory_listener_register(&hdev->memory_listener, &address_space_memory);
hdev->force = force;
return 0;
fail:
diff --git a/hw/xen_pt.c b/hw/xen_pt.c
index d5dc11e582..d3d7c8bc3c 100644
--- a/hw/xen_pt.c
+++ b/hw/xen_pt.c
@@ -749,8 +749,8 @@ static int xen_pt_initfn(PCIDevice *d)
}
out:
- memory_listener_register(&s->memory_listener, get_system_memory());
- memory_listener_register(&s->io_listener, get_system_io());
+ memory_listener_register(&s->memory_listener, &address_space_memory);
+ memory_listener_register(&s->io_listener, &address_space_io);
XEN_PT_LOG(d, "Real physical device %02x:%02x.%d registered successfuly!\n",
bus, slot, func);