From: Lukas Straub Date: Mon, 11 May 2020 07:08:01 +0000 (+0200) Subject: block/replication.c: Avoid cancelling the job twice X-Git-Tag: qemu-xen-4.15.0~186^2~47 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e140f4b7b8c0fdda866ba3d8b4aa184b6ba6d6b8;p=qemu-xen.git 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. Signed-off-by: Lukas Straub Message-Id: <20200511090801.7ed5d8f3@luklap> Signed-off-by: Kevin Wolf --- diff --git a/block/replication.c b/block/replication.c index 971f0fe266..c03980a192 100644 --- a/block/replication.c +++ b/block/replication.c @@ -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;