]> Git Repo - qemu.git/commitdiff
block: Fix bdrv_all_delete_snapshot() error handling
authorKevin Wolf <[email protected]>
Mon, 6 Jun 2016 10:53:22 +0000 (12:53 +0200)
committerKevin Wolf <[email protected]>
Wed, 8 Jun 2016 08:21:09 +0000 (10:21 +0200)
The code to exit the loop after bdrv_snapshot_delete_by_id_or_name()
returned failure was duplicated. The first copy of it was too early so
that the AioContext lock would not be freed. This patch removes it so
that only the second, correct copy remains.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
block/snapshot.c

index 6e6e34fcf418a89be3226fccfab6df397f7bab9c..da89d2b085508cb65c6cb6455ffcfafd4f67ccea 100644 (file)
@@ -409,9 +409,6 @@ int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,
         if (bdrv_can_snapshot(bs) &&
                 bdrv_snapshot_find(bs, snapshot, name) >= 0) {
             ret = bdrv_snapshot_delete_by_id_or_name(bs, name, err);
-            if (ret < 0) {
-                goto fail;
-            }
         }
         aio_context_release(ctx);
         if (ret < 0) {
This page took 0.026815 seconds and 4 git commands to generate.