qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset
Date: Tue, 19 Jan 2010 13:02:41 +0100
User-agent: Mutt/1.3.28i

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 for success, 0 for failure) and I didn't
> want to overload m->cluster_offset with such a meaning. This is the
> change in the caller:
> 
>    /* Need to wait for another request? If so, we are done for now. */
> -  if (!acb->cluster_offset && acb->l2meta.depends_on != NULL) {
> +  if (acb->l2meta.nb_clusters == 0 && acb->l2meta.depends_on != NULL) {
> 
> The alternative would have been to keep using the return value and
> hijack some errno value. This would possibly conflict with real
> read/write errors though, so I decided to leave the return value alone.

Ok, makes sense.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]