]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
qmp_delete_drive_snapshot : add-aiocontext
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 7 Nov 2016 11:08:05 +0000 (12:08 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 8 Nov 2016 07:42:19 +0000 (08:42 +0100)
fix delete snapshot with qcow2 and iothread enabled

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
debian/patches/pve/0045-qmp_delete_drive_snapshot-add-aiocontext.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/pve/0045-qmp_delete_drive_snapshot-add-aiocontext.patch b/debian/patches/pve/0045-qmp_delete_drive_snapshot-add-aiocontext.patch
new file mode 100644 (file)
index 0000000..29c6d32
--- /dev/null
@@ -0,0 +1,59 @@
+From b4f04c214d85b8570af61012a9f81ce037ccd81f Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Mon, 7 Nov 2016 11:47:50 +0100
+Subject: [PATCH] qmp_delete_drive_snapshot : add aiocontext
+
+this fix snapshot delete of qcow2 with iothread enabled
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ savevm-async.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/savevm-async.c b/savevm-async.c
+index 2faaf7a..05b5b19 100644
+--- a/savevm-async.c
++++ b/savevm-async.c
+@@ -427,6 +427,7 @@ void qmp_delete_drive_snapshot(const char *device, const char *name,
+     BlockDriverState *bs;
+     QEMUSnapshotInfo sn1, *sn = &sn1;
+     Error *local_err = NULL;
++    AioContext *aio_context;
+     int ret;
+@@ -443,22 +444,28 @@ void qmp_delete_drive_snapshot(const char *device, const char *name,
+         return;
+     }
++    aio_context = bdrv_get_aio_context(bs);
++    aio_context_acquire(aio_context);
++
+     if (!bdrv_can_snapshot(bs)) {
+         error_setg(errp, QERR_UNSUPPORTED);
+-        return;
++        goto out;
+     }
+     if (bdrv_snapshot_find(bs, sn, name) < 0) {
+         /* return success if snapshot does not exists */
+-        return;
++        goto out;
+     }
+     ret = bdrv_snapshot_delete(bs, NULL, name, &local_err);
+     if (ret < 0) {
+         error_set(errp, ERROR_CLASS_GENERIC_ERROR,
+                   "Error while deleting snapshot on '%s'\n", device);
+-        return;
++        goto out;
+     }
++
++out:
++    aio_context_release(aio_context);
+ }
+ static ssize_t loadstate_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
+-- 
+2.1.4
+
index 6c1c308a2cf79de06646cccb43c078357c71c9d4..7bd93f4b28fd3d337702db463c7d6744bbcb33ca 100644 (file)
@@ -42,6 +42,7 @@ pve/0041-savevm-async-updates.patch
 pve/0042-qmp_snapshot_drive-add-aiocontext.patch
 pve/0043-vma-sizes-passed-to-blk_co_preadv-should-be-bytes-no.patch
 pve/0044-glusterfs-daemonize.patch
+pve/0045-qmp_delete_drive_snapshot-add-aiocontext.patch
 #see https://bugs.launchpad.net/qemu/+bug/1488363?comments=all
 extra/x86-lapic-Load-LAPIC-state-at-post_load.patch
 extra/0001-Revert-target-i386-disable-LINT0-after-reset.patch