* [Qemu-devel] [PATCH] qcow2: Fix snapshot restoration in snapshot_create
@ 2013-10-09 12:42 Max Reitz
2013-10-09 13:21 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2013-10-09 12:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Max Reitz
If the new snapshot table could not be written in qcow2_snapshot_create,
the old snapshot table has to be restored in memory and the new one
released. This should include restoration of the old snapshot count as
well, which is added by this patch.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/qcow2-snapshot.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 812dab2..fe7e14c 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -433,6 +433,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
if (ret < 0) {
g_free(s->snapshots);
s->snapshots = old_snapshot_list;
+ s->nb_snapshots--;
goto fail;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qcow2: Fix snapshot restoration in snapshot_create
2013-10-09 12:42 [Qemu-devel] [PATCH] qcow2: Fix snapshot restoration in snapshot_create Max Reitz
@ 2013-10-09 13:21 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2013-10-09 13:21 UTC (permalink / raw)
To: Max Reitz; +Cc: qemu-devel, Stefan Hajnoczi
Am 09.10.2013 um 14:42 hat Max Reitz geschrieben:
> If the new snapshot table could not be written in qcow2_snapshot_create,
> the old snapshot table has to be restored in memory and the new one
> released. This should include restoration of the old snapshot count as
> well, which is added by this patch.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-09 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09 12:42 [Qemu-devel] [PATCH] qcow2: Fix snapshot restoration in snapshot_create Max Reitz
2013-10-09 13:21 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).