+++ /dev/null
-From c0b66c21bb4d4cc1f02d4259d62dd8d6d413fd7f Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Wed, 9 Dec 2015 15:40:42 +0100
-Subject: [PATCH 20/48] backup: vma: run flush inside coroutine
-
----
- blockdev.c | 10 +++++++++-
- vma-writer.c | 4 ++++
- 2 files changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/blockdev.c b/blockdev.c
-index ef159b0..a9a900e 100644
---- a/blockdev.c
-+++ b/blockdev.c
-@@ -3087,6 +3087,13 @@ static void pvebackup_cleanup(void)
- }
- }
-
-+static void coroutine_fn backup_close_vma_stream(void *opaque)
-+{
-+ PVEBackupDevInfo *di = opaque;
-+
-+ vma_writer_close_stream(backup_state.vmaw, di->dev_id);
-+}
-+
- static void pvebackup_complete_cb(void *opaque, int ret)
- {
- PVEBackupDevInfo *di = opaque;
-@@ -3104,7 +3111,8 @@ static void pvebackup_complete_cb(void *opaque, int ret)
- di->target = NULL;
-
- if (backup_state.vmaw) {
-- vma_writer_close_stream(backup_state.vmaw, di->dev_id);
-+ Coroutine *co = qemu_coroutine_create(backup_close_vma_stream, di);
-+ qemu_coroutine_enter(co);
- }
-
- block_job_cb(bs, ret);
-diff --git a/vma-writer.c b/vma-writer.c
-index ec8da53..216577a 100644
---- a/vma-writer.c
-+++ b/vma-writer.c
-@@ -700,6 +700,10 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
-
- int i;
-
-+ while (vmaw->co_writer) {
-+ aio_poll(qemu_get_aio_context(), true);
-+ }
-+
- assert(vmaw->co_writer == NULL);
-
- if (vmaw->cmd) {
---
-2.1.4
-