]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/pve/0020-backup-vma-run-flush-inside-coroutine.patch
bump version to 2.9.0-1~rc2+5
[pve-qemu-kvm.git] / debian / patches / pve / 0020-backup-vma-run-flush-inside-coroutine.patch
CommitLineData
87ba737b 1From c0b66c21bb4d4cc1f02d4259d62dd8d6d413fd7f Mon Sep 17 00:00:00 2001
ca0fe5f5
WB
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Wed, 9 Dec 2015 15:40:42 +0100
adeb0c7a 4Subject: [PATCH 20/48] backup: vma: run flush inside coroutine
ca0fe5f5
WB
5
6---
7 blockdev.c | 10 +++++++++-
8 vma-writer.c | 4 ++++
9 2 files changed, 13 insertions(+), 1 deletion(-)
10
11diff --git a/blockdev.c b/blockdev.c
87ba737b 12index ef159b0..a9a900e 100644
ca0fe5f5
WB
13--- a/blockdev.c
14+++ b/blockdev.c
1a91ab45 15@@ -3087,6 +3087,13 @@ static void pvebackup_cleanup(void)
ca0fe5f5
WB
16 }
17 }
18
19+static void coroutine_fn backup_close_vma_stream(void *opaque)
20+{
21+ PVEBackupDevInfo *di = opaque;
22+
23+ vma_writer_close_stream(backup_state.vmaw, di->dev_id);
24+}
25+
26 static void pvebackup_complete_cb(void *opaque, int ret)
27 {
28 PVEBackupDevInfo *di = opaque;
1a91ab45 29@@ -3104,7 +3111,8 @@ static void pvebackup_complete_cb(void *opaque, int ret)
ca0fe5f5
WB
30 di->target = NULL;
31
32 if (backup_state.vmaw) {
33- vma_writer_close_stream(backup_state.vmaw, di->dev_id);
68a30562
WB
34+ Coroutine *co = qemu_coroutine_create(backup_close_vma_stream, di);
35+ qemu_coroutine_enter(co);
ca0fe5f5
WB
36 }
37
38 block_job_cb(bs, ret);
39diff --git a/vma-writer.c b/vma-writer.c
1a91ab45 40index ec8da53..216577a 100644
ca0fe5f5
WB
41--- a/vma-writer.c
42+++ b/vma-writer.c
68a30562 43@@ -700,6 +700,10 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
ca0fe5f5
WB
44
45 int i;
46
47+ while (vmaw->co_writer) {
48+ aio_poll(qemu_get_aio_context(), true);
49+ }
50+
51 assert(vmaw->co_writer == NULL);
52
53 if (vmaw->cmd) {
54--
552.1.4
56