Patchwork [RFC,v1,12/22] kvm: use new MEMORY_LISTENER_DEFAULT_OPS

login
register
mail settings
Submitter Avi Kivity
Date Oct. 3, 2012, 4:03 p.m.
Message ID <1349280245-16341-13-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/188861/
State New
Headers show

Comments

Avi Kivity - Oct. 3, 2012, 4:03 p.m.
Removes quite a bit of useless code.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 kvm-all.c | 32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index c69e012..5e9215d 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -703,14 +703,6 @@  static void kvm_set_phys_mem(MemoryRegionSection *section, bool add)
     }
 }
 
-static void kvm_begin(MemoryListener *listener)
-{
-}
-
-static void kvm_commit(MemoryListener *listener)
-{
-}
-
 static void kvm_region_add(MemoryListener *listener,
                            MemoryRegionSection *section)
 {
@@ -723,11 +715,6 @@  static void kvm_region_del(MemoryListener *listener,
     kvm_set_phys_mem(section, false);
 }
 
-static void kvm_region_nop(MemoryListener *listener,
-                           MemoryRegionSection *section)
-{
-}
-
 static void kvm_log_sync(MemoryListener *listener,
                          MemoryRegionSection *section)
 {
@@ -755,10 +742,6 @@  static void kvm_log_global_stop(struct MemoryListener *listener)
     assert(r >= 0);
 }
 
-static void kvm_log_nop(struct MemoryListener *listener)
-{
-}
-
 static void kvm_mem_ioeventfd_add(MemoryListener *listener,
                                   MemoryRegionSection *section,
                                   bool match_data, uint64_t data,
@@ -825,11 +808,9 @@  static void kvm_io_ioeventfd_del(MemoryListener *listener,
 }
 
 static MemoryListener kvm_memory_listener = {
-    .begin = kvm_begin,
-    .commit = kvm_commit,
+    MEMORY_LISTENER_DEFAULT_OPS,
     .region_add = kvm_region_add,
     .region_del = kvm_region_del,
-    .region_nop = kvm_region_nop,
     .log_start = kvm_log_start,
     .log_stop = kvm_log_stop,
     .log_sync = kvm_log_sync,
@@ -841,16 +822,7 @@  static void kvm_io_ioeventfd_del(MemoryListener *listener,
 };
 
 static MemoryListener kvm_io_listener = {
-    .begin = kvm_begin,
-    .commit = kvm_commit,
-    .region_add = kvm_region_nop,
-    .region_del = kvm_region_nop,
-    .region_nop = kvm_region_nop,
-    .log_start = kvm_region_nop,
-    .log_stop = kvm_region_nop,
-    .log_sync = kvm_region_nop,
-    .log_global_start = kvm_log_nop,
-    .log_global_stop = kvm_log_nop,
+    MEMORY_LISTENER_DEFAULT_OPS,
     .eventfd_add = kvm_io_ioeventfd_add,
     .eventfd_del = kvm_io_ioeventfd_del,
     .priority = 10,