[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 11/15] vmdk: Return extent's file in bdrv_get
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v8 11/15] vmdk: Return extent's file in bdrv_get_block_status |
Date: |
Tue, 26 Jan 2016 11:44:13 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, 01/25 14:28, Kevin Wolf wrote:
> Am 25.01.2016 um 03:44 hat Fam Zheng geschrieben:
> > Signed-off-by: Fam Zheng <address@hidden>
> > Reviewed-by: Max Reitz <address@hidden>
> > ---
> > block/vmdk.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/block/vmdk.c b/block/vmdk.c
> > index e1d3e27..f8f7fcf 100644
> > --- a/block/vmdk.c
> > +++ b/block/vmdk.c
> > @@ -1274,6 +1274,7 @@ static int64_t coroutine_fn
> > vmdk_co_get_block_status(BlockDriverState *bs,
> > 0, 0);
> > qemu_co_mutex_unlock(&s->lock);
> >
> > + index_in_cluster = vmdk_find_index_in_cluster(extent, sector_num);
> > switch (ret) {
> > case VMDK_ERROR:
> > ret = -EIO;
> > @@ -1286,14 +1287,15 @@ static int64_t coroutine_fn
> > vmdk_co_get_block_status(BlockDriverState *bs,
> > break;
> > case VMDK_OK:
> > ret = BDRV_BLOCK_DATA;
> > - if (extent->file == bs->file && !extent->compressed) {
> > - ret |= BDRV_BLOCK_OFFSET_VALID | offset;
> > + if (!extent->compressed) {
> > + ret |= BDRV_BLOCK_OFFSET_VALID;
> > + ret |= (offset + (index_in_cluster << BDRV_SECTOR_BITS))
> > + & BDRV_BLOCK_OFFSET_MASK;
> > }
> > -
> > + *file = extent->file->bs;
> > break;
> > }
> >
> > - index_in_cluster = vmdk_find_index_in_cluster(extent, sector_num);
> > n = extent->cluster_sectors - index_in_cluster;
> > if (n > nb_sectors) {
> > n = nb_sectors;
>
> The commit message made me expect that this does exactly the same as the
> other patches, i.e. fill the file argument and nothing else.
>
> Instead, this extends the functioniality to work on any kind of extents
> instead of just the the main VMDK file, and it changes the calculation
> of the offset (seems to be a hidden bug fix?)
>
> This needs a non-empty commit message, and depending on what you're
> going to write there, possibly splitting the patch.
Will split it.
Fam
- Re: [Qemu-devel] [PATCH v8 04/15] raw: Assign bs to file in raw_co_get_block_status, (continued)
- [Qemu-devel] [PATCH v8 05/15] iscsi: Assign bs to file in iscsi_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 06/15] parallels: Assign bs->file->bs to file in parallels_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 07/15] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 08/15] sheepdog: Assign bs to file in sd_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 09/15] vdi: Assign bs->file->bs to file in vdi_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 10/15] vpc: Assign bs->file->bs to file in vpc_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 11/15] vmdk: Return extent's file in bdrv_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 12/15] block: Use returned *file in bdrv_co_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 13/15] qemu-img: In "map", use the returned "file" from bdrv_get_block_status, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 14/15] qemu-img: Make MapEntry a QAPI struct, Fam Zheng, 2016/01/24
- [Qemu-devel] [PATCH v8 15/15] iotests: Add "qemu-img map" test for VMDK extents, Fam Zheng, 2016/01/24
- Re: [Qemu-devel] [PATCH v8 00/15] qemu-img map: Allow driver to return file of the allocated block, Kevin Wolf, 2016/01/25