All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] migration: Clear fd also in error cases
Date: Wed, 17 Mar 2010 11:57:54 -0500	[thread overview]
Message-ID: <4BA10A12.3030500@codemonkey.ws> (raw)
In-Reply-To: <45ea53fc070c1f076583945a62b18da10ee9687a.1268176134.git.quintela@redhat.com>

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<quintela@redhat.com>
>    

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);
>   }
>
>    

  reply	other threads:[~2010-03-17 16:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 23:10 [Qemu-devel] [PATCH 0/2] Migration fixes Juan Quintela
2010-03-09 23:10 ` [Qemu-devel] [PATCH 1/2] migration: Clear fd also in error cases Juan Quintela
2010-03-17 16:57   ` Anthony Liguori [this message]
2010-03-09 23:10 ` [Qemu-devel] [PATCH 2/2] migration: unix migration should obey autostart are the other ones Juan Quintela
2010-03-11 20:27   ` Anthony Liguori
2010-03-11 20:42     ` [Qemu-devel] " Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA10A12.3030500@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.