Re: [Qemu-devel] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status

2015-05-25 Thread Fam Zheng
On Mon, 05/25 16:43, Paolo Bonzini wrote: > > > On 22/05/2015 05:40, Fam Zheng wrote: > > +{ > > +BlockDriverState *p; > > +int64_t ret; > > + > > +assert(bs != base); > > +for (p = bs; p != base; p = p->backing_hd) { > > +ret = bdrv_co_get_block_status(p, sector_num, nb_s

Re: [Qemu-devel] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status

2015-05-25 Thread Paolo Bonzini
On 22/05/2015 05:40, Fam Zheng wrote: > +{ > +BlockDriverState *p; > +int64_t ret; > + > +assert(bs != base); > +for (p = bs; p != base; p = p->backing_hd) { > +ret = bdrv_co_get_block_status(p, sector_num, nb_sectors, pnum); It's a bit ugly to have different parameters f

Re: [Qemu-devel] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status

2015-05-22 Thread Eric Blake
On 05/21/2015 09:40 PM, Fam Zheng wrote: > Now this function follows the backing chain until seeing BDRV_BLOCK_ALLOCATED. > Base is not included, and it can be NULL just like bdrv_is_allocated_above(). > > Existing callers pass in bs->backing_hd to keep the old behavior. > > Signed-off-by: Fam Zh

[Qemu-devel] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status

2015-05-21 Thread Fam Zheng
Now this function follows the backing chain until seeing BDRV_BLOCK_ALLOCATED. Base is not included, and it can be NULL just like bdrv_is_allocated_above(). Existing callers pass in bs->backing_hd to keep the old behavior. Signed-off-by: Fam Zheng --- block/io.c| 39