qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Fix segfault on migration completion


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH v2] Fix segfault on migration completion
Date: Mon, 31 Oct 2011 01:27:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Luiz Capitulino <address@hidden> 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 <address@hidden>
> Acked-by: Eduardo Habkost <address@hidden>
> Signed-off-by: Luiz Capitulino <address@hidden>
> ---
>
> V2: better commit log

Acked-by: Juan Quintela <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]