Skip to contentSkip to conversation

block/replication.c: Avoid cancelling the job twice

PATCH Applied Lukas Straub 2 participants 2 messages May 11, 2020 – May 13, 2020 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/replication.c: Avoid cancelling the job twice

If qemu in colo secondary mode is stopped, it crashes because s->backup_job is canceled twice: First with job_cancel_sync_all() in qemu_cleanup() and then in replication_stop().

Fix this by assigning NULL to s->backup_job when the job completes so replication_stop() and replication_do_checkpoint() won't touch the job.

---
 block/replication.c | 2 ++
 1 file changed, 2 insertions(+)
block/replication.c +2 -0
index da013c2041..33f2f62a44 100644
@@ -398,6 +398,8 @@ static void backup_job_cleanup(BlockDriverState *bs)
     BDRVReplicationState *s = bs->opaque;
     BlockDriverState *top_bs;
 
+    s->backup_job = NULL;
+
     top_bs = bdrv_lookup_bs(s->top_id, s->top_id, NULL);
     if (!top_bs) {
         return;
Signature · 1 line
2.20.1
Applied
#1 lore raw

Am 11.05.2020 um 09:08 hat Lukas Straub geschrieben:

Quoted 9 lines

If qemu in colo secondary mode is stopped, it crashes because s->backup_job is canceled twice: First with job_cancel_sync_all() in qemu_cleanup() and then in replication_stop().

Fix this by assigning NULL to s->backup_job when the job completes so replication_stop() and replication_do_checkpoint() won't touch the job.

Thanks, applied to the block branch.

Kevin