From nobody Sun Jan 25 10:13:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769123073; cv=none; d=zohomail.com; s=zohoarc; b=Ig5k1Tpj7k+qLLuBBFytTrW2pz0Lv2f8KRt3IgOBF0Xxpl1WWU1wDY328XAsXbj4QTG+CwlRwpzRx1Vef3Mo8dJXpbroWxD6wa9uMQDxmd/V9+fDgoPPK0Hhrx4L3HCs6TSqn+otupGu6pKVQwwT9gxEqf7fBigq86dtuXxNA6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769123073; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kLs6t3A6IE+MqhXfWLaJEfim6xwTwv87bwSTLxc8aBI=; b=dr3MULy1j3sRcQrGXzB4mVTV6CHE/BC5t/yrUeiNP/BWG8VQ6ocrmIgSJIxHkFuH7qfwZhMj15NV21I85G3SI4Mm3QgdZgtdq1VBbCK0g2c0mRGRcKa+IWC/XzD/BgBSAk5a7F9y/WDn63s8S2x7wAxiU92iOAbw3iOh8e5q1cw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769123073701882.9196653749923; Thu, 22 Jan 2026 15:04:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vj3iI-0004we-V8; Thu, 22 Jan 2026 18:03:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iH-0004uc-BI for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iF-0007Ri-Er for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:41 -0500 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-nP39GV2cMaWOvLf_Jg4iNg-1; Thu, 22 Jan 2026 18:03:36 -0500 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8c5311864d9so433404585a.2 for ; Thu, 22 Jan 2026 15:03:36 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37d2a56sm41032785a.20.2026.01.22.15.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 15:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769123018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kLs6t3A6IE+MqhXfWLaJEfim6xwTwv87bwSTLxc8aBI=; b=TzJft8FneV4yOgtQ48qZVoWWzl7TlaBtF+UXNkkfXmF8CgUEliKuB/xxE9Flf4TFNXgawx CEu+EEeAMQ49kRc2IwWBh3oN0eLsdhO41lhbaYOczSeRASk+oUyljk4oAVHitPN6A1vY1E ZiNToAa/wq8QfHAyIbd70CTQ/22EK/g= X-MC-Unique: nP39GV2cMaWOvLf_Jg4iNg-1 X-Mimecast-MFC-AGG-ID: nP39GV2cMaWOvLf_Jg4iNg_1769123016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769123015; x=1769727815; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kLs6t3A6IE+MqhXfWLaJEfim6xwTwv87bwSTLxc8aBI=; b=kwFRdfj6uMeMLdVpunY2QRKLqDJrEBgKqe3LkZ+1fICnMY97vN+ujnMjTiAyjWlM7R rZPEGassNEQDtYdLAdgecgbIq3LzeeflxcZi6ukhBBcmEbKit8jPC5J7I4rDs+6m/4Vj yVrr/rthKOyo7hHv0ZKelBTYuClnvQFOFOEkuBS2OE2rTI2Ytg9A0vtQCu51wkB6cjjA 2bJQQXMhmhnJd6BelrC/LSApNZwEGQ1USGQcDk67EOL6DQH2l70ytPUxw7bUrWQPo49q WpE//ay3I9BI4823wFowq9rZuS9+rW8mDVw+fs0Z8v0+SGLp3JnbKuXPkm+ClLrqC3rY qe2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769123015; x=1769727815; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kLs6t3A6IE+MqhXfWLaJEfim6xwTwv87bwSTLxc8aBI=; b=lBQbOyvDQmdke+LwPEVXNUGEgGlpwiRfyuZYiTfGB2Ei9CrwW+GTzNxry2dVsKJZEa H1feiE1Qi01DviG3vepnFqO1QcUh/HOo5ceqBXZ4NDaIo/YA6fD2lowCX7cw2DpXetHT anwWfHvv/rwif7swR2W0Shbncit1KgGN+Z+DU99T5JcyjR6UoI+cEeKeUmaPlX3fH/Fc CyaYnUsT8fxl1gNK5nYwyiZZGJ3dY/3uhHwZTqINRz+vKrAna7ySeTo3yPRnDYGG04zI YBKt45yaAWVPDQSpwD/CPMo7ekGz4C7Wrk8RKyeXvZw/EF4Aqs3bhE9U+0s3h8W/OK1c V/gw== X-Gm-Message-State: AOJu0Ywkez+JCoGRlUQ/NRC0cS4a3jApfZXh7b5zrUMdX9T/hLS27L/o ChD0cHjrTCI+NcPHtwRZP56d23tmWCWensRBAiZX6IrXnacCU8TTyMP5SqTPeMWiM8r/ewoEMcg thNN9Mp1ee/Fojay0FfpQiHhujh7THu65dqryq+4nFse6G0Meb7fUd0mMJTrAjBuFegmV5rqWpF zi8HVbtIsMc6TR1O3hUx/BGw/657IoM8e4v0OZFA== X-Gm-Gg: AZuq6aI6+bP4p0wmBHC9Bq7dH2lCS6AQrgwooHnLsDGW+nE5G/O95VSDibsVvqJGh9c qHUHEqDoInAF6fp5KalK2TkMnptFQxpgLWbABYM2YbWCOQBR1/7S3Vl2JKQ04xO5hZ5iWI8BWDU wgkPsumR69T8upeo7/zdB4QG7++i4tivirpdUFXkxPWmPE7h64SVIkrMrEdqnZocTeOzLghL148 XFChXRpUrJK/XUmqLDPRJMCHT9uzLWU7RglSTxZkyCbkMJ0FEA1agVlA5ZK97OYDy0SlzKaJyJ0 p8eAQjnQ10pAYQ5RcvN1TVTGmYj0qLwPp0rEQ6OKKi4qT2s4/memT+IyAc5Y0ud+yEXg6/nz1uh a X-Received: by 2002:a05:620a:298e:b0:8c6:afa8:91de with SMTP id af79cd13be357-8c6e2e4b65emr150725685a.77.1769123015555; Thu, 22 Jan 2026 15:03:35 -0800 (PST) X-Received: by 2002:a05:620a:298e:b0:8c6:afa8:91de with SMTP id af79cd13be357-8c6e2e4b65emr150721885a.77.1769123015028; Thu, 22 Jan 2026 15:03:35 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Stefan Hajnoczi , Fabiano Rosas , Prasad Pandit , peterx@redhat.com Subject: [PATCH 1/5] migration: Add a tracepoint for invoking migration notifiers Date: Thu, 22 Jan 2026 18:03:27 -0500 Message-ID: <20260122230331.3543312-2-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260122230331.3543312-1-peterx@redhat.com> References: <20260122230331.3543312-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769123076584154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas --- migration/migration.c | 2 ++ migration/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 1bcde301f7..47d9189aaf 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1706,6 +1706,8 @@ int migration_call_notifiers(MigrationState *s, Migra= tionEventType type, GSList *elem, *next; int ret; =20 + trace_migration_call_notifiers(type); + e.type =3D type; =20 for (elem =3D migration_state_notifiers[mode]; elem; elem =3D next) { diff --git a/migration/trace-events b/migration/trace-events index bf11b62b17..f437f0a784 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -198,6 +198,7 @@ process_incoming_migration_co_end(int ret) "ret=3D%d" process_incoming_migration_co_postcopy_end_main(void) "" postcopy_preempt_enabled(bool value) "%d" migration_precopy_complete(void) "" +migration_call_notifiers(int type) "type=3D%d" =20 # migration-stats migration_transferred_bytes(uint64_t qemu_file, uint64_t multifd, uint64_t= rdma) "qemu_file %" PRIu64 " multifd %" PRIu64 " RDMA %" PRIu64 --=20 2.50.1 From nobody Sun Jan 25 10:13:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769123073; cv=none; d=zohomail.com; s=zohoarc; b=l2UpYpnrELJnHG3EQ38AasSTYDzz7aSTXB3Gfv4ODzrSQvWiGdLbF7fHskqCObyo0QDZLU+5hfdLWRNbRIsqsjKridLalHfFHwaHLgw4XX3Iaxmt5EQ6kE3D2v2jz8DpTmGAqmHdO+e6GfCJvAGr+YQzEnXfPsjUlUvkhEXjaRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769123073; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x6Clafm83cpUvxlAJaqZR0gZqoh8vU0lKtAXEYMO/5I=; b=XcNfedopXVDS/xzGsoEBuhRW/aP4RGUm77vfy28E6C8u/jmeFYEhOb72RJSHa2/trKQ3TNJAqMSQS9kZIdEOJaTF+CQy+b7ghVwvmlPzyJN6+prsevcha7Fb7wZmJpxyA6OgKUJkcKfbHT0Lkc/WahswmS5xUEAoWZQ0P8n6qBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769123073745937.3898131793492; Thu, 22 Jan 2026 15:04:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vj3iL-0004yB-4f; Thu, 22 Jan 2026 18:03:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iI-0004wF-PF for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iG-0007Ub-F6 for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:42 -0500 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-669-3CV5EfCoNJKM7ml1EJF9eg-1; Thu, 22 Jan 2026 18:03:38 -0500 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c6ae763d03so176156785a.3 for ; Thu, 22 Jan 2026 15:03:38 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37d2a56sm41032785a.20.2026.01.22.15.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 15:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769123019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x6Clafm83cpUvxlAJaqZR0gZqoh8vU0lKtAXEYMO/5I=; b=A3e2pYAJBW+yHMcXSL83Lqpz5THIF59strYKeVBXPPZf9+ara5msN+GKEGgiU14Q4rRykF AR+kBmeZMMg4FO9L6xTOcM5dNfoPIiBIM3bjIYx1/jd730yjlXGlCkuijISwnZ6lJZW6ks qcFy51sk6LXp3QUeZu4zZAF6dFxaqW4= X-MC-Unique: 3CV5EfCoNJKM7ml1EJF9eg-1 X-Mimecast-MFC-AGG-ID: 3CV5EfCoNJKM7ml1EJF9eg_1769123018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769123017; x=1769727817; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x6Clafm83cpUvxlAJaqZR0gZqoh8vU0lKtAXEYMO/5I=; b=OUrEM3If36hVNO1tkSCSsET56ry3xPz856BEuZeaPd/Te9etRLRr/0LN5996X7eJne cngMN8jNiLZ9v9vllHHI+gvGykk2lS07dUceGrgRttzZsibQRJQYhGrAzG0PtAlqTCaa Pbc6siBg8eMfwTGLf9LF9ThfKOlC3GT+ogohPE1ao4ITGBVOl4xzytc6upSIIsU2Gztx muIeEQ03SSK4ATKQFaFD3okmlOAEUCWBlyAliSmUmfuvpI70UfuMhElmCt5dqqRV1Xh2 +DBmn9T4Rm0+1NH+NsUw/gHK3E5jmILzYOPiFh2CaWKxUM2sZhZH8B+8vHHEkPNGx0by pZxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769123017; x=1769727817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=x6Clafm83cpUvxlAJaqZR0gZqoh8vU0lKtAXEYMO/5I=; b=ktW8MKL77KRvII5nf5AeW6YaGuVZBvv7Ft8/hocrPxFwTjwspeGuwdgVRGRMxH889X AD0r1pvPE1OUX0GF5YEkxtn+oYpB5guO7EToYu6tJ5WY23kJq8ueM+QtWdsOzBHXys77 ZgYzohlsN8J2SuWwjp2CAtfWi78A69Pftxu1C7+RsjzAVrQLpUV7VLlN2QB8NCf4XV0e kk/c9R6RtT6Gov771r2m6NpWV6EZKTAL/q68AQ94mHn8vakGAVQTd+z0ssflR8a0qFep lHQwLUkfpa/kHhtsVb3Nfjm/mqwhN0YypfPXLDBGm1345dtAwJ2eUScc3c3fGlUIrtzs p6Bg== X-Gm-Message-State: AOJu0Yzk7zNZPaRjXk2VdZt7y9ISVlWSRkxMqlqh7xscwZAWoqy5RAnE DD/S2vLBd07Lc4Cjb0fEMubFBhx0YqJpTm9xdwyZg28PBPVrrbaoOG4zG0Mkisa3Ox3WvfRQOyf +JqbfHUq8Lq37dObW4+4FtTs17MzJfB7J8uqtTVgUXshCCpomUhUiUPz5eVHYgSqWqQiIzYsBMD OdWG3EDgt/mcjvzEMVT2j89MrsTiCHyaP3RcGkow== X-Gm-Gg: AZuq6aKKB8iyTN1BOAyzRdVgo0i5h/wR/5D+/R3rUZr8kE2MIAu253UGnST6zkux2Ei AIcX8i/sIrkB8AJ7gD2KEBf4vfgAugadHeEeupuLbj0SY/8yZb9LZxSR0muv3GvhTmjqwhtpCP3 kjGc3e34We7HjKSLnE4BeV2YKpuYyU2XFscRls28h+V2CvYx9i9sb9RL2DeqgHIJ7RyYgvnOpCx e8JRJcV68rd3y2Vqmrd2/vgTuVooW2NUOyyAQs7zPYMBC8NQWiP4Or5dtQKpnI/P9+1bV9EYLia B3rIjPDb0tl9PT5URETeGkY+tbmWDCupEo+zwwcajK36344TN5+833/8QSIjgtGIoA14tFZNOrA y X-Received: by 2002:a05:620a:1709:b0:8b2:7726:c7c4 with SMTP id af79cd13be357-8c6e2e2e85dmr158956785a.63.1769123017370; Thu, 22 Jan 2026 15:03:37 -0800 (PST) X-Received: by 2002:a05:620a:1709:b0:8b2:7726:c7c4 with SMTP id af79cd13be357-8c6e2e2e85dmr158951385a.63.1769123016719; Thu, 22 Jan 2026 15:03:36 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Stefan Hajnoczi , Fabiano Rosas , Prasad Pandit , peterx@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Dr. David Alan Gilbert" Subject: [PATCH 2/5] migration: Fix double notification of DONE/FAIL for postcopy Date: Thu, 22 Jan 2026 18:03:28 -0500 Message-ID: <20260122230331.3543312-3-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260122230331.3543312-1-peterx@redhat.com> References: <20260122230331.3543312-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769123076784154100 Migration notifiers will notify at any of three places: (1) SETUP phase, (2) migration completes, (3) migration fails. There's actually a special case for spice: one can refer to b82fc321bf ("Postcopy+spice: Pass spice migration data earlier"). It doesn't need another 4th event because in commit 9d9babf78d ("migration: MigrationEvent for notifiers") we merged it together with the DONE event. The merge makes some sense if we treat "switchover" of postcopy as "DONE", however that also means for postcopy we'll notify DONE twice.. The other one at the end of postcopy when migration_cleanup(). In reality, the current code base will also notify FAILED for postcopy twice. It's because an (maybe accidental) change in commit 4af667f87c ("migration: notifier error checking"). First of all, we still need that notification when switchover as stated in Dave's commit, however that's only needed for spice. To fix it, introduce POSTCOPY_START event to differenciate it from DONE. Use that instead in postcopy_start(). Then spice will need to capture this event too. Then we remove the extra FAILED notification in postcopy_start(). If one wonder if other DONE users should also monitor POSTCOPY_START event.. We have two more DONE users: - kvm_arm_gicv3_notifier - cpr_exec_notifier Both of them do not need a notification for POSTCOPY_START, but only when migration completed. Actually, both of them are used in CPR, which doesn't support postcopy. I didn't attach Fixes: because I am not aware of any real bug on such double reporting. I'm wildly guessing the 2nd notify might be silently ignored in many cases. However this is still worth fixing. Cc: Marc-Andr=C3=A9 Lureau Cc: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- include/migration/misc.h | 1 + migration/migration.c | 3 +-- ui/spice-core.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e26d418a6e..b002466e10 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -63,6 +63,7 @@ typedef enum MigrationEventType { MIG_EVENT_PRECOPY_SETUP, MIG_EVENT_PRECOPY_DONE, MIG_EVENT_PRECOPY_FAILED, + MIG_EVENT_POSTCOPY_START, MIG_EVENT_MAX } MigrationEventType; =20 diff --git a/migration/migration.c b/migration/migration.c index 47d9189aaf..91775f8472 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2857,7 +2857,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) * at the transition to postcopy and after the device state; in partic= ular * spice needs to trigger a transition now */ - migration_call_notifiers(ms, MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(ms, MIG_EVENT_POSTCOPY_START, NULL); =20 migration_downtime_end(ms); =20 @@ -2906,7 +2906,6 @@ fail: migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); } migration_block_activate(NULL); - migration_call_notifiers(ms, MIG_EVENT_PRECOPY_FAILED, NULL); bql_unlock(); return -1; } diff --git a/ui/spice-core.c b/ui/spice-core.c index 8a6050f4ae..ce3c2954e3 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -585,7 +585,8 @@ static int migration_state_notifier(NotifierWithReturn = *notifier, =20 if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { spice_server_migrate_start(spice_server); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE || + e->type =3D=3D MIG_EVENT_POSTCOPY_START) { spice_server_migrate_end(spice_server, true); spice_have_target_host =3D false; } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { --=20 2.50.1 From nobody Sun Jan 25 10:13:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769123104; cv=none; d=zohomail.com; s=zohoarc; b=f/ihM8JkSzMuaubbmg9DU2HufMIGwJFcHY7XzA/hDE4nHJJkZBKVwJEhIZqx1rA+Jz9A2kY3t11ximJjEwvkVMr4dtx7uWnzBSLNjpScdtj/3GwkAhgPv6mlaPfhz+xE4NUJhoGSauwdlGiUDGx1fiDMwLe2tKQiBekEJCvMp/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769123104; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pDiedGlQr/KQRJYDxCSC/2kq29zJ5agXHeHdCKxHIMw=; b=QktwdRtoNNfCW08xUoXqMhhMLIPMGak9ONapI6f7xWWEk1hpGuaG2qWQpZnjLaGuBEMQd2YngAlP0l/nglolAg3RI+i9yV+h1GwxvE2bSonPNXrFpwNzUpbpZGITOp1cfAOhvyVyRLSSfbaVVfHGleMLsXYvgdmsSHy49uV+Eq4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769123104715166.66978526231298; Thu, 22 Jan 2026 15:05:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vj3iM-0004z6-Pm; Thu, 22 Jan 2026 18:03:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iK-0004xx-VB for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iJ-0007Vm-As for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:44 -0500 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-76-N2QfMRgcPAOw3uWylK4rUg-1; Thu, 22 Jan 2026 18:03:40 -0500 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c52fd47227so250002285a.2 for ; Thu, 22 Jan 2026 15:03:40 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37d2a56sm41032785a.20.2026.01.22.15.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 15:03:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769123022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pDiedGlQr/KQRJYDxCSC/2kq29zJ5agXHeHdCKxHIMw=; b=AL3L4WbafSlk5v8+QLGn5FbCUgpXXyfDqtYfWcE+YQs3w/CzOxFlrWQrCzln77fbFdXAD9 mjZkHISZRnm9GMq3pCcu7V4lRNJdvskxRp8Aox+ME1lv1HJRloRNW1uRojSvdZEE4/xH/F VaJRniwx+QYNRjeVNEay9pcCmddnNoc= X-MC-Unique: N2QfMRgcPAOw3uWylK4rUg-1 X-Mimecast-MFC-AGG-ID: N2QfMRgcPAOw3uWylK4rUg_1769123020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769123019; x=1769727819; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pDiedGlQr/KQRJYDxCSC/2kq29zJ5agXHeHdCKxHIMw=; b=l0CxvEcWYqpY2ht7W62nlbtVJ0TCrDRe1e9s/Q2LVmYCTwGt+NYbbgp241KLq9D9RD WJ8UXKKzHpHecQq4aRcY1t0rCw6MIY+fyUlC5fano9ZxZFMCcSTKvYMv2O75HiBtxxKo u2xaMRRe08zLw6pdsCdIbrg/XbuBWE7H4L4+2knYYFhMRNinj4yVdm3YgyI+xAZn0C5N 0+LLjMf3lLynY19Umo4v2mXMegou9vdp/C2E9iszCRVOWnHRNmqJg9ylVhtMzriJsIyJ lQoQSa7lXOSm1IdjDk0+b/5KXbhnsXZGuoNcqXZhcHbOF8Ln5DuNjrXwxu4AJAiFMN03 Q1ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769123019; x=1769727819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pDiedGlQr/KQRJYDxCSC/2kq29zJ5agXHeHdCKxHIMw=; b=tAWL3wLLwSQ1aVstB0xinufKPaKS997ktJSWRH+AoN+kF7qwhq4Z+U8D5z5GAHAmIg uIYOn+Y1HsTkbnKvOOIHCIIIKfPiU5mq38g82gvnYJXdxcVSNnoRVjaBbbk01DFH8j0e /OcDCz0rr7UWPZZLvSLnt+8GnkEbOJCFM8EgdMeIlrAUnToro82rlbaCO2+PPkznOcIW SGV8gaawYfFeGhQ3VdLQ0+81KBzZBvdJo9feAOfYUaOIE1fLrjhrAHRB6+1QJi7BesQP GJH0bQHcxRIEFDWofNOh5mO44YtmnHBCRgsdgtdDhJEgutJeUA7BdcEds56ZFqJu48Lq h8Rg== X-Gm-Message-State: AOJu0YzDLI7mm4BzLjlDBLxr7WrlBFtX/MWe0el90OtLq2HVmn+XKlFI KmvXdpoEdf9xUO6CpV9wHHCc6is6xyiwGE6U33aHnPQpDG9xNr88nEt8hFFOvmefGO60WE8V6QM LVrKEnP0w8OsEcbbtJSJUccpbjzK74Z/rPpAJqGTKuBSWewEbXGXFWjtF7DNNjCigMC7cHyDp7h 9gWYLxyt0GWtUfr3DHwwKSt/3Nk4XbOFmoreCSPA== X-Gm-Gg: AZuq6aK9cVqZ86X6x1S62UHMFa26imov2o6pg+Jkb0yGu0KHntVVChtP4lX7S7OR0ZT oRgOajYHN4N0IUWUERYmprG7P0/1TMg73wx5Z+0I+Jq7UZDfW9gp/bB0DcMaWzEA38EszF2cX3l 1PXlvMjbw11orWqIanqwmYsWFRCMrQvcH64l13FKrXtbdHorbK4ZN56PLqstLWPN8/EtPK+sRFB 4Tzvybe80itw4dm8MMZT+JdbBEN4fJHCcinM1I1CXKbxhELhvUExsR/RW/rYkx0+nBYHBOO6BcD g8ssbElJdoU4OEPFpL44vyGBHaRCiBGF5iKXvu733tY4AeOKTzkABfX2qcMRcuGZSBvfbsvS2Zv r X-Received: by 2002:a05:620a:45a4:b0:8c2:e8b3:7c3a with SMTP id af79cd13be357-8c6e2e5ced7mr148903885a.87.1769123019404; Thu, 22 Jan 2026 15:03:39 -0800 (PST) X-Received: by 2002:a05:620a:45a4:b0:8c2:e8b3:7c3a with SMTP id af79cd13be357-8c6e2e5ced7mr148898385a.87.1769123018730; Thu, 22 Jan 2026 15:03:38 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Stefan Hajnoczi , Fabiano Rosas , Prasad Pandit , peterx@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 3/5] migration: Notify migration FAILED before starting VM Date: Thu, 22 Jan 2026 18:03:29 -0500 Message-ID: <20260122230331.3543312-4-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260122230331.3543312-1-peterx@redhat.com> References: <20260122230331.3543312-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769123107611158500 Devices may opt-in migration FAILED notifiers to be invoked when migration fails. Currently, the notifications happen in migration_cleanup(). It is normally fine, but maybe not ideal if there's dependency of the fallback v.s. VM starts. This patch moves the FAILED notification earlier, so that if the failure happened during switchover, it'll notify before VM restart. After walking over all existing FAILED notifier users, I got the conclusion that this should also be a cleaner approach at least from design POV. We have these notifier users, where the first two do not need to trap FAILED: |----------------------------+-------------------------------------+-------= --------------| | device | handler | events= needed | |----------------------------+-------------------------------------+-------= --------------| | gicv3 | kvm_arm_gicv3_notifier | DONE = | | vfio_iommufd / vfio_legacy | vfio_cpr_reboot_notifier | SETUP = | | cpr-exec | cpr_exec_notifier | FAILED= , DONE | | virtio-net | virtio_net_migration_state_notifier | SETUP,= FAILED | | vfio | vfio_migration_state_notifier | FAILED= | | vdpa | vdpa_net_migration_state_notifier | SETUP,= FAILED | | spice [*] | migration_state_notifier | SETUP,= FAILED, DONE | |----------------------------+-------------------------------------+-------= --------------| For cpr-exec, it tries to cleanup some cpr-exec specific fd or env variables. This should be fine either way, as long as before migration_cleanup(). For virtio-net, we need to re-plug the primary device back to guest in the failover mode. Likely benign. VFIO needs to re-start the device if FAILED. IIUC it should do it before vm_start(), if the VFIO device can be put into a STOPed state due to migration, we should logically make it running again before vCPUs run. VDPA will disable SVQ when migration is FAILED. Likely benign too, but looks better if we can do it before resuming vCPUs. For spice, we should rely on "spice_server_migrate_end(false)" to retake the ownership. Benign, but looks more reasonable if the spice client does it before VM runs again. Note that this change may introduce slightly more downtime, if the migration failed exactly at the switchover phase. But that's very rare, and even if it happens, none of above expects a long delay, but a short one, likely will be buried in the total downtime even if failed. Cc: C=C3=A9dric Le Goater Cc: Marc-Andr=C3=A9 Lureau Signed-off-by: Peter Xu --- migration/migration.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 91775f8472..1d9a2fc068 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1481,7 +1481,6 @@ static void migration_cleanup_json_writer(MigrationSt= ate *s) =20 static void migration_cleanup(MigrationState *s) { - MigrationEventType type; QEMUFile *tmp =3D NULL; =20 trace_migration_cleanup(); @@ -1535,9 +1534,15 @@ static void migration_cleanup(MigrationState *s) /* It is used on info migrate. We can't free it */ error_report_err(error_copy(s->error)); } - type =3D migration_has_failed(s) ? MIG_EVENT_PRECOPY_FAILED : - MIG_EVENT_PRECOPY_DONE; - migration_call_notifiers(s, type, NULL); + + /* + * FAILED notification should have already happened. Notify DONE if + * migration completed successfully. + */ + if (!migration_has_failed(s)) { + migration_call_notifiers(s, MIG_EVENT_PRECOPY_DONE, NULL); + } + yank_unregister_instance(MIGRATION_YANK_INSTANCE); } =20 @@ -3589,6 +3594,13 @@ static void migration_iteration_finish(MigrationStat= e *s) error_free(local_err); break; } + + /* + * Notify FAILED before starting VM, so that devices can invoke + * necessary fallbacks before vCPUs run again. + */ + migration_call_notifiers(s, MIG_EVENT_PRECOPY_FAILED, NULL); + if (runstate_is_live(s->vm_old_state)) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { vm_start(); --=20 2.50.1 From nobody Sun Jan 25 10:13:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769123092; cv=none; d=zohomail.com; s=zohoarc; b=Hk0ubdlx+EkaqH0Qgng+aJKsRD1v0B4nM/LMAL5zupgJTHYG9Nk9aUv+lNmKTQ9GVwb6STAyKHh8PZCZNnJccB4yO4FMLgGlc4vdxsrPV7dNGv4KeSoX29d2nWNOXnQBRS0D31m7jFemh5QiQVfdQm3aVUbrFnLAbd4iER1oIkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769123092; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sJVnKFurjfOzRxE0fGeLT7o1Vv1nXq2SFkrz7rX6drA=; b=QYvWPh8EPaiMmPb0IO46faX6VUKgPVNvS7IGKs1jPvT0An3JNlfsEqtAC6GLC7yBvT+pLgWbPszFNcoIugb8gc58nw3uV9Ywd/fEmPIOkGOQx087tzSaNOVF3NaIfTmGEkujM/zy1MioFAXrN9O6WupYfuFafk62RPVX0kxSYPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769123092484242.25455060867966; Thu, 22 Jan 2026 15:04:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vj3iM-0004z4-Jw; Thu, 22 Jan 2026 18:03:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iK-0004xR-Ky for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iJ-0007VW-8s for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:44 -0500 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-QtOBzQnNMuSfBIHyLo1vPQ-1; Thu, 22 Jan 2026 18:03:41 -0500 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-8946b186018so61522226d6.1 for ; Thu, 22 Jan 2026 15:03:41 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37d2a56sm41032785a.20.2026.01.22.15.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 15:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769123022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sJVnKFurjfOzRxE0fGeLT7o1Vv1nXq2SFkrz7rX6drA=; b=bdtF+yLoQOosOrs61Vc613GHvyaSj2cMFKFqhkW4NPYiinxiEbIiZWJkS5TLJnH1WDywjD WYlQHXMPZI+fyvV/DadoUg0Yd3sV7P6LCV8hTucreOC79C/qSJlMrVfw0RL5mQo5SFpti5 pIP+Vokloqt+XMJEPoAVolP/vn5F7ro= X-MC-Unique: QtOBzQnNMuSfBIHyLo1vPQ-1 X-Mimecast-MFC-AGG-ID: QtOBzQnNMuSfBIHyLo1vPQ_1769123021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769123020; x=1769727820; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sJVnKFurjfOzRxE0fGeLT7o1Vv1nXq2SFkrz7rX6drA=; b=sahKaAZ3opRuHF4szuZXdUEVHn+x4e3Kyz9KpmyJ5FpzOklfnLL77iNYzt+ioQ1rj5 bSauFBK0yCqqG8ic/cuTQtl9PmQpnIzmH4bStl8MOgmqVP583eYqAgAnyfvZFasdlhDv Es7Fe4HwahnUqYzN1GiaGWNBn+CIAXXl3mVPsnXJ2Qp5AvnQi1VdvW7MmWLm8l2licuA FkbdHXw9EZzi54Qv6ca2ZtQyn3kYEqSW1EW5Zo9IpQu4AEPtLdTrcp3Rulox1Fv9fZ+l 9trNvVJFwOBe+OFScHKqOE/AaAgp8cuK7WuN9WJXyzE0S+SXxmABr+WVUhtu27MMb4i0 qgzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769123020; x=1769727820; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sJVnKFurjfOzRxE0fGeLT7o1Vv1nXq2SFkrz7rX6drA=; b=TTJ58oxhlL6haDgitxGe3yg4WF351xX+47p3TOaFGNpcbXKMleqzbxh4sOD9LCINie HJKZTofcGlhztyUKIE9wOaIPyl1DpHS2W2HbtYl8h3Q+6Cf+19BNBsV/XrnHf8ok16m5 7uGh4D7JIgMysz7qNi5wTYirf6NQr3eWTftp0ybqRlNqjzCzQ8Wec2cjD1zasodZMb5u 9RFEbJbw2nx9toit8h7raRVQk29SESsOUHqOLZLmaQWKoc0y/V3VfYirRSjm24BzV2tF qyCP7xanuHEBBz1itc77WMJSew9ceHL9o4wUYdeEfRu5vjMHURD2Bf/p7QQ6bzE/+eVH k+aQ== X-Gm-Message-State: AOJu0YytVJB9iW7MCqSFYDjvi9avnr1aaSLOScBJ1EIPmRkpuFxKW18G CGymDmsZb6tPbUI1+Yp1ln1cvd49bxLniAT8/1coJTgXilOBdtOoCWW+B9sf+NX3eHUFG/mZ3Vn h1XbsLwuQ1vOEOoUN8tjphS7UIxsxaOQoMfu9XFop2Cbu/pclM9akAWY1miEyA8zPE0Ui5GGBfJ WX6O/jKT53YWK7Duy7vJJn0d9KWjxW5ELgC5SSNg== X-Gm-Gg: AZuq6aKgtxL5Wc00FwSxR9wT7LkJ4Lu6j+q0QMNGgBRFYb205GxyoIWFvOaG9Ter7iJ Ov/HXw0+P2SPvtqxOVXTywS25mMnw5qLLn1UVFpoESmfHq/EaLasOz3ywa4pRe+qGMcX1yii1ut yJi0+cUEWarTslLWreTbHxYJycUqO3ODRbGl7tR0aOCGTAMea81Aa2FIKU2CLEohbgtbtIw86Of PJEKKBT+5Njg/oISFF5sPW8L8n4fVTPXZXUTIqKQwUZHI3uGEbt4l0gJaS5CPmGX2W15Vz5d9sX n4Gr7UFK1oWGH0TZNwMRwi024vwTEkuu2SerH7+8lVn4vVYstNE5o9dUGS8uwtQOjtL60XRsm+C w X-Received: by 2002:a05:6214:e47:b0:87c:28cc:9e69 with SMTP id 6a1803df08f44-8949023c3bcmr16412996d6.55.1769123020263; Thu, 22 Jan 2026 15:03:40 -0800 (PST) X-Received: by 2002:a05:6214:e47:b0:87c:28cc:9e69 with SMTP id 6a1803df08f44-8949023c3bcmr16412616d6.55.1769123019789; Thu, 22 Jan 2026 15:03:39 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Stefan Hajnoczi , Fabiano Rosas , Prasad Pandit , peterx@redhat.com Subject: [PATCH 4/5] migration: Drop explicit block activation in postcopy fail path Date: Thu, 22 Jan 2026 18:03:30 -0500 Message-ID: <20260122230331.3543312-5-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260122230331.3543312-1-peterx@redhat.com> References: <20260122230331.3543312-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769123093834158500 Content-Type: text/plain; charset="utf-8" Postcopy (in failure path) should share with precopy on disk reactivations. Explicit activiation should used to be fine even if called twice, but after 26f65c01ed ("migration: Do not try to start VM if disk activation fails") we may want to avoid it and always capture failure when reactivation happens (even if we do not expect the failure to happen). Remove this redundant call. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas --- migration/migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 1d9a2fc068..5bef14ea99 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2910,7 +2910,6 @@ fail: if (ms->state !=3D MIGRATION_STATUS_CANCELLING) { migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); } - migration_block_activate(NULL); bql_unlock(); return -1; } --=20 2.50.1 From nobody Sun Jan 25 10:13:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769123085; cv=none; d=zohomail.com; s=zohoarc; b=BNd+LzesIqwp5LCFxgbHMTcFKZn6Ldy3FywOjnRcAPvVgmgIZSKqVz/p84M/WFdt6A2kj3Wxk2l7mupXlJ3bJPHlD9+m1S2WV2JdIlhk7rppMH7j8HmleL3QOodWjTujvVMAmYgRNo1EVqP4S3VC8eadvCPrS0IDuMmksMO5Kw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769123085; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FYO6xRxiR5THGxcs3zEI0xVwPCkfMhpmibdg2OaNMFk=; b=l6TFVSxKkOE7cfZL7RWrW82VPxrKKNqDrhAsrEsghgyWayIFEl5MwrrlczTXfFU8T8/4rcjVU4Vndq3EhNPZuAUpv6GM85xRcwyt6rIBAZTUxgGwKJLgwwww4Sem/7YkMfnPM5d+t+mgyTadYyDTtcqJwacZsOSeheFrLlJ22sk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769123085050737.4100989916135; Thu, 22 Jan 2026 15:04:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vj3iO-000519-EO; Thu, 22 Jan 2026 18:03:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iN-00050N-FG for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vj3iL-0007XA-En for qemu-devel@nongnu.org; Thu, 22 Jan 2026 18:03:47 -0500 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-57frVaO9NmKnYET7WvAV8Q-1; Thu, 22 Jan 2026 18:03:43 -0500 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8bc4493d315so406284585a.1 for ; Thu, 22 Jan 2026 15:03:43 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c6e37d2a56sm41032785a.20.2026.01.22.15.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 15:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769123024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FYO6xRxiR5THGxcs3zEI0xVwPCkfMhpmibdg2OaNMFk=; b=b6qFh2T7mxDW6AAZ0Z2JvfEia4ACYognMZNTsYQo9EXVkfal+KbMdwKqVXlELEApK4C2QJ ggs4l4ihcqn+PxXzDQyynNQYkDeLRTigkz5BK+3dFaiOgDuaphQK2V91lZvH9OjhKUHFhq TcVIcSAhRxWduSxJrqeJte0nBczdQZ0= X-MC-Unique: 57frVaO9NmKnYET7WvAV8Q-1 X-Mimecast-MFC-AGG-ID: 57frVaO9NmKnYET7WvAV8Q_1769123023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769123022; x=1769727822; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FYO6xRxiR5THGxcs3zEI0xVwPCkfMhpmibdg2OaNMFk=; b=H3jbdyeRQJDA3Pr35bUVukoVFVy5WPvUaXnSscXPn0hDJueICAtVUEsjwDBPV+VZB3 u0HixXBpRhi/fkqJidIX5g3gxcsLe9jLGWq+seGOtCwyBiZVFN4Vvf04T6sc3qptjnDq oo4Kt7ETHnMTY2zCQ73AXYgbHP4dAmnQU+qCel5wjPVQJg2x9wywOItw1yi9P9OpQn9m WWM+vREOj1HpdBq8/d8NxE0D1d0ns6dCKc0ktF6bGDLf1Eovb3t4cvJTtndYpTM4y+VI 5HEn9k1LZoN0KZRGzd7F1bTHtF10/LwLkaYBwx3M2Rrsxhdpd6sUNUEfnBgbymO+qsPf VM3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769123022; x=1769727822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FYO6xRxiR5THGxcs3zEI0xVwPCkfMhpmibdg2OaNMFk=; b=GX6XN6ymQUUdHf99fcvA2dP88Zz6RjaVBRhreZi4JVPEuUpZlAt9B0n81Am+xM3a9j jjqaLASAocamj7zds0iFrqNtyV9MD8DZgCQt3xh+2RLh+2dalm3jcrsbf0+R5YqFLGxy aTeuqVoiy/Wx46yps2k2+qHmTYon6Hz3gMje+WxumzOnMB/YfHRrmtuDFaIw7hqw52zg Fddi8jzj0Y6UhkgHa+1Mt/oJ8FGHs/e4FBwSuowJj5x1Zbu78yHZxh01pcGGpYObOr00 pEEssr268jVLxzEZk1lgOTOpfinshIp3yg/RH2PnWqDppnCC7Ka/RB9xPCrt7it2/3jv hXAQ== X-Gm-Message-State: AOJu0YzZyvOzbFofeb2/hRP9zsvNgjlwnfn5YtRIXnJ7j3SuPvqGlzbf ihHpj27UX+21BBoGv2Ec0OnZ1cOgxJZvhtyxMmg7GI2ajdt0IpRhPfh0eBoWBupP//n6EgG3hJJ B7QALqSE81WQav+IJOSP7IUpUz85zVhNwaHXBLuPhHr9AQXlAkjOkH2XyObK7Q+8w2RZnjCyzgq Fi1F3PbN9q1/eZ4UV0YeIc2TpsrdWP0p521+Szuw== X-Gm-Gg: AZuq6aJanX5FyglKVxaKRFNipTYVxeVhYtsypWQ0P0Y1GExIV4Wc9N/whKOgNtgOg3x inymtJqc1N7a6jHGEJckKz6lQWgMfUAkgnlfqDS3CyQcVMKG98+/MWSYE39g1rdmvC5fruk7QMc jYm+ByObyFMyzWI7HlFXSE0GB5r1fk+eEWRbrRJYsfeJIHHV6PZdYa8DEqEGgJwFV5Yg2uKFR71 JrPT28tgresaBw6TcC7bydusAv4LdWLfcdrDgvFxt1Oz3fb6U2n/ZdZ7ELizrOBfKusI7BaBvGF em76lHoK2v45uhBt5+v1lB2KJ+1CHeYNFHD502BpaVBEqaw/Xjt+kuWT5twTJV0jNkhEaQhaFMZ e X-Received: by 2002:a05:620a:1a9c:b0:8be:94e6:3e6c with SMTP id af79cd13be357-8c6e2db89d3mr160748785a.39.1769123022106; Thu, 22 Jan 2026 15:03:42 -0800 (PST) X-Received: by 2002:a05:620a:1a9c:b0:8be:94e6:3e6c with SMTP id af79cd13be357-8c6e2db89d3mr160741785a.39.1769123021386; Thu, 22 Jan 2026 15:03:41 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Stefan Hajnoczi , Fabiano Rosas , Prasad Pandit , peterx@redhat.com Subject: [PATCH 5/5] migration: Rename MIG_EVENT_PRECOPY_* to MIG_EVENT_* Date: Thu, 22 Jan 2026 18:03:31 -0500 Message-ID: <20260122230331.3543312-6-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260122230331.3543312-1-peterx@redhat.com> References: <20260122230331.3543312-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.07, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769123088380154100 Content-Type: text/plain; charset="utf-8" All three events are shared between precopy and postcopy, rather than precopy specific. For example, both precopy and postcopy will go through a SETUP process. Meanwhile, both FAILED and DONE notifiers will be notified for either precopy or postcopy on completions / failures. Rename them to make them match what they do, and shorter. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas --- include/migration/misc.h | 14 +++++++------- hw/intc/arm_gicv3_kvm.c | 2 +- hw/net/virtio-net.c | 4 ++-- hw/vfio/cpr-legacy.c | 2 +- hw/vfio/cpr.c | 8 ++++---- hw/vfio/migration.c | 4 ++-- migration/cpr-exec.c | 6 +++--- migration/migration.c | 8 ++++---- net/vhost-vdpa.c | 4 ++-- ui/spice-core.c | 6 +++--- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index b002466e10..766de998cb 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -60,10 +60,10 @@ bool migration_is_running(void); bool migration_thread_is_self(void); =20 typedef enum MigrationEventType { - MIG_EVENT_PRECOPY_SETUP, - MIG_EVENT_PRECOPY_DONE, - MIG_EVENT_PRECOPY_FAILED, + MIG_EVENT_SETUP, MIG_EVENT_POSTCOPY_START, + MIG_EVENT_DONE, + MIG_EVENT_FAILED, MIG_EVENT_MAX } MigrationEventType; =20 @@ -73,7 +73,7 @@ typedef struct MigrationEvent { =20 /* * A MigrationNotifyFunc may return an error code and an Error object, - * but only when @e->type is MIG_EVENT_PRECOPY_SETUP. The code is an int + * but only when @e->type is MIG_EVENT_SETUP. The code is an int * to allow for different failure modes and recovery actions. */ typedef int (*MigrationNotifyFunc)(NotifierWithReturn *notify, @@ -83,9 +83,9 @@ typedef int (*MigrationNotifyFunc)(NotifierWithReturn *no= tify, * Register the notifier @notify to be called when a migration event occurs * for MIG_MODE_NORMAL, as specified by the MigrationEvent passed to @func. * Notifiers may receive events in any of the following orders: - * - MIG_EVENT_PRECOPY_SETUP -> MIG_EVENT_PRECOPY_DONE - * - MIG_EVENT_PRECOPY_SETUP -> MIG_EVENT_PRECOPY_FAILED - * - MIG_EVENT_PRECOPY_FAILED + * - MIG_EVENT_SETUP -> MIG_EVENT_DONE + * - MIG_EVENT_SETUP -> MIG_EVENT_FAILED + * - MIG_EVENT_FAILED */ void migration_add_notifier(NotifierWithReturn *notify, MigrationNotifyFunc func); diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 6f311e37ef..fddeefa26f 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -774,7 +774,7 @@ static void vm_change_state_handler(void *opaque, bool = running, static int kvm_arm_gicv3_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { GICv3State *s =3D container_of(notifier, GICv3State, cpr_notifier); return kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES, diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 317f1ad23b..3e2dc30da6 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3786,7 +3786,7 @@ static void virtio_net_handle_migration_primary(VirtI= ONet *n, MigrationEvent *e) =20 should_be_hidden =3D qatomic_read(&n->failover_primary_hidden); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP && !should_be_hidden) { + if (e->type =3D=3D MIG_EVENT_SETUP && !should_be_hidden) { if (failover_unplug_primary(n, dev)) { vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev); qapi_event_send_unplug_primary(dev->id); @@ -3794,7 +3794,7 @@ static void virtio_net_handle_migration_primary(VirtI= ONet *n, MigrationEvent *e) } else { warn_report("couldn't unplug primary device"); } - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { /* We already unplugged the device let's plug it back */ if (!failover_replug_primary(n, dev, &err)) { if (err) { diff --git a/hw/vfio/cpr-legacy.c b/hw/vfio/cpr-legacy.c index 7c03ddb961..033a546c30 100644 --- a/hw/vfio/cpr-legacy.c +++ b/hw/vfio/cpr-legacy.c @@ -137,7 +137,7 @@ static int vfio_cpr_fail_notifier(NotifierWithReturn *n= otifier, container_of(notifier, VFIOLegacyContainer, cpr.transfer_notifier); VFIOContainer *bcontainer =3D VFIO_IOMMU(container); =20 - if (e->type !=3D MIG_EVENT_PRECOPY_FAILED) { + if (e->type !=3D MIG_EVENT_FAILED) { return 0; } =20 diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c index 998230d271..ffa4f8e099 100644 --- a/hw/vfio/cpr.c +++ b/hw/vfio/cpr.c @@ -18,7 +18,7 @@ int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP && + if (e->type =3D=3D MIG_EVENT_SETUP && !runstate_check(RUN_STATE_SUSPENDED) && !vm_get_suspended()) { =20 error_setg(errp, @@ -186,7 +186,7 @@ static int vfio_cpr_kvm_close_notifier(NotifierWithRetu= rn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { vfio_kvm_device_close(); } return 0; @@ -272,9 +272,9 @@ static int vfio_cpr_pci_notifier(NotifierWithReturn *no= tifier, VFIOPCIDevice *vdev =3D container_of(notifier, VFIOPCIDevice, cpr.transfer_notifier); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { return vfio_cpr_set_msi_virq(vdev, errp, false); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { return vfio_cpr_set_msi_virq(vdev, errp, true); } return 0; diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index f857dc25ed..76a902b79c 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -917,10 +917,10 @@ static int vfio_migration_state_notifier(NotifierWith= Return *notifier, =20 trace_vfio_migration_state_notifier(vbasedev->name, e->type); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + if (e->type =3D=3D MIG_EVENT_FAILED) { /* * MigrationNotifyFunc may not return an error code and an Error - * object for MIG_EVENT_PRECOPY_FAILED. Hence, report the error + * object for MIG_EVENT_FAILED. Hence, report the error * locally and ignore the errp argument. */ ret =3D vfio_migration_set_state_or_reset(vbasedev, diff --git a/migration/cpr-exec.c b/migration/cpr-exec.c index da287d8031..18a71828c3 100644 --- a/migration/cpr-exec.c +++ b/migration/cpr-exec.c @@ -164,7 +164,7 @@ static void cpr_exec_cb(void *opaque) err =3D NULL; =20 /* Note, we can go from state COMPLETED to FAILED */ - migration_call_notifiers(s, MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(s, MIG_EVENT_FAILED, NULL); =20 if (!migration_block_activate(&err)) { /* error was already reported */ @@ -182,12 +182,12 @@ static int cpr_exec_notifier(NotifierWithReturn *noti= fier, MigrationEvent *e, { MigrationState *s =3D migrate_get_current(); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { QEMUBH *cpr_exec_bh =3D qemu_bh_new(cpr_exec_cb, NULL); assert(s->state =3D=3D MIGRATION_STATUS_COMPLETED); qemu_bh_schedule(cpr_exec_bh); qemu_notify_event(); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { cpr_exec_unpersist_state(); } return 0; diff --git a/migration/migration.c b/migration/migration.c index 5bef14ea99..7ba37afb27 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1540,7 +1540,7 @@ static void migration_cleanup(MigrationState *s) * migration completed successfully. */ if (!migration_has_failed(s)) { - migration_call_notifiers(s, MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(s, MIG_EVENT_DONE, NULL); } =20 yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1720,7 +1720,7 @@ int migration_call_notifiers(MigrationState *s, Migra= tionEventType type, notifier =3D (NotifierWithReturn *)elem->data; ret =3D notifier->notify(notifier, &e, errp); if (ret) { - assert(type =3D=3D MIG_EVENT_PRECOPY_SETUP); + assert(type =3D=3D MIG_EVENT_SETUP); return ret; } } @@ -3598,7 +3598,7 @@ static void migration_iteration_finish(MigrationState= *s) * Notify FAILED before starting VM, so that devices can invoke * necessary fallbacks before vCPUs run again. */ - migration_call_notifiers(s, MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(s, MIG_EVENT_FAILED, NULL); =20 if (runstate_is_live(s->vm_old_state)) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { @@ -4064,7 +4064,7 @@ void migration_connect(MigrationState *s, Error *erro= r_in) rate_limit =3D migrate_max_bandwidth(); =20 /* Notify before starting migration thread */ - if (migration_call_notifiers(s, MIG_EVENT_PRECOPY_SETUP, &local_er= r)) { + if (migration_call_notifiers(s, MIG_EVENT_SETUP, &local_err)) { goto fail; } } diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 74d26a9497..f4b1f0e9e0 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -378,9 +378,9 @@ static int vdpa_net_migration_state_notifier(NotifierWi= thReturn *notifier, { VhostVDPAState *s =3D container_of(notifier, VhostVDPAState, migration= _state); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { vhost_vdpa_net_log_global_enable(s, true); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { vhost_vdpa_net_log_global_enable(s, false); } return 0; diff --git a/ui/spice-core.c b/ui/spice-core.c index ce3c2954e3..ee13ecc4a5 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -583,13 +583,13 @@ static int migration_state_notifier(NotifierWithRetur= n *notifier, return 0; } =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { spice_server_migrate_start(spice_server); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE || + } else if (e->type =3D=3D MIG_EVENT_DONE || e->type =3D=3D MIG_EVENT_POSTCOPY_START) { spice_server_migrate_end(spice_server, true); spice_have_target_host =3D false; - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { spice_server_migrate_end(spice_server, false); spice_have_target_host =3D false; } --=20 2.50.1