]> git.proxmox.com Git - mirror_qemu.git/blobdiff - blockdev.c
target/i386/cpu.h: declare TCG_GUEST_DEFAULT_MO
[mirror_qemu.git] / blockdev.c
index 8eb4e84fe03bcbc56d6827bfb6e1b025a3b56c7b..f1f49bd3ca9aa99776af5f64e50d0aa60a7d938c 100644 (file)
@@ -1614,6 +1614,7 @@ typedef struct ExternalSnapshotState {
     BlockDriverState *old_bs;
     BlockDriverState *new_bs;
     AioContext *aio_context;
+    bool overlay_appended;
 } ExternalSnapshotState;
 
 static void external_snapshot_prepare(BlkActionState *common,
@@ -1780,6 +1781,7 @@ static void external_snapshot_prepare(BlkActionState *common,
         error_propagate(errp, local_err);
         return;
     }
+    state->overlay_appended = true;
 }
 
 static void external_snapshot_commit(BlkActionState *common)
@@ -1803,8 +1805,8 @@ static void external_snapshot_abort(BlkActionState *common)
     ExternalSnapshotState *state =
                              DO_UPCAST(ExternalSnapshotState, common, common);
     if (state->new_bs) {
-        if (state->new_bs->backing) {
-            bdrv_replace_in_backing_chain(state->new_bs, state->old_bs);
+        if (state->overlay_appended) {
+            bdrv_replace_node(state->new_bs, state->old_bs, &error_abort);
         }
     }
 }