1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Alexandre Derumier <aderumier@odiso.com>
3 Date: Mon, 7 Nov 2016 11:47:50 +0100
4 Subject: [PATCH] PVE: block: snapshot: qmp_delete_drive_snapshot : add
7 this fix snapshot delete of qcow2 with iothread enabled
9 Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
11 savevm-async.c | 13 ++++++++++---
12 1 file changed, 10 insertions(+), 3 deletions(-)
14 diff --git a/savevm-async.c b/savevm-async.c
15 index 87d5460a26..aa578c4a49 100644
18 @@ -461,6 +461,7 @@ void qmp_delete_drive_snapshot(const char *device, const char *name,
20 QEMUSnapshotInfo sn1, *sn = &sn1;
21 Error *local_err = NULL;
22 + AioContext *aio_context;
26 @@ -477,22 +478,28 @@ void qmp_delete_drive_snapshot(const char *device, const char *name,
30 + aio_context = bdrv_get_aio_context(bs);
31 + aio_context_acquire(aio_context);
33 if (!bdrv_can_snapshot(bs)) {
34 error_setg(errp, QERR_UNSUPPORTED);
39 if (bdrv_snapshot_find(bs, sn, name) < 0) {
40 /* return success if snapshot does not exists */
45 ret = bdrv_snapshot_delete(bs, NULL, name, &local_err);
47 error_set(errp, ERROR_CLASS_GENERIC_ERROR,
48 "Error while deleting snapshot on '%s'\n", device);
54 + aio_context_release(aio_context);
57 static ssize_t loadstate_get_buffer(void *opaque, uint8_t *buf, int64_t pos,