Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Kevin Wolf
Am 06.02.2015 um 16:31 hat Eric Blake geschrieben: > On 02/06/2015 08:27 AM, Eric Blake wrote: > > >> > >> -/* The cluster refcount was incremented, either by > >> qcow2_alloc_clusters() > >> - * or explicitly by qcow2_update_cluster_refcount(). Refcount blocks > >> must > >> - *

Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Eric Blake
On 02/06/2015 08:27 AM, Eric Blake wrote: >> >> -/* The cluster refcount was incremented, either by >> qcow2_alloc_clusters() >> - * or explicitly by qcow2_update_cluster_refcount(). Refcount blocks >> must >> - * be flushed before the caller's L2 table updates. >> - */ >> +

Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Eric Blake
On 02/06/2015 07:39 AM, Max Reitz wrote: > qcow2_alloc_bytes() is a function with insufficient error handling and > an unnecessary goto. This patch rewrites it. > > Signed-off-by: Max Reitz > --- > v3: > - Use alloc_clusters_noref() and update_refcount() [Kevin] Ouch. Not done quite right. Kev

Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Kevin Wolf
Am 06.02.2015 um 15:39 hat Max Reitz geschrieben: > qcow2_alloc_bytes() is a function with insufficient error handling and > an unnecessary goto. This patch rewrites it. > > Signed-off-by: Max Reitz > --- > v3: > - Use alloc_clusters_noref() and update_refcount() [Kevin] > - Only modify s->free_b

[Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Max Reitz
qcow2_alloc_bytes() is a function with insufficient error handling and an unnecessary goto. This patch rewrites it. Signed-off-by: Max Reitz --- v3: - Use alloc_clusters_noref() and update_refcount() [Kevin] - Only modify s->free_byte_offset if the function is successful; this is now necessary