[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate
From: |
Hu Tao |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate |
Date: |
Wed, 27 Nov 2013 14:01:09 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Nov 27, 2013 at 11:01:23AM +0800, Fam Zheng wrote:
> On 2013年11月27日 10:15, Hu Tao wrote:
> >Signed-off-by: Hu Tao <address@hidden>
> >---
> > block/qcow2.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> >diff --git a/block/qcow2.c b/block/qcow2.c
> >index b054a01..a23fade 100644
> >--- a/block/qcow2.c
> >+++ b/block/qcow2.c
> >@@ -2180,6 +2180,12 @@ static int qcow2_amend_options(BlockDriverState *bs,
> > return 0;
> > }
> >
> >+static int qcow2_preallocate(BlockDriverState *bs, int64_t offset,
> >+ int64_t length)
> >+{
> >+ return bdrv_preallocate(bs->file, offset, length);
> >+}
> >+
>
> What's the semantics of .bdrv_preallocate? I think you should map
> [offset, offset + length) to clusters in image file, and then
> forward to bs->file, rather than this direct wrapper.
>
> E.g. bdrv_preallocate(qcow2_bs, 0, cluster_size) should call
> bdrv_preallocate(qcow2_bs->file, offset_off_first_cluster,
> cluster_size).
You mean data clusters here, right? Is there a single function to get
the offset of the first data cluster?
- [Qemu-devel] [RFC PATCH v2 0/6] qemu-img: add preallocation=full, Hu Tao, 2013/11/26
- [Qemu-devel] [RFC PATCH v2 1/6] block: introduce prealloc_mode, Hu Tao, 2013/11/26
- [Qemu-devel] [RFC PATCH v2 2/6] block: add BlockDriver.bdrv_preallocate., Hu Tao, 2013/11/26
- [Qemu-devel] [RFC PATCH v2 3/6] block/raw-posix: implement bdrv_preallocate, Hu Tao, 2013/11/26
- [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Hu Tao, 2013/11/26
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Fam Zheng, 2013/11/26
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate,
Hu Tao <=
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Fam Zheng, 2013/11/27
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Peter Lieven, 2013/11/27
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Fam Zheng, 2013/11/27
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Peter Lieven, 2013/11/27
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Hu Tao, 2013/11/28
- Re: [Qemu-devel] [RFC PATCH v2 5/6] qcow2: implement bdrv_preallocate, Peter Lieven, 2013/11/28
[Qemu-devel] [RFC PATCH v2 4/6] raw-posix: Add full image preallocation option, Hu Tao, 2013/11/26
[Qemu-devel] [RFC PATCH v2 6/6] qcow2: Add full image preallocation option, Hu Tao, 2013/11/26
Re: [Qemu-devel] [RFC PATCH v2 0/6] qemu-img: add preallocation=full, Fam Zheng, 2013/11/26