Re: [Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions

2015-12-01 Thread Stefan Hajnoczi
On Mon, Nov 30, 2015 at 05:09:49PM +0800, Fam Zheng wrote: > On Mon, 11/30 16:38, Stefan Hajnoczi wrote: > > On Thu, Nov 26, 2015 at 01:05:21PM +0800, Fam Zheng wrote: > > > @@ -1535,13 +1541,14 @@ static int64_t coroutine_fn > > > bdrv_co_get_block_status(BlockDriverState *bs, > > > } >

Re: [Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions

2015-11-30 Thread Fam Zheng
On Mon, 11/30 16:38, Stefan Hajnoczi wrote: > On Thu, Nov 26, 2015 at 01:05:21PM +0800, Fam Zheng wrote: > > @@ -1535,13 +1541,14 @@ static int64_t coroutine_fn > > bdrv_co_get_block_status(BlockDriverState *bs, > > } > > } > > > > -if (bs->file && > > +if (*file && *file !

Re: [Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions

2015-11-30 Thread Stefan Hajnoczi
On Thu, Nov 26, 2015 at 01:05:21PM +0800, Fam Zheng wrote: > @@ -1535,13 +1541,14 @@ static int64_t coroutine_fn > bdrv_co_get_block_status(BlockDriverState *bs, > } > } > > -if (bs->file && > +if (*file && *file != bs && > (ret & BDRV_BLOCK_DATA) && !(ret & BDRV_B

[Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions

2015-11-25 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is referring to. It's value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status. Signed-o