]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
snapshot: fix reference counting bug
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Aug 2014 11:30:05 +0000 (13:30 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Aug 2014 11:30:05 +0000 (13:30 +0200)
debian/patches/internal-snapshot-async.patch

index 570c6e10ff546330e7775569a317039dfc0e60af..4a6871d553832b01a36444e74bb329cf495360ca 100644 (file)
@@ -36,7 +36,7 @@ Index: new/Makefile.objs
 Index: new/block.c
 ===================================================================
 --- new.orig/block.c   2014-08-02 15:03:20.000000000 +0200
-+++ new/block.c        2014-08-07 11:56:38.000000000 +0200
++++ new/block.c        2014-08-07 13:26:45.000000000 +0200
 @@ -2083,7 +2083,7 @@
      bdrv_set_backing_hd(bs_top, bs_new);
  }
@@ -369,8 +369,8 @@ Index: new/qmp-commands.hx
 Index: new/savevm-async.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ new/savevm-async.c 2014-08-07 11:56:38.000000000 +0200
-@@ -0,0 +1,486 @@
++++ new/savevm-async.c 2014-08-07 13:29:41.000000000 +0200
+@@ -0,0 +1,488 @@
 +#include "qemu-common.h"
 +#include "qapi/qmp/qerror.h"
 +#include "sysemu/sysemu.h"
@@ -632,9 +632,13 @@ Index: new/savevm-async.c
 +    }
 +
 +    /* Open the image */
-+    snap_state.bs = bdrv_new("vmstate", &error_abort);
-+    ret = bdrv_open(&snap_state.bs, statefile, NULL, NULL, bdrv_oflags, drv, &local_err);
++    snap_state.bs = bdrv_new("vmstate", &local_err);
++    if (local_err) {
++        error_propagate(errp, local_err);
++        goto restart;
++    }
 +
++    ret = bdrv_open(&snap_state.bs, statefile, NULL, NULL, bdrv_oflags, drv, &local_err);
 +    if (ret < 0) {
 +        error_set(errp, ERROR_CLASS_GENERIC_ERROR, "failed to open '%s'", statefile);
 +        goto restart;
@@ -650,7 +654,6 @@ Index: new/savevm-async.c
 +
 +    error_setg(&snap_state.blocker, "block device is in use by savevm");
 +    bdrv_op_block_all(snap_state.bs, snap_state.blocker);
-+    bdrv_ref(snap_state.bs);
 +
 +    Coroutine *co = qemu_coroutine_create(process_savevm_co);
 +    qemu_coroutine_enter(co, NULL);
@@ -823,7 +826,6 @@ Index: new/savevm-async.c
 +    ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_CACHE_WB, drv, &local_err);
 +    error_setg(&blocker, "block device is in use by load state");
 +    bdrv_op_block_all(bs, blocker);
-+    bdrv_ref(bs);
 +
 +    if (ret < 0) {
 +        error_report("Could not open VM state file");