57 lines
1.5 KiB
Diff
57 lines
1.5 KiB
Diff
From 25bc684248f21b1b947812b06777707537100a97 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/49] 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 ef159b0753..a9a900e6c8 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 ec8da5378d..216577a4f7 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.11.0
|
|
|