]>
Commit | Line | Data |
---|---|---|
22ff2487 TL |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Dietmar Maurer <dietmar@proxmox.com> | |
3 | Date: Wed, 30 Oct 2019 12:15:45 +0100 | |
4 | Subject: [PATCH] fix backup job completion | |
5 | ||
6 | With recent changes, pvebackup_co_run_next_job cancels the job async, | |
7 | so we need to run pvebackup_co_cleanup in the completion handler | |
8 | instead. We call pvebackup_co_run_next as long as there are | |
9 | jobs in the list. | |
10 | --- | |
11 | blockdev.c | 9 ++++----- | |
12 | 1 file changed, 4 insertions(+), 5 deletions(-) | |
13 | ||
14 | diff --git a/blockdev.c b/blockdev.c | |
be901f66 | 15 | index 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 { |