* [PATCH] block/replication.c: Avoid cancelling the job twice
@ 2020-05-11 7:08 Lukas Straub
2020-05-13 10:11 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Straub @ 2020-05-11 7:08 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Wen Congyang, Xie Changlong, qemu-block, Max Reitz
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
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>
---
block/replication.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/replication.c b/block/replication.c
index da013c2041..33f2f62a44 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;
--
2.20.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block/replication.c: Avoid cancelling the job twice
2020-05-11 7:08 [PATCH] block/replication.c: Avoid cancelling the job twice Lukas Straub
@ 2020-05-13 10:11 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2020-05-13 10:11 UTC (permalink / raw)
To: Lukas Straub
Cc: Wen Congyang, Xie Changlong, qemu-devel, qemu-block, Max Reitz
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
Am 11.05.2020 um 09:08 hat Lukas Straub geschrieben:
> 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>
Thanks, applied to the block branch.
Kevin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-13 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 7:08 [PATCH] block/replication.c: Avoid cancelling the job twice Lukas Straub
2020-05-13 10:11 ` Kevin Wolf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.