]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
ivshmem: fix memory_region_del_eventfd assertion failure
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Aug 2012 21:09:47 +0000 (23:09 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Aug 2012 06:50:02 +0000 (01:50 -0500)
We do not register ioeventfds unless the IVSHMEM_IOEVENTFD feature
is set.  The same feature must be checked before releasing the eventfds.
Regression introduced by commit 563027c (ivshmem: use EventNotifier and
memory API, 2012-07-05).

Reported-by: Cam Macdonnell <cam@cs.ualberta.ca>
Tested-by: Cam Macdonnell <cam@cs.ualberta.ca>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 98609cd8fcf755c0ba7049d751353b8b2e243b65)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ivshmem.c

index d48e5f99064e9b01ed0d445cf8e6b8d372aebd8c..36005618bc9e87abd3a8d6187c5a8a5f04bc8ae2 100644 (file)
@@ -351,6 +351,10 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
 {
     int i, guest_curr_max;
 
+    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
+        return;
+    }
+
     guest_curr_max = s->peers[posn].nb_eventfds;
 
     for (i = 0; i < guest_curr_max; i++) {