Patchwork [uq/master,5/9] ivshmem: wrap ivshmem_del_eventfd loops with transaction

login
register
mail settings
Submitter Paolo Bonzini
Date July 5, 2012, 3:16 p.m.
Message ID <1341501390-797-6-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/169217/
State New
Headers show

Comments

Paolo Bonzini - July 5, 2012, 3:16 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ivshmem.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 3cdbea2..19e164a 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -369,8 +369,12 @@  static void close_guest_eventfds(IVShmemState *s, int posn)
 
     guest_curr_max = s->peers[posn].nb_eventfds;
 
+    memory_region_transaction_begin();
     for (i = 0; i < guest_curr_max; i++) {
         ivshmem_del_eventfd(s, posn, i);
+    }
+    memory_region_transaction_commit();
+    for (i = 0; i < guest_curr_max; i++) {
         event_notifier_cleanup(&s->peers[posn].eventfds[i]);
     }