rpms/qemu/F-13 0049-migration-Clear-fd-also-in-error-cases.patch, NONE, 1.1 qemu.spec, 1.161, 1.162

Justin M. Forbes jforbes at fedoraproject.org
Wed Mar 10 17:07:06 UTC 2010


Author: jforbes

Update of /cvs/pkgs/rpms/qemu/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14307

Modified Files:
	qemu.spec 
Added Files:
	0049-migration-Clear-fd-also-in-error-cases.patch 
Log Message:
Migration clear the fd in error cases (#518032)

0049-migration-Clear-fd-also-in-error-cases.patch:
 migration-exec.c |    3 +--
 migration-fd.c   |    3 +--
 migration-tcp.c  |    5 ++---
 migration-unix.c |    6 ++----
 4 files changed, 6 insertions(+), 11 deletions(-)

--- NEW FILE 0049-migration-Clear-fd-also-in-error-cases.patch ---
>From a0591dc91ad795ffb47476b37730e46977a6be36 Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela at redhat.com>
Date: Tue, 9 Mar 2010 23:58:50 +0100
Subject: [PATCH] migration: Clear fd also in error cases

Not clearing the fd and closing the file makes qemu spin using 100%CPU
after incoming migration error.

See for instance bug:
https://bugzilla.redhat.com/show_bug.cgi?id=518032

Signed-off-by: Juan Quintela <quintela at trasno.org>
---
 migration-exec.c |    3 +--
 migration-fd.c   |    3 +--
 migration-tcp.c  |    5 ++---
 migration-unix.c |    5 ++---
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/migration-exec.c b/migration-exec.c
index 87f645b..e57a55d 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -120,12 +120,11 @@ static void exec_accept_incoming_migration(void *opaque)
     }
     qemu_announce_self();
     dprintf("successfully loaded vm state\n");
-    /* we've successfully migrated, close the fd */
-    qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
     if (autostart)
         vm_start();

 err:
+    qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
     qemu_fclose(f);
 }

diff --git a/migration-fd.c b/migration-fd.c
index ef7edbc..7325d13 100644
--- a/migration-fd.c
+++ b/migration-fd.c
@@ -113,12 +113,11 @@ static void fd_accept_incoming_migration(void *opaque)
     }
     qemu_announce_self();
     dprintf("successfully loaded vm state\n");
-    /* we've successfully migrated, close the fd */
-    qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
     if (autostart)
         vm_start();

 err:
+    qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
     qemu_fclose(f);
 }

diff --git a/migration-tcp.c b/migration-tcp.c
index 2cfa8cb..c328e73 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -170,15 +170,14 @@ static void tcp_accept_incoming_migration(void *opaque)
     qemu_announce_self();
     dprintf("successfully loaded vm state\n");

-    /* we've successfully migrated, close the server socket */
-    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
-    close(s);
     if (autostart)
         vm_start();

 out_fopen:
     qemu_fclose(f);
 out:
+    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
+    close(s);
     close(c);
 }

diff --git a/migration-unix.c b/migration-unix.c
index a141dbb..9685c4b 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -176,13 +176,12 @@ static void unix_accept_incoming_migration(void *opaque)
     qemu_announce_self();
     dprintf("successfully loaded vm state\n");

-    /* we've successfully migrated, close the server socket */
-    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
-    close(s);

 out_fopen:
     qemu_fclose(f);
 out:
+    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
+    close(s);
     close(c);
 }

-- 
1.6.6.1



Index: qemu.spec
===================================================================
RCS file: /cvs/pkgs/rpms/qemu/F-13/qemu.spec,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -p -r1.161 -r1.162
--- qemu.spec	9 Mar 2010 16:24:34 -0000	1.161
+++ qemu.spec	10 Mar 2010 17:07:06 -0000	1.162
@@ -1,7 +1,7 @@
 Summary: QEMU is a FAST! processor emulator
 Name: qemu
 Version: 0.12.3
-Release: 4%{?dist}
+Release: 5%{?dist}
 # Epoch because we pushed a qemu-1.0 package
 Epoch: 2
 License: GPLv2+ and LGPLv2+ and BSD
@@ -82,6 +82,7 @@ Patch45: 0045-pc-Add-a-Fedora-13-machine
 Patch46: 0046-pc-Add-backward-compatibility-options-for-virtio-ser.patch
 Patch47: 0047-virtio-serial-don-t-set-MULTIPORT-for-1-port-dev.patch
 Patch48: 0048-virtio-serial-pci-Allow-MSI-to-be-disabled.patch
+Patch49: 0049-migration-Clear-fd-also-in-error-cases.patch
 
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -322,6 +323,7 @@ such as kvmtrace and kvm_stat.
 %patch46 -p1
 %patch47 -p1
 %patch48 -p1
+%patch49 -p1
 
 %build
 # By default we build everything, but allow x86 to build a minimal version
@@ -624,6 +626,9 @@ fi
 %{_mandir}/man1/qemu-img.1*
 
 %changelog
+* Wed Mar 10 2010 Justin M. Forbes <jforbes at redhat.com> - 2:0.12.3-5
+- Migration clear the fd in error cases (#518032)
+
 * Tue Mar 09 2010 Justin M. Forbes <jforbes at redhat.com> - 2:0.12.3-4
 - Allow builds --with x86only
 - Add libaio-devel buildreq for aio support



More information about the scm-commits mailing list