ia64/xen-unstable

changeset 16269:d25ab83a89e3

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 <berrange@redhat.com>
author Keir Fraser <keir@xensource.com>
date Tue Oct 30 09:22:27 2007 +0000 (2007-10-30)
parents 09d8b6eb3131
children 5cc6a30faf69
files tools/ioemu/vl.c
line diff
     1.1 --- a/tools/ioemu/vl.c	Tue Oct 30 09:19:43 2007 +0000
     1.2 +++ b/tools/ioemu/vl.c	Tue Oct 30 09:22:27 2007 +0000
     1.3 @@ -6203,12 +6203,10 @@ void main_loop_wait(int timeout)
     1.4          IOHandlerRecord **pioh;
     1.5  
     1.6          for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
     1.7 -            if (ioh->deleted)
     1.8 -                continue;
     1.9 -            if (ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
    1.10 +            if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
    1.11                  ioh->fd_read(ioh->opaque);
    1.12              }
    1.13 -            if (ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
    1.14 +            if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
    1.15                  ioh->fd_write(ioh->opaque);
    1.16              }
    1.17          }