From: Paolo Bonzini Date: Wed, 22 Aug 2012 21:09:47 +0000 (+0200) Subject: ivshmem: fix memory_region_del_eventfd assertion failure X-Git-Tag: v1.1.2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63f7166a80a204e8d6d1732315b5c924d46f31d3;p=thirdparty%2Fqemu.git ivshmem: fix memory_region_del_eventfd assertion failure 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 Tested-by: Cam Macdonnell Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori (cherry picked from commit 98609cd8fcf755c0ba7049d751353b8b2e243b65) Signed-off-by: Michael Roth --- diff --git a/hw/ivshmem.c b/hw/ivshmem.c index d48e5f99064..36005618bc9 100644 --- a/hw/ivshmem.c +++ b/hw/ivshmem.c @@ -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++) {