]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0039-fix-backup-job-completion.patch
Update and rebase to QEMU 4.1
[pve-qemu.git] / debian / patches / pve / 0039-fix-backup-job-completion.patch
CommitLineData
22ff2487
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Dietmar Maurer <dietmar@proxmox.com>
3Date: Wed, 30 Oct 2019 12:15:45 +0100
4Subject: [PATCH] fix backup job completion
5
6With recent changes, pvebackup_co_run_next_job cancels the job async,
7so we need to run pvebackup_co_cleanup in the completion handler
8instead. We call pvebackup_co_run_next as long as there are
9jobs in the list.
10---
11 blockdev.c | 9 ++++-----
12 1 file changed, 4 insertions(+), 5 deletions(-)
13
14diff --git a/blockdev.c b/blockdev.c
be901f66 15index 568f71fdb4..66f2711185 100644
22ff2487
TL
16--- a/blockdev.c
17+++ b/blockdev.c
be901f66 18@@ -3359,12 +3359,14 @@ static void coroutine_fn pvebackup_co_complete_cb(void *opaque)
22ff2487
TL
19 backup_state.di_list = g_list_remove(backup_state.di_list, di);
20 g_free(di);
21
22- bool cancel = backup_state.cancel;
23+ int pending_jobs = g_list_length(backup_state.di_list);
24
25 qemu_co_mutex_unlock(&backup_state.backup_mutex);
26
27- if (!cancel) {
28+ if (pending_jobs > 0) {
29 pvebackup_co_run_next_job();
30+ } else {
31+ pvebackup_co_cleanup();
32 }
33 }
34
be901f66 35@@ -3510,9 +3512,6 @@ static void coroutine_fn pvebackup_co_run_next_job(void)
22ff2487
TL
36 }
37 }
38 qemu_co_mutex_unlock(&backup_state.backup_mutex);
39-
40- // no more jobs, run the cleanup
41- pvebackup_co_cleanup();
42 }
43
44 typedef struct QmpBackupTask {