Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset

2010-01-19 Thread Kevin Wolf
Am 19.01.2010 12:35, schrieb Christoph Hellwig: @@ -715,6 +721,7 @@ uint64_t qcow2_alloc_cluster_offset(BlockDriverState *bs, cluster_offset = ~QCOW_OFLAG_COPIED; m-nb_clusters = 0; +m-depends_on = NULL; What does this have to do with the rest? It's needed to

Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset

2010-01-19 Thread Christoph Hellwig
On Tue, Jan 19, 2010 at 12:57:35PM +0100, Kevin Wolf wrote: It's needed to be able to distinguish between the case where the clusters are already allocated (0/NULL) and the case where the request depends on another one (0/non-NULL). This check previously used the return value (cluster_offset

Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset

2010-01-19 Thread Christoph Hellwig
@@ -715,6 +721,7 @@ uint64_t qcow2_alloc_cluster_offset(BlockDriverState *bs, cluster_offset = ~QCOW_OFLAG_COPIED; m-nb_clusters = 0; +m-depends_on = NULL; What does this have to do with the rest? Otherwise looks good, Reviewed-by: Christoph Hellwig h...@lst.de

[Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset

2010-01-18 Thread Kevin Wolf
Returning 0/-errno allows it to distingush different errors classes. The cluster offset of newly allocated clusters is now returned in the QCowL2Meta struct. Signed-off-by: Kevin Wolf kw...@redhat.com --- block/qcow2-cluster.c | 28 ++-- block/qcow2.c | 36