add the zeroinit block driver filter
[pve-qemu-kvm.git] / debian / patches / old / backup-run-flush-inside-coroutine.patch
blob913eb082694712724c61087328f5c02b6dbfc7d7
1 run vma_writer_close_stream inside coroutine
3 Newer qemu (> 2.2.0-rc2) runs pvebackup_complete_cb from main loop,
5 But vma_writer_close_stream triggers an async write (flush), which uses qemu_coroutine_yield(). This only works if called from a coroutine.
8 Index: new/blockdev.c
9 ===================================================================
10 --- new.orig/blockdev.c 2014-11-20 12:17:17.000000000 +0100
11 +++ new/blockdev.c 2014-11-20 12:17:23.000000000 +0100
12 @@ -2059,6 +2059,13 @@
16 +static void coroutine_fn backup_close_vma_stream(void *opaque)
18 + PVEBackupDevInfo *di = opaque;
20 + vma_writer_close_stream(backup_state.vmaw, di->dev_id);
23 static void pvebackup_complete_cb(void *opaque, int ret)
25 PVEBackupDevInfo *di = opaque;
26 @@ -2076,7 +2083,8 @@
27 di->target = NULL;
29 if (backup_state.vmaw) {
30 - vma_writer_close_stream(backup_state.vmaw, di->dev_id);
31 + Coroutine *co = qemu_coroutine_create(backup_close_vma_stream);
32 + qemu_coroutine_enter(co, di);
35 block_job_cb(bs, ret);
36 Index: new/vma-writer.c
37 ===================================================================
38 --- new.orig/vma-writer.c 2014-11-20 12:17:17.000000000 +0100
39 +++ new/vma-writer.c 2014-11-20 12:17:23.000000000 +0100
40 @@ -706,6 +706,10 @@
42 int i;
44 + while (vmaw->co_writer) {
45 + aio_poll(qemu_get_aio_context(), true);
46 + }
48 assert(vmaw->co_writer == NULL);
50 if (vmaw->cmd) {