]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/replication.c: Avoid cancelling the job twice
authorLukas Straub <lukasstraub2@web.de>
Mon, 11 May 2020 07:08:01 +0000 (09:08 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 18 May 2020 17:05:25 +0000 (19:05 +0200)
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.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Message-Id: <20200511090801.7ed5d8f3@luklap>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/replication.c

index 971f0fe26611dd97db9941451b755a5e970cad61..c03980a1921dc45c1ce488f78629eb4b0d1e44f3 100644 (file)
@@ -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;