[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: Fix direct use of protocols as driver fo
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] block: Fix direct use of protocols as driver for bdrv_open() |
Date: |
Thu, 28 Mar 2013 11:53:57 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Mar 27, 2013 at 05:28:18PM +0100, Kevin Wolf wrote:
> bdrv_open_common() implements direct use of protocols by copying the
> pre-opened BlockDriverStates to bs using bdrv_swap(). It did however
> first set some fields in bs, which end up in file after the swap. When
> bdrv_open() destroys file, it appears to be open, and because it isn't,
> qemu could segfault while trying to close it.
>
> Reorder the operations to return immediately in such cases so that file
> is correctly detected as closed.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block.c | 31 +++++++++++++++----------------
> 1 file changed, 15 insertions(+), 16 deletions(-)
Didn't apply cleanly, please check that I resolved the conflict
correctly.
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan