diff options
author | Avi Kivity <avi@redhat.com> | 2012-09-30 22:02:53 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-10-15 11:43:06 +0200 |
commit | 0fada67420e29f389119ca6f44285203400e0730 (patch) | |
tree | 3f5b54d43d89af7bdcc4d558350aef902c574e0d /hw/vhost.c | |
parent | 7762c2c1e02e44fdc473cbe75105faba08b906cc (diff) |
vhost: use MemoryListener filtering to only monitor RAM address space
Instead of checking manually, let the listener filter for us. This prepares
us for DMA address spaces.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/vhost.c')
-rw-r--r-- | hw/vhost.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/vhost.c b/hw/vhost.c index d0ce5aad9b..100f7659a0 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -434,8 +434,7 @@ static void vhost_set_memory(MemoryListener *listener, static bool vhost_section(MemoryRegionSection *section) { - return section->address_space == get_system_memory() - && memory_region_is_ram(section->mr); + return memory_region_is_ram(section->mr); } static void vhost_begin(MemoryListener *listener) @@ -793,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, NULL); + memory_listener_register(&hdev->memory_listener, get_system_memory()); hdev->force = force; return 0; fail: |