[{"id":3679555,"web_url":"http://patchwork.ozlabs.org/comment/3679555/","msgid":"<aeaBKzauFijGRhWr@x1.local>","list_archive_url":null,"date":"2026-04-20T19:40:27","subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Fri, Apr 17, 2026 at 10:47:42PM +0400, marcandre.lureau@redhat.com wrote:\n> From: Marc-André Lureau <marcandre.lureau@redhat.com>\n> \n> When a migration is cancelled during the early SETUP phase (before\n> migration_connect_outgoing() has set s->to_dst_file), migration_cancel()\n> takes a fast path that transitions the state from CANCELLING to\n> Cancelled without calling migration_cleanup(). This leaves the migration\n> yank instance registered.\n> \n> A subsequent qmp_migrate() call passes the migration_is_running() guard\n> (since CANCELLED is a terminal state) and then calls\n> yank_register_instance(MIGRATION_YANK_INSTANCE, &error_abort), which\n> finds the stale entry and aborts with \"duplicate yank instance\".\n> \n>   #6  0x000056028b5e17fc in error_setg_internal\n>       (errp=errp@entry=0x56028cc8cb18 <error_abort>, src=src@entry=0x56028ba87fa5 \"../util/yank.c\", line=line@entry=87, func=func@entry=0x56028bb77140 <__func__.5> \"yank_register_instance\", fmt=fmt@entry=0x56028ba87f8d \"duplicate yank instance\") at ../util/error.c:100\n>   #7  0x000056028b601b2a in yank_register_instance (instance=instance@entry=0x7ffea0cf36b0, errp=0x56028cc8cb18 <error_abort>) at ../util/yank.c:87\n>   #8  0x000056028b25221e in migrate_prepare (s=0x5602b0a7db90, resume=<optimized out>, errp=0x7ffea0cf3718) at ../migration/migration.c:2001\n>   #9  qmp_migrate (uri=<optimized out>, has_channels=<optimized out>, channels=<optimized out>, has_resume=<optimized out>, resume=<optimized out>, errp=errp@entry=0x7ffea0cf3718) at ../migration/migration.c:2039\n>   #10 0x000056028b5891be in qmp_marshal_migrate (args=<optimized out>, ret=<optimized out>, errp=0x7f63392e0ee0) at qapi/qapi-commands-migration.c:459\n> \n> Add missing yank_unregister_instance. Alternatively, it seems\n> migration_cleanup() should be safe in this context too.\n> \n> Fixes: 624e6e654e11 (\"migration: cpr-transfer mode\")\n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  migration/migration.c | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/migration/migration.c b/migration/migration.c\n> index 5c9aaa6e58f..bbdd91ee7ee 100644\n> --- a/migration/migration.c\n> +++ b/migration/migration.c\n> @@ -1477,6 +1477,7 @@ void migration_cancel(void)\n>                            MIGRATION_STATUS_CANCELLED);\n>          cpr_state_close();\n>          cpr_transfer_source_destroy(s);\n> +        yank_unregister_instance(MIGRATION_YANK_INSTANCE);\n>      }\n>  }\n\nThanks for the report.\n\nI had a feeling that this is not enough.. and I had a feeling that this\nspecial casing was something fast merged for cpr-transfer work to be able\nto cancel the HUP source when waiting, however did it wrong.  IOW, at least\nthis chunk:\n\n    if (setup && !s->to_dst_file) {\n        migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING,\n                          MIGRATION_STATUS_CANCELLED);\n        cpr_state_close();\n        cpr_transfer_source_destroy(s);\n    }\n\nShould only apply to cpr-transfer, not normal migrations..\n\nE.g. consider one qmp_migrate() on top of tcp socket:\n\n- qmp_migrate\n  - migration_connect_outgoing\n    - socket_connect_outgoing\n      - ... waiting for worker to invoke socket_outgoing_migration()\n- ... some time later\n- qmp_migrate_cancel\n  - above check hits, update CANCELLING->CANCELLED, unregister yank etc.\n- ... some time later\n- socket_outgoing_migration() invoked with an error\n  - migration_connect_error_propagate() should see CANCELLED state, which\n    is illegal.\n\nSo IMHO for non-cpr cases we should always get ourselves covered with\nmigration_connect_error_propagate(), except CPR where it may have the HUP\nsource registered via migration_connect_error_propagate().\n\nIIUC, maybe we could change this check to be an explicit one, checking\nwhether cpr_transfer_add_hup_watch() has the source attached but not yet\nexecuted (if executed, migration_connect_outgoing_cb() will also properly\ninvoke migration_connect_error_propagate()).\n\nWe could check against both \"mode==CPR_TRANSFER && s->hup_source\", but then\nwe need early release of hup_resource too (currently it is deferred until\nmigration_cleanup(), which is slightly hackish; after all the source\nreturns always with G_SOURCE_REMOVE for migration_connect_outgoing_cb, so\nit was removed long time ago, rather than until the end of migration).\n\nThanks,","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=cU5RG/Li;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=TsU+UtOV;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzwnm4Kt5z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 05:40:44 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEuU3-0003KA-O7; Mon, 20 Apr 2026 15:40:39 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEuTz-0003JC-JD\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 15:40:35 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEuTx-00050m-U1\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 15:40:35 -0400","from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-572-zWJFuOlSM66lIdOQiHGmOg-1; Mon, 20 Apr 2026 15:40:30 -0400","by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8a275472d89so53090036d6.1\n for <qemu-devel@nongnu.org>; Mon, 20 Apr 2026 12:40:30 -0700 (PDT)","from x1.local ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b02aea639fsm80079536d6.45.2026.04.20.12.40.28\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 20 Apr 2026 12:40:28 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776714032;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=d0nInPWWkYC5jnsWmSMyjbxo7XAmhxf0llMm4THi7iY=;\n b=cU5RG/LiN1fZCIa3QuiDWDczb81tj9xAwGFHrmM3jBP8NR6GieHN5vx8OUQKuL5QO3rK1O\n rAoINGY9vMJr3IUopmSx9Ffgv7bYYTWYdbM9t3wSSOIu1rHcwVe7grl2CB68JtXgUDQkz+\n VzLqjfmnc1z4D20tdPfHdyzmZERgTP0=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1776714030; x=1777318830; darn=nongnu.org;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:from:to\n :cc:subject:date:message-id:reply-to;\n bh=d0nInPWWkYC5jnsWmSMyjbxo7XAmhxf0llMm4THi7iY=;\n b=TsU+UtOVK5RZd9dIBT+YFqAVYMzNGl1UMVkpvow1/o9v3zMBkt7xbYj8P6/VUWNqsY\n 7aZVyh42rhdNlsUj93CfrIIY4hno8EH1QkM5liqjG7EpwsRhfX2/qEgTI4vDf6+wYPGJ\n dcsHO3WDts8vrQs3NtFhAdYEyPpdIop/Y6Guo5FSJlUwsvG+dJIAA1wRegJnWjN2eDfV\n 0c0sBt5tkmWolt/SfYcCIpnhPL7il2VDM00nRrbJyPeomwGbTO3mF1I9A2smfmb9hnCh\n TuSWr+5RTeXz8ojVtAEUMVwKnpXruy+jZ+y2rUF3OmUBPkCXwHAa4vkmebofApZkMCsF\n sw2g=="],"X-MC-Unique":"zWJFuOlSM66lIdOQiHGmOg-1","X-Mimecast-MFC-AGG-ID":"zWJFuOlSM66lIdOQiHGmOg_1776714030","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776714030; x=1777318830;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=d0nInPWWkYC5jnsWmSMyjbxo7XAmhxf0llMm4THi7iY=;\n b=AS2XcX45rCRRbeWlV8bun8ROtGbdNibRcemubNGVHLpN1nRHAUGtN9uaRMh8CdXizZ\n 9otq5ss5RM4pDIMkrIimLqy6aO2JFGJ9BoH2RSAO48Aj6k0RVDMLUUZAemdwEGgYPOcE\n jO1Rbc/kOogXBpduAJu4DSd6GKcNDmMxyJNhlf07r0Z4RgLoxPkPyUIqYxtaFZ/0L1SG\n qyHPYIkAYE98H5iB1VT0AjLkJuPa1MEuNPdx5WH5W1eStFkQM66wL7bdvXpcaono+10K\n 6M9pfZBkLX3SHfrtbKfUq4CcinAzcnslZqdl8dtx3/0VEZc5gu2SbIyI/RPxbVsb267S\n Zpgw==","X-Gm-Message-State":"AOJu0YyAfILbN5JXoDIdclF1zfVVLY1wfXa663Y+lrjxJ8Y+Bps2rCrq\n vdSYRs+mnzDKk0y/j+4fFVZyZd6wmN8H7Xbklt3HgtxcVv7bv1HyMqef/6ccg1FSxh3IlFSUmVm\n lpIXmVqfDkZx0iDYnzdxh9+1h5L0nsUh3F4f1upYqaqORBId+HmHFUUgf","X-Gm-Gg":"AeBDievtYZWpvmojdNqMKDQf8Jnm1TUU4nB2jL09bpkOCk4JbCgrale110cRPEI3AN+\n Jl2s3jpVaYnQFnSqH7cCFbZiMcG/v7Hcvx1bwpht+zODLzsBY3ajJQQ6uw8Xlq1EsVsbgrCYzKF\n S+qHLFtpBYKAQe9Zg1teqFmMI5qGRX9XdousoxHV100ldQHdfqbE1eBJjTJHvlBd2YoF/RliUqK\n LO/8Q4xYWVL1Ns1X1GQ5ykx+zLWJY8NBo9U1/sJOC1IpJgvljarrcat99PCdk97zFqTfoDbM70u\n xCHltXvUfl49tEsjgNV7Pk5O19gxRwDFmxuUe8XlnEChOIEc90q40LtD9hadTVBG8Q5j0uORTIq\n N0jT2jTvMvEJzqJ9Mt4I9Cxg4GeP9AiIS1ImEo4dtr1Ri3Nl0IS76teJXrQ==","X-Received":["by 2002:a05:6214:4a84:b0:8ac:b3ba:eb0f with SMTP id\n 6a1803df08f44-8b028081addmr233170886d6.21.1776714029902;\n Mon, 20 Apr 2026 12:40:29 -0700 (PDT)","by 2002:a05:6214:4a84:b0:8ac:b3ba:eb0f with SMTP id\n 6a1803df08f44-8b028081addmr233170096d6.21.1776714029232;\n Mon, 20 Apr 2026 12:40:29 -0700 (PDT)"],"Date":"Mon, 20 Apr 2026 15:40:27 -0400","From":"Peter Xu <peterx@redhat.com>","To":"marcandre.lureau@redhat.com","Cc":"qemu-devel@nongnu.org, steven.sistare@oracle.com,\n Fabiano Rosas <farosas@suse.de>","Subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","Message-ID":"<aeaBKzauFijGRhWr@x1.local>","References":"<20260417184742.293061-1-marcandre.lureau@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260417184742.293061-1-marcandre.lureau@redhat.com>","Received-SPF":"pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3679560,"web_url":"http://patchwork.ozlabs.org/comment/3679560/","msgid":"<CAJ+F1CKboKMKA0MbGhURhCSW5HkOM0+jQ4Sj4nWEXbLafpS1fQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-20T19:50:24","subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","submitter":{"id":66774,"url":"http://patchwork.ozlabs.org/api/people/66774/","name":"Marc-André Lureau","email":"marcandre.lureau@redhat.com"},"content":"Hi\n\nOn Mon, Apr 20, 2026 at 11:40 PM Peter Xu <peterx@redhat.com> wrote:\n>\n> On Fri, Apr 17, 2026 at 10:47:42PM +0400, marcandre.lureau@redhat.com wrote:\n> > From: Marc-André Lureau <marcandre.lureau@redhat.com>\n> >\n> > When a migration is cancelled during the early SETUP phase (before\n> > migration_connect_outgoing() has set s->to_dst_file), migration_cancel()\n> > takes a fast path that transitions the state from CANCELLING to\n> > Cancelled without calling migration_cleanup(). This leaves the migration\n> > yank instance registered.\n> >\n> > A subsequent qmp_migrate() call passes the migration_is_running() guard\n> > (since CANCELLED is a terminal state) and then calls\n> > yank_register_instance(MIGRATION_YANK_INSTANCE, &error_abort), which\n> > finds the stale entry and aborts with \"duplicate yank instance\".\n> >\n> >   #6  0x000056028b5e17fc in error_setg_internal\n> >       (errp=errp@entry=0x56028cc8cb18 <error_abort>, src=src@entry=0x56028ba87fa5 \"../util/yank.c\", line=line@entry=87, func=func@entry=0x56028bb77140 <__func__.5> \"yank_register_instance\", fmt=fmt@entry=0x56028ba87f8d \"duplicate yank instance\") at ../util/error.c:100\n> >   #7  0x000056028b601b2a in yank_register_instance (instance=instance@entry=0x7ffea0cf36b0, errp=0x56028cc8cb18 <error_abort>) at ../util/yank.c:87\n> >   #8  0x000056028b25221e in migrate_prepare (s=0x5602b0a7db90, resume=<optimized out>, errp=0x7ffea0cf3718) at ../migration/migration.c:2001\n> >   #9  qmp_migrate (uri=<optimized out>, has_channels=<optimized out>, channels=<optimized out>, has_resume=<optimized out>, resume=<optimized out>, errp=errp@entry=0x7ffea0cf3718) at ../migration/migration.c:2039\n> >   #10 0x000056028b5891be in qmp_marshal_migrate (args=<optimized out>, ret=<optimized out>, errp=0x7f63392e0ee0) at qapi/qapi-commands-migration.c:459\n> >\n> > Add missing yank_unregister_instance. Alternatively, it seems\n> > migration_cleanup() should be safe in this context too.\n> >\n> > Fixes: 624e6e654e11 (\"migration: cpr-transfer mode\")\n> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> > ---\n> >  migration/migration.c | 1 +\n> >  1 file changed, 1 insertion(+)\n> >\n> > diff --git a/migration/migration.c b/migration/migration.c\n> > index 5c9aaa6e58f..bbdd91ee7ee 100644\n> > --- a/migration/migration.c\n> > +++ b/migration/migration.c\n> > @@ -1477,6 +1477,7 @@ void migration_cancel(void)\n> >                            MIGRATION_STATUS_CANCELLED);\n> >          cpr_state_close();\n> >          cpr_transfer_source_destroy(s);\n> > +        yank_unregister_instance(MIGRATION_YANK_INSTANCE);\n> >      }\n> >  }\n>\n> Thanks for the report.\n>\n> I had a feeling that this is not enough.. and I had a feeling that this\n> special casing was something fast merged for cpr-transfer work to be able\n> to cancel the HUP source when waiting, however did it wrong.  IOW, at least\n> this chunk:\n>\n>     if (setup && !s->to_dst_file) {\n>         migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING,\n>                           MIGRATION_STATUS_CANCELLED);\n>         cpr_state_close();\n>         cpr_transfer_source_destroy(s);\n>     }\n>\n> Should only apply to cpr-transfer, not normal migrations..\n>\n> E.g. consider one qmp_migrate() on top of tcp socket:\n>\n> - qmp_migrate\n>   - migration_connect_outgoing\n>     - socket_connect_outgoing\n>       - ... waiting for worker to invoke socket_outgoing_migration()\n> - ... some time later\n> - qmp_migrate_cancel\n>   - above check hits, update CANCELLING->CANCELLED, unregister yank etc.\n> - ... some time later\n> - socket_outgoing_migration() invoked with an error\n>   - migration_connect_error_propagate() should see CANCELLED state, which\n>     is illegal.\n>\n> So IMHO for non-cpr cases we should always get ourselves covered with\n> migration_connect_error_propagate(), except CPR where it may have the HUP\n> source registered via migration_connect_error_propagate().\n>\n> IIUC, maybe we could change this check to be an explicit one, checking\n> whether cpr_transfer_add_hup_watch() has the source attached but not yet\n> executed (if executed, migration_connect_outgoing_cb() will also properly\n> invoke migration_connect_error_propagate()).\n>\n> We could check against both \"mode==CPR_TRANSFER && s->hup_source\", but then\n> we need early release of hup_resource too (currently it is deferred until\n> migration_cleanup(), which is slightly hackish; after all the source\n> returns always with G_SOURCE_REMOVE for migration_connect_outgoing_cb, so\n> it was removed long time ago, rather than until the end of migration).\n\nThis is a bit over my head, I am not familiar with CPR. If you can\ntake it from there, I am fine. I just wanted to fix the crash :)","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=Y8LVrkRe;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzx1p5N34z1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 05:51:10 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEudo-000597-5x; Mon, 20 Apr 2026 15:50:44 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@gmail.com>)\n id 1wEudm-00058T-2i\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 15:50:42 -0400","from mail-dy1-x1330.google.com ([2607:f8b0:4864:20::1330])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@gmail.com>)\n id 1wEudk-0007Ch-0i\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 15:50:41 -0400","by mail-dy1-x1330.google.com with SMTP id\n 5a478bee46e88-2b4520f6b32so4351915eec.0\n for <qemu-devel@nongnu.org>; Mon, 20 Apr 2026 12:50:38 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; t=1776714637; cv=none;\n d=google.com; s=arc-20240605;\n b=Mez2SazArTjKJ3QQ7qIPsHWum5P/0vSqtvaeAP5UE1VuKOG7qwyZLFFyNv4FwXTAtM\n +C3/6x03Zr/6TRmbRNy6RHJucYQ1/wXKoBODrQaE0N1gru7bCsehbX4koT3ZDu37xoBh\n L9u1LWkbHkEKETXjhLhkh2ROPLxbwVyk0D8utQMLPa2OKtuBxIHzPm8q6Pj3EUDYX1/s\n YAptiaD+CQMxY8K2/0p48FnASNXfMkfo1bLCrt6+7DvUs0OcuYZVJ+7CFrUuJzSctPOr\n BG0CFRuRBTTMz918QkcVWetKD+VhwJ69+zEuFf5yFdRlZ8gjNymJ815eaem09+os+WU8\n Klgg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=kU+3bier+XxAIEfgQXzu6BYyfFhLqhrehILZE05xFw0=;\n fh=yHtdBvj3A+6LB7O7PY25VbVbN9BGzHkl0W0yQXMvNjM=;\n b=CqpMXtSj+Sn+D2aD1TdnJ4X6reRh3beeJLVf0WPFJ7wnjPqL4+KGDaO49TgCdG/DtO\n dXTqja008tRYZ2n0gcL4PqkElA3pkk5W0Bd6Bt6/YwhKhWcvX2qmIxeAGpH8RnMOGnlM\n ZhCQWgN+IdCMO6tQqcC/dL799zA3zUnU0brFC2DczTrf3Xmm9wlS8zSGn9EQ4Nv4hej5\n ZczQ2xbjHPHuy1yRUaNaf69UvlDty7GFxhwOpazd8nDztWLm3PUarxe8cTS2k02Y8wsl\n tLlwJEaJhfprpAV4+3HEhS6zp29eav4gs3Z2w9fRcSVumiDQxqXLX6JXpTKciRaDIuEe\n UsRg==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1776714637; x=1777319437; darn=nongnu.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=kU+3bier+XxAIEfgQXzu6BYyfFhLqhrehILZE05xFw0=;\n b=Y8LVrkRehnO/EL0B0oHzmBtfyTaTQ13naqNLmXWzAQ38IkAoOQgYJBjgGqEsnxlX+T\n iQmqMZjhWTwYUUyRX6WqiwayH/IuAyGWLkYRbYv9jP71goS+DmZY0MD5EgY4tOftHtpG\n zTyeOeMrKuZRjk6OFbqN/t/h+JzzTg0SVOESzxgnNtovrKbyZTxb05KcPlxr0fi3QJ1Z\n fuyDO80Xvx+P+mc4rkmlcOKGRR6kAsc33bf21SpNbqppGd92SDVgyVlxGDIhurQs91/7\n VADAG5l/lfbEiPRo2TilVHD+omxUdsUOdU2REM+SLMEKzjoBYclucAS4cCnaUYPDyJ/e\n sjKw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776714637; x=1777319437;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=kU+3bier+XxAIEfgQXzu6BYyfFhLqhrehILZE05xFw0=;\n b=nor8mwn3MErjePD6uAQK4UyIw72jzLRpgCvv2YlJvMVMUQwvDFxqWWU7emmmZTtIOp\n PJ6lbr4TSiYxL6VCPT48NZ+E55WeswfSZM2rTGehs0nbODDuxRE1T7ahm+4DVVekE/9z\n GCPHYIgAXwr6UVjsAdvagibw/G62iCrG6Z1o+gOg62prx1tHjEmWiYyFI7A3ww2OXfA4\n rBrFkjGKmrPIE0L5RJI1U+0f3Oe1j8RHMvBJkSe5Sfc5KTohjAUPC3rhHob3BrmC8qB6\n f1TPHeaN0QdBG7qv7AcpGOOmQ4Q3iKDRZazFKskS3jRlLJNOPcqX85s5ncmpnhcbJ0b1\n u9EQ==","X-Gm-Message-State":"AOJu0YxwHxUxaRYtFX3EQqOAAW/Y73UkiWWBsm6LfkVfjF+IHNFVNz8r\n XQIReDyRY5+xHVH6iM7CnQwSuigg12V6VhgfRzn+sadJGI2oxFvGcIe+PszJQ/mZWjk5oUMqCoH\n hkZsOKGm6EVP/fJbrojdQwcgI8f7VWOs=","X-Gm-Gg":"AeBDiesscO0dK8+RaHEbKzY+Rng4rpaY8nF/olKyI43ThZn0veH4LsuuIJAm5JWx/ZJ\n prBpT6irNCioW5QM5A2BuAEya3tB6coijVhoKGARQQdOSJeSYKY7nH0ZFegX9QwtOQK6ZdycPvW\n eh2zpZSa7Ry9bRqRFUyr0JKM8rpCo4DcrYmxG2wwtsluafbgnzeKWHyVzcgDcdLTx8ym8CR02hH\n XPVPUcvnZAd9wlqWUh2W2tpfJCRS9+BIzkxpz2AKsXyhOYBIaXEKWuGbaZhD5VDwxiteWb5SMll\n LphHKDBn0bNsRH6zoXEIwkeNsCyIzR/JOB+ZnFQcu1X9cTJI5fg6cYpjPSx+ew==","X-Received":"by 2002:a05:7300:6d23:b0:2de:aafb:fef3 with SMTP id\n 5a478bee46e88-2e464eaa418mr8514291eec.1.1776714637096; Mon, 20 Apr 2026\n 12:50:37 -0700 (PDT)","MIME-Version":"1.0","References":"<20260417184742.293061-1-marcandre.lureau@redhat.com>\n <aeaBKzauFijGRhWr@x1.local>","In-Reply-To":"<aeaBKzauFijGRhWr@x1.local>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>","Date":"Mon, 20 Apr 2026 23:50:24 +0400","X-Gm-Features":"AQROBzBclPENOFrYgUqaDth6m-749jx-rJFAkf4wW5UHhbn03Ncw_TbmYL5Eb_E","Message-ID":"\n <CAJ+F1CKboKMKA0MbGhURhCSW5HkOM0+jQ4Sj4nWEXbLafpS1fQ@mail.gmail.com>","Subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","To":"Peter Xu <peterx@redhat.com>","Cc":"qemu-devel@nongnu.org, steven.sistare@oracle.com,\n Fabiano Rosas <farosas@suse.de>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","Received-SPF":"pass client-ip=2607:f8b0:4864:20::1330;\n envelope-from=marcandre.lureau@gmail.com; helo=mail-dy1-x1330.google.com","X-Spam_score_int":"-16","X-Spam_score":"-1.7","X-Spam_bar":"-","X-Spam_report":"(-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,\n FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=no autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3679589,"web_url":"http://patchwork.ozlabs.org/comment/3679589/","msgid":"<aeaPsxYhYo1AXrlB@x1.local>","list_archive_url":null,"date":"2026-04-20T20:42:27","subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Mon, Apr 20, 2026 at 11:50:24PM +0400, Marc-André Lureau wrote:\n> This is a bit over my head, I am not familiar with CPR. If you can\n> take it from there, I am fine. I just wanted to fix the crash :)\n\nSure :) I'll have a closer look at this.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=eAO8bS7V;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=PCE7chZe;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzyB16JFGz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 06:43:20 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEvS3-00063m-Ox; Mon, 20 Apr 2026 16:42:39 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEvS1-00063Q-Hy\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 16:42:37 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEvS0-0004Oh-3I\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 16:42:37 -0400","from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-612-ARRjGT81OMCWtCskmXREFA-1; Mon, 20 Apr 2026 16:42:30 -0400","by mail-qk1-f197.google.com with SMTP id\n af79cd13be357-8eaaf673eb4so32372585a.2\n for <qemu-devel@nongnu.org>; Mon, 20 Apr 2026 13:42:29 -0700 (PDT)","from x1.local ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8e7d93c3083sm853669185a.35.2026.04.20.13.42.27\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 20 Apr 2026 13:42:28 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776717754;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=NklzYsQmRE/PNXFHL6O53ZZy6dAX1nvLQ9antW+VHGg=;\n b=eAO8bS7VxdY9HG8xva/uZEEWFQmkcl2hO3mIRlx4orsHQWU26WasddThfbUUOEL08Otq2B\n GIOm7zqYpELszvOkdC72HDUl+5izj4JQE8w/Bvue/BY4YHcJEh2BkhRxsWhM86YQaCR0Fk\n F8AhJ7O3aeMIfaAIxk5bXDWKgjrt7J8=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1776717749; x=1777322549; darn=nongnu.org;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:from:to\n :cc:subject:date:message-id:reply-to;\n bh=NklzYsQmRE/PNXFHL6O53ZZy6dAX1nvLQ9antW+VHGg=;\n b=PCE7chZei4VJSOsw9U0kUmGZAAHXzSdJGzHWpT6EtY6LfbUa3vGdBobsVUZO5d/oSr\n v8jjr/OKRWQwPvSzTZb/sr6UH/MVsRKOj36fgbsXsyn/4d2Mcs16jML5UVACMEIoWh7J\n jMl32I2QnfQI0GJogcsnHPiLwUl7TOLKtDRO5wfGV5EwxaqQRgJ0WmOXR2P6/1dOOVhG\n k0Z06PuDy3ldicqY6Ma7P6sq0JINirTyQvJ5jceM3/PLMFeN/wxuvE3JsWPWGnrIuAJl\n H5JPUaXezKRj+4t49UAr5T0TQoPE5Cha5gqUIr8fWZ2T8q488GpouRDfR3O+Eu0k6kSu\n c8RQ=="],"X-MC-Unique":"ARRjGT81OMCWtCskmXREFA-1","X-Mimecast-MFC-AGG-ID":"ARRjGT81OMCWtCskmXREFA_1776717749","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776717749; x=1777322549;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=NklzYsQmRE/PNXFHL6O53ZZy6dAX1nvLQ9antW+VHGg=;\n b=SxUsi1BeM9EDwM+wfJKl1iCnreEQl6fnetjDL2Ru+qzZr/Qlcy/yJXBvM/jR9G1aXs\n 7N9Q7awQOx1bvsa4cb0BHACmLTy2rZhlQu44+Rsk7BkGlQhvevTCyw4GV5+2oprRgkf0\n YrOheDaabGqIXWqPmuX4zfGJbHgPgX0o+HveYhrzCvIUSEIGl5AB1WXcS/4wfmcuyhK1\n RGJcfYFEZqr9ihiVqIHqnKXUasz/mhAtQZi6DpdxVIlDIVMKzhc/DkX9+k+EZck6sP3d\n tw5NbOIJQRMV7QaMV9Tr8/9woQ2g1QwgkXRrCnqUDMcQklsZ4E+mXrn5cQ/cuRgQ8Dwp\n 5wbg==","X-Gm-Message-State":"AOJu0Yx1TqL1eDfoiJRIuz+Gp2rGyZAM8mf4kS585ATGhDmJGruwUiVK\n 45NceZLAi7+fsEqXtnwdKV1T7GcLd/uguzvmPAAZrJB5mHSbPczy9cQE6cTkRN5wcY4TAS94Nee\n huf5BW5HxhBwQ6DTnsPPAWObqOFvy4zgYnYyKiZgYj5R/YULVsTG6MwYe","X-Gm-Gg":"AeBDiev9s/y3X4Ob743ebR5hEpgX4sQgU/QSM/2+UNqxg2bmTCD7BSmyw6iy8nQUeVk\n pgnyZ1AQNk4PWZCGbA0SQQEppGHRDgBffhL+nkPBNYGzuYwcJg9A0MM2+wbY/G/Grhyj6Wr7Pr0\n 30aC2CThr11VfiCuX7YOVZqGMHkAUuQIJHBH8c1NQL3TELw1hxc3D+DJFOohkZ92JIevABkVala\n Sguza1ArzwcL7x9JKNcartkslGtURyYME3jiZA8q+/nr9KXh8L5FSoZTDaRuGN4GQNQXAisKpU+\n Nmdein1YiYwyy4TVdM6ojD15DgYnz9Qr7aiZD4+FE/voMMZe4bbEqWvSUxeB1iPv4tCG6zAK98z\n VjTIpGycn0/pE2mkYVziSBeqojZ61Tjxh/A9sWzh86c4Q0NExLlk+fECzeA==","X-Received":["by 2002:a05:620a:4509:b0:8d3:cdeb:6d3a with SMTP id\n af79cd13be357-8e79218171fmr2003477385a.57.1776717749404;\n Mon, 20 Apr 2026 13:42:29 -0700 (PDT)","by 2002:a05:620a:4509:b0:8d3:cdeb:6d3a with SMTP id\n af79cd13be357-8e79218171fmr2003473185a.57.1776717748850;\n Mon, 20 Apr 2026 13:42:28 -0700 (PDT)"],"Date":"Mon, 20 Apr 2026 16:42:27 -0400","From":"Peter Xu <peterx@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>","Cc":"qemu-devel@nongnu.org, steven.sistare@oracle.com,\n Fabiano Rosas <farosas@suse.de>","Subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","Message-ID":"<aeaPsxYhYo1AXrlB@x1.local>","References":"<20260417184742.293061-1-marcandre.lureau@redhat.com>\n <aeaBKzauFijGRhWr@x1.local>\n <CAJ+F1CKboKMKA0MbGhURhCSW5HkOM0+jQ4Sj4nWEXbLafpS1fQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"\n <CAJ+F1CKboKMKA0MbGhURhCSW5HkOM0+jQ4Sj4nWEXbLafpS1fQ@mail.gmail.com>","Received-SPF":"pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3679611,"web_url":"http://patchwork.ozlabs.org/comment/3679611/","msgid":"<aeaer6F0Q9XLt8Zt@x1.local>","list_archive_url":null,"date":"2026-04-20T21:46:23","subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Mon, Apr 20, 2026 at 03:40:27PM -0400, Peter Xu wrote:\n> On Fri, Apr 17, 2026 at 10:47:42PM +0400, marcandre.lureau@redhat.com wrote:\n> > From: Marc-André Lureau <marcandre.lureau@redhat.com>\n> > \n> > When a migration is cancelled during the early SETUP phase (before\n> > migration_connect_outgoing() has set s->to_dst_file), migration_cancel()\n> > takes a fast path that transitions the state from CANCELLING to\n> > Cancelled without calling migration_cleanup(). This leaves the migration\n> > yank instance registered.\n> > \n> > A subsequent qmp_migrate() call passes the migration_is_running() guard\n> > (since CANCELLED is a terminal state) and then calls\n> > yank_register_instance(MIGRATION_YANK_INSTANCE, &error_abort), which\n> > finds the stale entry and aborts with \"duplicate yank instance\".\n> > \n> >   #6  0x000056028b5e17fc in error_setg_internal\n> >       (errp=errp@entry=0x56028cc8cb18 <error_abort>, src=src@entry=0x56028ba87fa5 \"../util/yank.c\", line=line@entry=87, func=func@entry=0x56028bb77140 <__func__.5> \"yank_register_instance\", fmt=fmt@entry=0x56028ba87f8d \"duplicate yank instance\") at ../util/error.c:100\n> >   #7  0x000056028b601b2a in yank_register_instance (instance=instance@entry=0x7ffea0cf36b0, errp=0x56028cc8cb18 <error_abort>) at ../util/yank.c:87\n> >   #8  0x000056028b25221e in migrate_prepare (s=0x5602b0a7db90, resume=<optimized out>, errp=0x7ffea0cf3718) at ../migration/migration.c:2001\n> >   #9  qmp_migrate (uri=<optimized out>, has_channels=<optimized out>, channels=<optimized out>, has_resume=<optimized out>, resume=<optimized out>, errp=errp@entry=0x7ffea0cf3718) at ../migration/migration.c:2039\n> >   #10 0x000056028b5891be in qmp_marshal_migrate (args=<optimized out>, ret=<optimized out>, errp=0x7f63392e0ee0) at qapi/qapi-commands-migration.c:459\n> > \n> > Add missing yank_unregister_instance. Alternatively, it seems\n> > migration_cleanup() should be safe in this context too.\n> > \n> > Fixes: 624e6e654e11 (\"migration: cpr-transfer mode\")\n> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> > ---\n> >  migration/migration.c | 1 +\n> >  1 file changed, 1 insertion(+)\n> > \n> > diff --git a/migration/migration.c b/migration/migration.c\n> > index 5c9aaa6e58f..bbdd91ee7ee 100644\n> > --- a/migration/migration.c\n> > +++ b/migration/migration.c\n> > @@ -1477,6 +1477,7 @@ void migration_cancel(void)\n> >                            MIGRATION_STATUS_CANCELLED);\n> >          cpr_state_close();\n> >          cpr_transfer_source_destroy(s);\n> > +        yank_unregister_instance(MIGRATION_YANK_INSTANCE);\n> >      }\n> >  }\n> \n> Thanks for the report.\n> \n> I had a feeling that this is not enough.. and I had a feeling that this\n> special casing was something fast merged for cpr-transfer work to be able\n> to cancel the HUP source when waiting, however did it wrong.  IOW, at least\n> this chunk:\n> \n>     if (setup && !s->to_dst_file) {\n>         migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING,\n>                           MIGRATION_STATUS_CANCELLED);\n>         cpr_state_close();\n>         cpr_transfer_source_destroy(s);\n>     }\n> \n> Should only apply to cpr-transfer, not normal migrations..\n> \n> E.g. consider one qmp_migrate() on top of tcp socket:\n> \n> - qmp_migrate\n>   - migration_connect_outgoing\n>     - socket_connect_outgoing\n>       - ... waiting for worker to invoke socket_outgoing_migration()\n> - ... some time later\n> - qmp_migrate_cancel\n>   - above check hits, update CANCELLING->CANCELLED, unregister yank etc.\n> - ... some time later\n> - socket_outgoing_migration() invoked with an error\n>   - migration_connect_error_propagate() should see CANCELLED state, which\n>     is illegal.\n\nSo the 1st thing I did here is I tried to reproduce this issue with\nfirewall dropping packets over some port:\n\n$ sudo iptables -A OUTPUT -p tcp --dport 44444 -j DROP\n\nThen I can reproduce this by migrating to port 44444, and this patch does\nfix it, but then I verified I can hit the above illegal CANCELLED state\nerror:\n\n2026-04-20T21:30:21.669131Z migrate_set_state new state setup\n2026-04-20T21:30:27.281824Z migrate_set_state new state cancelling\n2026-04-20T21:30:27.281862Z migrate_set_state new state cancelled\n...\n2026-04-20T21:32:37.638382Z qemu-system-x86_64: migration_connect_error_propagate: Illegal migration status (cancelled) detected\n\nAfter that if I retry with a correct connection migration will actually\nsucceed.  I believe it's because migration_connect_error_propagate() was\ncareful on skipping the extra migration_cleanup() when hitting something\nweird:\n\n        /*\n         * This really shouldn't happen. Just be careful to not crash a VM\n         * just for this.  Instead, dump something.\n         */\n        error_report(\"%s: Illegal migration status (%s) detected\",\n                     __func__, MigrationStatus_str(current));\n        return;\n\nI'll try out the other approach and share the patch if it will pass all\ntests.\n\n> \n> So IMHO for non-cpr cases we should always get ourselves covered with\n> migration_connect_error_propagate(), except CPR where it may have the HUP\n> source registered via migration_connect_error_propagate().\n> \n> IIUC, maybe we could change this check to be an explicit one, checking\n> whether cpr_transfer_add_hup_watch() has the source attached but not yet\n> executed (if executed, migration_connect_outgoing_cb() will also properly\n> invoke migration_connect_error_propagate()).\n> \n> We could check against both \"mode==CPR_TRANSFER && s->hup_source\", but then\n> we need early release of hup_resource too (currently it is deferred until\n> migration_cleanup(), which is slightly hackish; after all the source\n> returns always with G_SOURCE_REMOVE for migration_connect_outgoing_cb, so\n> it was removed long time ago, rather than until the end of migration).\n> \n> Thanks,\n> \n> -- \n> Peter Xu","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=L8FdF2ss;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=LaLS6wy4;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzzbR0qsnz1yD8\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 07:46:59 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEwRt-00087J-Ap; Mon, 20 Apr 2026 17:46:33 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEwRr-00086t-C0\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 17:46:31 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peterx@redhat.com>) id 1wEwRp-0003K5-Ed\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 17:46:31 -0400","from mail-qt1-f199.google.com (mail-qt1-f199.google.com\n [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-646-2nngnCePOTC2mRtqTzwxXA-1; Mon, 20 Apr 2026 17:46:25 -0400","by mail-qt1-f199.google.com with SMTP id\n d75a77b69052e-50e423a05c8so56932801cf.0\n for <qemu-devel@nongnu.org>; Mon, 20 Apr 2026 14:46:25 -0700 (PDT)","from x1.local ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50e392e351esm90131071cf.7.2026.04.20.14.46.23\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 20 Apr 2026 14:46:24 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776721587;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=GBUtvPYvZpVW+Ynfg4Mkrgi1sg4otCsYmknNnSJhk5k=;\n b=L8FdF2sslG2VopnqaHPlQ0VkCmJq8F3QbGUvZoQUgwbIEkcP0FJ7AjnK2fvJ5+iJt9v0HM\n DYm6IPb55D6miTBgj4aSjwXYTpH+u2kz3jGwlCRnuwDVyqHjgIYf+S1Q/3DSEqAAZsuH0A\n lz1TIt3UjJFzY05LFD8ymDheAGjmR8k=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1776721585; x=1777326385; darn=nongnu.org;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:from:to\n :cc:subject:date:message-id:reply-to;\n bh=GBUtvPYvZpVW+Ynfg4Mkrgi1sg4otCsYmknNnSJhk5k=;\n b=LaLS6wy4UNOb58SD2kkBi1ZJ+7CxRqP550oV5g1ZAcY3dfcP1W5cbiouftASq1L5rK\n KT4ZJxvSR54zbpnuwnzLs2okNkM+1+aigVrAZKvI/Cv1SGXBvimwbIc2FkT6TmYm3nHu\n jb8xYUY9x0U28CfgkHN/oS1BEtu2feF3UwK+L83ukQVne7NHDo1rDBIxQ47vzfBXjCqS\n yltfYp/pFQsTZL+JhPkHMrpTV6SkFBB+qU6jjFwz1eLlqe+G+3dF910tR7a2SvxxhHZq\n VKxvk/0/S3k8jb7FHjTy2FIeeSZifvcCLzj6JPVygO/uBJU7huFiG4M9yhREYD6p2259\n 1sMg=="],"X-MC-Unique":"2nngnCePOTC2mRtqTzwxXA-1","X-Mimecast-MFC-AGG-ID":"2nngnCePOTC2mRtqTzwxXA_1776721585","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776721585; x=1777326385;\n h=in-reply-to:content-transfer-encoding:content-disposition\n :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=GBUtvPYvZpVW+Ynfg4Mkrgi1sg4otCsYmknNnSJhk5k=;\n b=WqSxf73j+gviCLtEaYR92YUwbpFahHi52bBU7CY0WC/55UI5otVpoqFH4l1dB9MQWH\n F8GAFrrRoI4ODxsWJvqYvLpXj08AcSWLonZtsqI6zbykz9y8LPqFvHY9S8CV2wk8Z8Ru\n oYF9zOYAyKLKm2seyEIWHJAJon6TO9vlr6FyQUfMY6I84o12OHEdRqOdnLnTB5vO8Kae\n HZWl28jSFQqbFtxAzoyumb/p5NYxscvD4aSfqcadY39QPjTDYN1b4ZJnNpAW+QRwbelH\n Re5JXLOt1zfNi2e0aG5BAFX7ozwBh9jI8kQoKDdZKlfa3uXDxwM/qeOBf8B4otL4/n+f\n N7jw==","X-Gm-Message-State":"AOJu0YwaJQRUg3GGoonSeE4rxnh3dE9ovH9I/VgvF5zFKjUs+SIAVJqR\n frvnI7EOnnZljRid4hsnsIyN632uu/sqlfjAab+FG1QIH9H9qDSO3UHN2nBmjbe4aAjfak1kY8V\n xtY0cSMYDbEPUF4AVR+ylsslzY11KDPHJfBOKG4NGePpha4708ZU68wMx","X-Gm-Gg":"AeBDietgOMT/mXqhmIcAQiQED3kngUkfvw9Lun7PxF5GQ6a0mChkpKMKqwjTwp/Yy9h\n 8bJ8XjoaExJ4fMjyTIkrY+gewuUhz4ciO23ATbpc6/9lMXJaZSN50TK188mrN5YAwKI2cwOmEWq\n 211GvF4N7SxhuTUj1EhGJVRkHvwhXuNXUy451dPS5JsqdqLGocz/CeOEsaLpgmrFyrOvS9Yq2rE\n GUpIDL0FH6znDVRyi/kyiAP3yYaDq10nS6F2U7rqJ2Fndcl4Z94w7Wr83UfM9IRW6QDr0VYEGBB\n AlvhALvGhg1K4j56zaxM9YNl2WN/YsIWbix0vGrcAk0t5YuMM16AVoeXRtKmeSFu+TM4QcwAITd\n 3dsEofDF/6GpdpoBg5gxG78l/uJ86wwAiELvzeTYzfIcDaZq5xnvZvqp9Yg==","X-Received":["by 2002:a05:622a:8356:b0:509:2231:977a with SMTP id\n d75a77b69052e-50e3676f1fbmr139388581cf.30.1776721585232;\n Mon, 20 Apr 2026 14:46:25 -0700 (PDT)","by 2002:a05:622a:8356:b0:509:2231:977a with SMTP id\n d75a77b69052e-50e3676f1fbmr139388371cf.30.1776721584655;\n Mon, 20 Apr 2026 14:46:24 -0700 (PDT)"],"Date":"Mon, 20 Apr 2026 17:46:23 -0400","From":"Peter Xu <peterx@redhat.com>","To":"marcandre.lureau@redhat.com","Cc":"qemu-devel@nongnu.org, steven.sistare@oracle.com,\n Fabiano Rosas <farosas@suse.de>","Subject":"Re: [PATCH] migration: fix abort when re-migrating after cancel\n during SETUP","Message-ID":"<aeaer6F0Q9XLt8Zt@x1.local>","References":"<20260417184742.293061-1-marcandre.lureau@redhat.com>\n <aeaBKzauFijGRhWr@x1.local>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<aeaBKzauFijGRhWr@x1.local>","Received-SPF":"pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]