All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] Fix segfault on migration completion
Date: Mon, 31 Oct 2011 01:27:07 +0100	[thread overview]
Message-ID: <m3ehxungys.fsf@neno.neno> (raw)
In-Reply-To: <20111028145952.4bb63294@doriath> (Luiz Capitulino's message of "Fri, 28 Oct 2011 14:59:52 -0200")

Luiz Capitulino <lcapitulino@redhat.com> wrote:
> A simple migration reproduces it:
>
> 1. Start the source VM with:
>
>    # qemu [...] -S
>
> 2. Start the destination VM with:
>
>    # qemu <source VM cmd-line> -incoming tcp:0:4444
>
> 3. In the source VM:
>
>    (qemu) migrate -d tcp:0:4444
>
> 4. The source VM will segfault as soon as migration completes (might not
>    happen in the first try)
>
> What is happening here is that qemu_file_put_notify() can end up closing
> 's->file' (in which case it's also set to NULL). The call stack is rather
> complex, but Eduardo helped tracking it to:
>
> select loop -> migrate_fd_put_notify() -> qemu_file_put_notify() ->
> buffered_put_buffer() -> migrate_fd_put_ready() ->
> migrate_fd_completed() -> migrate_fd_cleanup().
>
> To be honest, it's not completely clear to me in which cases 's->file'
> is not closed (on error maybe)? But I doubt this fix will make anything
> worse.
>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>
> V2: better commit log

Acked-by: Juan Quintela <quintela@redhat.com>

And people wonder why error handling on migration is difficult, sniff
:-(

  reply	other threads:[~2011-10-31  0:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 16:59 [Qemu-devel] [PATCH v2] Fix segfault on migration completion Luiz Capitulino
2011-10-31  0:27 ` Juan Quintela [this message]
2011-10-31  6:15 ` Markus Armbruster
2011-11-01 18:04 ` Anthony Liguori

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=m3ehxungys.fsf@neno.neno \
    --to=quintela@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.