1 From fe57d97e87fd49b03ce11d381f88fed546ea674d Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Wed, 9 Dec 2015 15:40:42 +0100
4 Subject: [PATCH 21/41] backup: vma: run flush inside coroutine
7 blockdev.c | 10 +++++++++-
9 2 files changed, 13 insertions(+), 1 deletion(-)
11 diff --git a/blockdev.c b/blockdev.c
12 index c36888d..8df70cb 100644
15 @@ -2980,6 +2980,13 @@ static void pvebackup_cleanup(void)
19 +static void coroutine_fn backup_close_vma_stream(void *opaque)
21 + PVEBackupDevInfo *di = opaque;
23 + vma_writer_close_stream(backup_state.vmaw, di->dev_id);
26 static void pvebackup_complete_cb(void *opaque, int ret)
28 PVEBackupDevInfo *di = opaque;
29 @@ -2997,7 +3004,8 @@ static void pvebackup_complete_cb(void *opaque, int ret)
32 if (backup_state.vmaw) {
33 - vma_writer_close_stream(backup_state.vmaw, di->dev_id);
34 + Coroutine *co = qemu_coroutine_create(backup_close_vma_stream);
35 + qemu_coroutine_enter(co, di);
38 block_job_cb(bs, ret);
39 diff --git a/vma-writer.c b/vma-writer.c
40 index 2558fe1..3c77e98 100644
43 @@ -706,6 +706,10 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
47 + while (vmaw->co_writer) {
48 + aio_poll(qemu_get_aio_context(), true);
51 assert(vmaw->co_writer == NULL);