Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-13 Thread lan,Tianyu
oh,yeah. Thanks for your reply. It's a good lesson for me. :) I will update soon. On 二, 2011-12-13 at 16:57 +0800, Kevin Wolf wrote: > Am 13.12.2011 04:41, schrieb lan,Tianyu: > > On 一, 2011-12-12 at 19:15 +0800, Kevin Wolf wrote: > >> Am 12.12.2011 11:58, schrieb Pekka Enberg: > >>> On Mon, 12 Dec

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-13 Thread Pekka Enberg
On Tue, Dec 13, 2011 at 10:57 AM, Kevin Wolf wrote: >> So the ENOSPEC should be specially dealt with. >> >> Does this make sense? :) > > I'm not saying that your code won't work today, just that it's brittle. > If someone adds a different error return code somewhere and doesn't > check if all call

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-13 Thread Pekka Enberg
On Tue, Dec 13, 2011 at 5:16 AM, lan,Tianyu wrote: > I have tried to use ERR_PTR(). But when I included linux/err.h, a > compile error  was following. > >  CC       disk/qcow.o > In file included from disk/qcow.c:20: > ../../include/linux/err.h:22: error: expected '=', ',', ';', 'asm' or > '__attr

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-13 Thread Kevin Wolf
Am 13.12.2011 04:05, schrieb lan,Tianyu: > Thanks for your review. > On 一, 2011-12-12 at 17:55 +0800, Kevin Wolf wrote: >> Am 12.12.2011 03:03, schrieb Lan Tianyu: >>> This patch enables allocating new refcount blocks and so then kvm tools >>> could expand qcow2 image much larger. >>> >>> Signed-of

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-13 Thread Kevin Wolf
Am 13.12.2011 04:41, schrieb lan,Tianyu: > On 一, 2011-12-12 at 19:15 +0800, Kevin Wolf wrote: >> Am 12.12.2011 11:58, schrieb Pekka Enberg: >>> On Mon, 12 Dec 2011, Kevin Wolf wrote: > @@ -667,14 +722,11 @@ static struct qcow_refcount_block > *qcow_read_refcount_block(struct qcow *q, u64 >

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread lan,Tianyu
On 一, 2011-12-12 at 19:15 +0800, Kevin Wolf wrote: > Am 12.12.2011 11:58, schrieb Pekka Enberg: > > On Mon, 12 Dec 2011, Kevin Wolf wrote: > >>> @@ -667,14 +722,11 @@ static struct qcow_refcount_block > >>> *qcow_read_refcount_block(struct qcow *q, u64 > >>> > >>> rft_idx = clust_idx >> (header-

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread lan,Tianyu
On 一, 2011-12-12 at 18:58 +0800, Pekka Enberg wrote: > On Mon, 12 Dec 2011, Kevin Wolf wrote: > >> @@ -667,14 +722,11 @@ static struct qcow_refcount_block > >> *qcow_read_refcount_block(struct qcow *q, u64 > >> > >>rft_idx = clust_idx >> (header->cluster_bits - > >> QCOW_REFCOUNT_BLOCK_SHIFT)

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread lan,Tianyu
Thanks for your review. On 一, 2011-12-12 at 17:55 +0800, Kevin Wolf wrote: > Am 12.12.2011 03:03, schrieb Lan Tianyu: > > This patch enables allocating new refcount blocks and so then kvm tools > > could expand qcow2 image much larger. > > > > Signed-off-by: Lan Tianyu > > --- > > tools/kvm/disk

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 12:15, schrieb Kevin Wolf: > Am 12.12.2011 11:58, schrieb Pekka Enberg: >> On Mon, 12 Dec 2011, Kevin Wolf wrote: @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64 rft_idx = clust_idx >> (header->cluster_bits

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 11:58, schrieb Pekka Enberg: > On Mon, 12 Dec 2011, Kevin Wolf wrote: >>> @@ -667,14 +722,11 @@ static struct qcow_refcount_block >>> *qcow_read_refcount_block(struct qcow *q, u64 >>> >>> rft_idx = clust_idx >> (header->cluster_bits - >>> QCOW_REFCOUNT_BLOCK_SHIFT); >>> if (

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Pekka Enberg
On Mon, 12 Dec 2011, Kevin Wolf wrote: @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64 rft_idx = clust_idx >> (header->cluster_bits - QCOW_REFCOUNT_BLOCK_SHIFT); if (rft_idx >= rft->rf_size) - return NULL; +

Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-12 Thread Kevin Wolf
Am 12.12.2011 03:03, schrieb Lan Tianyu: > This patch enables allocating new refcount blocks and so then kvm tools > could expand qcow2 image much larger. > > Signed-off-by: Lan Tianyu > --- > tools/kvm/disk/qcow.c | 105 +--- > 1 files changed, 89 in

[RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks

2011-12-11 Thread Lan Tianyu
This patch enables allocating new refcount blocks and so then kvm tools could expand qcow2 image much larger. Signed-off-by: Lan Tianyu --- tools/kvm/disk/qcow.c | 105 +--- 1 files changed, 89 insertions(+), 16 deletions(-) diff --git a/tools/kvm/di