[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-1.4 stable] block: handle spurious coroutine
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH for-1.4 stable] block: handle spurious coroutine entries |
Date: |
Mon, 11 Feb 2013 11:57:53 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Feb 11, 2013 at 11:16:09AM +0100, Paolo Bonzini wrote:
> Il 09/02/2013 17:44, Stefan Hajnoczi ha scritto:
> > bdrv_co_io_em(), bdrv_co_flush(), and bdrv_co_discard() yield the
> > coroutine when waiting for aio to complete. They do not check that the
> > request has actually finished.
> >
> > In simple cases this works, but it returns early when we get spurious
> > wake-ups due to qemu_coroutine_enter() being called from other sources.
> > One such example is block-migration.c:process_incoming_migration().
> >
> > This patch fixes a segfault on incoming block migration.
> >
> > Reported-by: David Pravec <address@hidden>
> > Signed-off-by: Stefan Hajnoczi <address@hidden>
>
> I would prefer to have ret initialized to -EINPROGRESS, but since we're
> close to release it's easier this way.
I did it that way first but then I felt a little paranoid about using
the return value space as the sentinel. Granted, most block functions
will never return -EINPROGRESS but I think a separate bool done variable
is cleaner.
Stefan