Re: [Qemu-devel] [PATCH 2/2] block: Avoid second open for format probing

2012-11-14 Thread Kevin Wolf
Am 14.11.2012 09:32, schrieb Stefan Hajnoczi: > On Tue, Nov 13, 2012 at 03:14:55PM +0100, Kevin Wolf wrote: >> @@ -691,12 +685,15 @@ static int bdrv_open_common(BlockDriverState *bs, >> const char *filename, >> >> /* Open the image, either directly or using a protocol */ >> if (drv->bd

Re: [Qemu-devel] [PATCH 2/2] block: Avoid second open for format probing

2012-11-14 Thread Paolo Bonzini
Il 14/11/2012 09:32, Stefan Hajnoczi ha scritto: > On Tue, Nov 13, 2012 at 03:14:55PM +0100, Kevin Wolf wrote: >> @@ -691,12 +685,15 @@ static int bdrv_open_common(BlockDriverState *bs, >> const char *filename, >> >> /* Open the image, either directly or using a protocol */ >> if (drv-

Re: [Qemu-devel] [PATCH 2/2] block: Avoid second open for format probing

2012-11-14 Thread Stefan Hajnoczi
On Tue, Nov 13, 2012 at 03:14:55PM +0100, Kevin Wolf wrote: > @@ -691,12 +685,15 @@ static int bdrv_open_common(BlockDriverState *bs, const > char *filename, > > /* Open the image, either directly or using a protocol */ > if (drv->bdrv_file_open) { > +if (file != NULL) { > +

[Qemu-devel] [PATCH 2/2] block: Avoid second open for format probing

2012-11-13 Thread Kevin Wolf
This fixes problems that are caused by the additional open/close cycle of the existing format probing, for example related to qemu-nbd without -t option or file descriptor passing. Signed-off-by: Kevin Wolf --- block.c | 58 +++--- 1 files ch