From 5b52d6724c5b2da0994eb69f27bd81a69b639a49 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 30 Oct 2007 09:22:27 +0000 Subject: [PATCH] qemu vnc auth 1/4: QEMU event handler bug fix This patch pulls in an upstream QEMU fix for dealing with a problem in the event dispatcher where a write callback gets unregistered while a write event is pending from poll. Without this the QEMU process with deference a NULL pointer and crash. Signed-off-by: Daniel P. Berrange --- tools/ioemu/vl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index 1187f0cd39..f3abe2ed05 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -6203,12 +6203,10 @@ void main_loop_wait(int timeout) IOHandlerRecord **pioh; for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { - if (ioh->deleted) - continue; - if (ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) { + if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) { ioh->fd_read(ioh->opaque); } - if (ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) { + if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) { ioh->fd_write(ioh->opaque); } } -- 2.30.2