From 5b888e1858489e0baa6c1d14f492ec1fc9bde936 Mon Sep 17 00:00:00 2001 From: heretyk Date: Wed, 18 Apr 2007 21:50:15 +0000 Subject: [PATCH] - added patch to fix crash when using qemu with NICs connected via socket - release 4 Changed files: qemu-0.9.0-remove-iohandlers.patch -> 1.1.2.1 qemu.spec -> 1.85.2.5 --- qemu-0.9.0-remove-iohandlers.patch | 80 ++++++++++++++++++++++++++++++ qemu.spec | 6 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 qemu-0.9.0-remove-iohandlers.patch diff --git a/qemu-0.9.0-remove-iohandlers.patch b/qemu-0.9.0-remove-iohandlers.patch new file mode 100644 index 0000000..d42c02b --- /dev/null +++ b/qemu-0.9.0-remove-iohandlers.patch @@ -0,0 +1,80 @@ +diff -Naur qemu-0.9.0.orig/vl.c qemu-0.9.0/vl.c +--- qemu-0.9.0.orig/vl.c 2007-04-18 19:31:13.000000000 +0200 ++++ qemu-0.9.0/vl.c 2007-04-18 19:32:03.000000000 +0200 +@@ -4140,6 +4140,7 @@ + IOCanRWHandler *fd_read_poll; + IOHandler *fd_read; + IOHandler *fd_write; ++ int deleted; + void *opaque; + /* temporary data */ + struct pollfd *ufd; +@@ -4165,8 +4166,7 @@ + if (ioh == NULL) + break; + if (ioh->fd == fd) { +- *pioh = ioh->next; +- qemu_free(ioh); ++ ioh->deleted = 1; + break; + } + pioh = &ioh->next; +@@ -4187,6 +4187,7 @@ + ioh->fd_read = fd_read; + ioh->fd_write = fd_write; + ioh->opaque = opaque; ++ ioh->deleted = 0; + } + return 0; + } +@@ -5835,7 +5836,7 @@ + + void main_loop_wait(int timeout) + { +- IOHandlerRecord *ioh, *ioh_next; ++ IOHandlerRecord *ioh; + fd_set rfds, wfds, xfds; + int ret, nfds; + struct timeval tv; +@@ -5870,6 +5871,8 @@ + FD_ZERO(&wfds); + FD_ZERO(&xfds); + for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { ++ if (ioh->deleted) ++ continue; + if (ioh->fd_read && + (!ioh->fd_read_poll || + ioh->fd_read_poll(ioh->opaque) != 0)) { +@@ -5897,9 +5900,11 @@ + #endif + ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv); + if (ret > 0) { +- /* XXX: better handling of removal */ +- for(ioh = first_io_handler; ioh != NULL; ioh = ioh_next) { +- ioh_next = ioh->next; ++ IOHandlerRecord **pioh; ++ ++ for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { ++ if (ioh->deleted) ++ continue; + if (FD_ISSET(ioh->fd, &rfds)) { + ioh->fd_read(ioh->opaque); + } +@@ -5907,6 +5912,17 @@ + ioh->fd_write(ioh->opaque); + } + } ++ ++ /* remove deleted IO handlers */ ++ pioh = &first_io_handler; ++ while (*pioh) { ++ ioh = *pioh; ++ if (ioh->deleted) { ++ *pioh = ioh->next; ++ qemu_free(ioh); ++ } else ++ pioh = &ioh->next; ++ } + } + #if defined(CONFIG_SLIRP) + if (slirp_inited) { diff --git a/qemu.spec b/qemu.spec index 2401a5a..e8454dd 100644 --- a/qemu.spec +++ b/qemu.spec @@ -21,7 +21,7 @@ %undefine with_kernel %endif %define _kqemu_version 1.3.0pre11 -%define _rel 3 +%define _rel 4 Summary: QEMU CPU Emulator Summary(pl): QEMU - emulator procesora Name: qemu @@ -48,6 +48,9 @@ Patch9: %{name}-0.8.0-gcc4-hacks.patch Patch11: %{name}-0.7.2-gcc4-opts.patch #Patch12: %{name}-0.7.2-dyngen-check-stack-clobbers.patch Patch13: %{name}-dosguest.patch +# Fix crash when using qemu instances with NICs connected via socket +# This patch will be obsolete in versions after 0.9.0 +Patch14: %{name}-0.9.0-remove-iohandlers.patch URL: http://fabrice.bellard.free.fr/qemu/ %if %{with kernel} && %{with dist_kernel} BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7 @@ -156,6 +159,7 @@ exit 1 %{?with_nosdlgui:%patch6 -p1} %patch7 -p1 #%patch8 -p1 +%patch14 -p1 %{__sed} -i -e 's/sdl_static=yes/sdl_static=no/' configure %{__sed} -i 's/.*MAKE) -C kqemu$//' Makefile -- 2.44.0