From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrwZF-0007nr-TK for qemu-devel@nongnu.org; Wed, 17 Mar 2010 12:58:01 -0400 Received: from [199.232.76.173] (port=35631 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrwZF-0007nT-Ea for qemu-devel@nongnu.org; Wed, 17 Mar 2010 12:58:01 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrwZD-0004jl-Nw for qemu-devel@nongnu.org; Wed, 17 Mar 2010 12:58:01 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:60989) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NrwZD-0004jc-9Y for qemu-devel@nongnu.org; Wed, 17 Mar 2010 12:57:59 -0400 Received: by pwi9 with SMTP id 9so888027pwi.4 for ; Wed, 17 Mar 2010 09:57:57 -0700 (PDT) Message-ID: <4BA10A12.3030500@codemonkey.ws> Date: Wed, 17 Mar 2010 11:57:54 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] migration: Clear fd also in error cases References: <45ea53fc070c1f076583945a62b18da10ee9687a.1268176134.git.quintela@redhat.com> In-Reply-To: <45ea53fc070c1f076583945a62b18da10ee9687a.1268176134.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 03/09/2010 05:10 PM, Juan Quintela wrote: > 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 > Applied all. Thanks. Regards, Anthony Liguori > --- > migration-exec.c | 4 ++-- > migration-fd.c | 4 ++-- > migration-tcp.c | 5 ++--- > migration-unix.c | 5 ++--- > 4 files changed, 8 insertions(+), 10 deletions(-) > > diff --git a/migration-exec.c b/migration-exec.c > index 3edc026..6ff8449 100644 > --- a/migration-exec.c > +++ b/migration-exec.c > @@ -120,12 +120,12 @@ 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 0cc74ad..9cf52ce 100644 > --- a/migration-fd.c > +++ b/migration-fd.c > @@ -113,12 +113,12 @@ 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 e7f307c..95ce722 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 b7aab38..ce59a2a 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); > } > >