Re: [Qemu-devel] [PATCH v2 5/9] qcow2: Rework qcow2_snapshot_create error handling

2011-11-22 Thread Stefan Hajnoczi
On Tue, Nov 22, 2011 at 9:14 AM, Kevin Wolf wrote: > Am 21.11.2011 17:47, schrieb Stefan Hajnoczi: >> On Fri, Nov 18, 2011 at 6:29 PM, Kevin Wolf wrote: >>> +    /* >>> +     * Increase the refcounts of all clusters and make sure everything is >>> +     * stable on disk before updating the snapsh

Re: [Qemu-devel] [PATCH v2 5/9] qcow2: Rework qcow2_snapshot_create error handling

2011-11-22 Thread Kevin Wolf
Am 21.11.2011 17:47, schrieb Stefan Hajnoczi: > On Fri, Nov 18, 2011 at 6:29 PM, Kevin Wolf wrote: >> +/* >> + * Increase the refcounts of all clusters and make sure everything is >> + * stable on disk before updating the snapshot table to contain a >> pointer >> + * to the new L1

Re: [Qemu-devel] [PATCH v2 5/9] qcow2: Rework qcow2_snapshot_create error handling

2011-11-21 Thread Stefan Hajnoczi
On Fri, Nov 18, 2011 at 6:29 PM, Kevin Wolf wrote: > +    /* > +     * Increase the refcounts of all clusters and make sure everything is > +     * stable on disk before updating the snapshot table to contain a pointer > +     * to the new L1 table. > +     */ > +    ret = qcow2_update_snapshot_re

[Qemu-devel] [PATCH v2 5/9] qcow2: Rework qcow2_snapshot_create error handling

2011-11-18 Thread Kevin Wolf
Increase refcounts only after allocating a new L1 table has succeeded in order to make leaks less likely. If writing the snapshot table fails, revert in-memory state to be consistent with that on disk. While at it, make it return the real error codes instead of -1. Signed-off-by: Kevin Wolf ---