From: Keir Fraser Date: Tue, 30 Oct 2007 09:22:27 +0000 (+0000) Subject: qemu vnc auth 1/4: QEMU event handler bug fix X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14828^2~15 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5b52d6724c5b2da0994eb69f27bd81a69b639a49;p=xen.git 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 --- 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); } }