From nobody Sat Feb 7 05:49:34 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=1769463421; cv=none; d=zohomail.com; s=zohoarc; b=VY84pyLhbAGC08nUxl9cdWuOryCsZaP7ZZ9CK6lBft6ltun+jszyy6czDlNYQrMhdPyDwnm+GNTNLx3QOv/01E0B36PgbKK5MOBcJ0q6TXzz6EGR2Ei60Kcv9oYirtBNV6k8keUTeZwkVEjIyJr8bbKRsV7CboXh5DhSvFFd744= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769463421; 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=8rL0AQZMo/YY0quRtMt3oVsuGltDVpd+3XkWVPidUEU=; b=C6GAsKCBJ3XJeu3zWVO9px9x0GfbkVEROyXT0E7TRW9d0iLwmoNpnB34erxiIyRAEDiQtrhPGwjUM+egJqZrYtfQA3Lw1OJO4fsxaqxnfpCZlYLf8R4kK+fflcwZv95Yq2gyisTFzy1FnKeTBZ8rbcai+pBttHqYMtwgWmcnFxA= 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 1769463421935406.7254376426224; Mon, 26 Jan 2026 13:37:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkUG3-0003jV-Qy; Mon, 26 Jan 2026 16:36:27 -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 1vkUG1-0003id-Sn for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:25 -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 1vkUG0-0003Lh-Dy for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:25 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-513-xnaecXWgP8WovYzFhhvhJg-1; Mon, 26 Jan 2026 16:36:20 -0500 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-5014d8b3ae0so131373951cf.1 for ; Mon, 26 Jan 2026 13:36:20 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502f7f9cd9esm89769281cf.33.2026.01.26.13.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 13:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769463383; 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=8rL0AQZMo/YY0quRtMt3oVsuGltDVpd+3XkWVPidUEU=; b=LUtfCWtAXh6reztDGfXy92RnMY1w4ooHx0jSo2jOEQEmTzVE0ksEJRQIX8qEUn8wvsnCka L6LjPvDbdrBlwl+fFuS9NaoGoCo3n4iTzs2LeqEicoNWZCNOSc/gdUt7SJ0RADKcVR+MIu Amrhclt4VrSXwfHU8pRumCz/TLnrE9I= X-MC-Unique: xnaecXWgP8WovYzFhhvhJg-1 X-Mimecast-MFC-AGG-ID: xnaecXWgP8WovYzFhhvhJg_1769463380 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769463380; x=1770068180; 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=8rL0AQZMo/YY0quRtMt3oVsuGltDVpd+3XkWVPidUEU=; b=ebBhY4IaVt67dpsckxvYd2ZsocfQ1DtOt4xkvjxVMxrhMLQpnJvckgzCKves47vbyO v/QBX3jeM0M3Zb+HqzFURoal3UiYEVMHMLE1XPp6FvcE5joLlpDIWuAZl4jqkn9gV+9r lw0m6Ne87a+KNjTG+uNpwsdwZOZ5t6HC8wKIn0oT9GLGx85B2n2U2LAuxtlfnB7xi576 kQGXO4JCle6MNUh+6yBeTdV6xluArnWMbhH6lfrFEl3Z2eAYOfyfYfVMqop19ZgqG4R9 hvA75GQjhNEGxAI8Bspa8ea7FunsHmr1pEZCLoiTYyVX+BkeF7T4up/j7qqIsPhEo5sE iflw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769463380; x=1770068180; 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=8rL0AQZMo/YY0quRtMt3oVsuGltDVpd+3XkWVPidUEU=; b=oHjBJgc6zLih+OnTFDwZbO4niN+ILuEDkojgK8MF/ygotF6C0PclXDHkSc9JszmAkr r1dTS5Hyx1GYuOtIUy/4xuckqva4IXu97XvFeLkLeYbUA/H0J8ILOjECI+imfx5fQO2T hU3i+UqNO0tGXNVZGA5zkyD03vJH82bzYDJfRS5Uim7Qa4VrdT9zngdYvmR19+oNnJLA Ct/I+0a27vd4mBpt3UuSnn1xeWg9MjlU3NBGhfAVPdeQicQTzRI3CycNKSUHKn8IMs4Z WsimApYqS/hKXwwT+E9nHxbRdjoDQ10uksKtTKrjYrs5zo+f2IqOKsIFMFWuP6xB14os IWwg== X-Gm-Message-State: AOJu0YwChj4N1eYMaS3bpgIYvUV4EUcjR5q/ev7k5OjvQqwuLXvyCRJP /rBfc93ZuQ4iHjjKSbFSGtvNgUZPed03SXZkUxtqQWFq8T2PnAK8g1hCVyYsyo5Xkme0pssT9+h c6VF559YDkmaDrkPgHbDoYOl4Ik2QFtyki6obp4YzFjR8wUJ1LlCoi7z8vVvkY1QAQDb9BtHvka zqr7/ZScabRaz1m+OhGrl7U/hVKjI617w0On5SWQ== X-Gm-Gg: AZuq6aIB+3R66mRODnANBtndg+Jva5Von2RsVI+KFM5NGOoAe7ycuwpLr7bV1q3iTP2 faArQeAsCXi9UJ3YjPb1FfJzopqWm+GjGZEp3j9KU23h9jXJkODAisZ8jF5TgLOB+5BxwEf3V0M KDsPWJHe77NfWu19jYwP5MsEGpq6cOFEwrEX9M1EdkNWLewd3GblAS8VXWWcOXhTHTAxUtPvA87 MowXZ3EKMBWOZ7oDiUs/Azgm2xBFRXLqYHI4oDUXo2nCt80tKY0A6gXChnGDRXrn6noHJek2z7o cn+8Amk1vOhUS+79+AOVKjA1cku1Z90tE2hzkhjvyPAJmYSSqQd/gJoXFWVomXeBvwAyp8RDX+s 0 X-Received: by 2002:a05:622a:110b:b0:4ff:c295:3c3e with SMTP id d75a77b69052e-50314c22e67mr68533731cf.10.1769463379878; Mon, 26 Jan 2026 13:36:19 -0800 (PST) X-Received: by 2002:a05:622a:110b:b0:4ff:c295:3c3e with SMTP id d75a77b69052e-50314c22e67mr68533341cf.10.1769463379382; Mon, 26 Jan 2026 13:36:19 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Prasad Pandit , Stefan Hajnoczi , peterx@redhat.com, Fabiano Rosas , Juraj Marcin Subject: [PATCH v2 1/5] migration: Add a tracepoint for invoking migration notifiers Date: Mon, 26 Jan 2026 16:36:10 -0500 Message-ID: <20260126213614.3815900-2-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260126213614.3815900-1-peterx@redhat.com> References: <20260126213614.3815900-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 client-ip=170.10.129.124; envelope-from=peterx@redhat.com; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1769463424774154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- migration/migration.c | 2 ++ migration/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index b103a82fc0..341b9be80e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1528,6 +1528,8 @@ int migration_call_notifiers(MigrationEventType type,= Error **errp) 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 91d7506634..90629f828f 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 Sat Feb 7 05:49:34 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=1769463422; cv=none; d=zohomail.com; s=zohoarc; b=T8F53b+eJIbAah2WRx25h4qEBEBGJ8i4icXUA3JkjnHwm/zhWnduiJ1YOiud9zgl9KptzrAyJh7EAzZSwZNgJ/uQWEWugQrcqCz4JYN9dFlsVWCW/DM6oOdjiN5NMGLEEWGK9Fbmghc4jsP5c1fltvn7bDTEWR5RwYK2AlqOrAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769463422; 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=etRNZB/RqPeas23lqicq1TZAYZsK5mKaexzj8oDSS3I=; b=JERy2T5NW+ZxJlke0apZHqpcYVSxMDpi73ic1QJBVuEhu5uVsNjIHoDt9CP4uThL1MthjwtN8JHssPp1Iaoygnm8rY6MPEq3l0B8lVpTgQ44AxCFnpRBG6FYwLLpULOyZGqjZCKIbM0QmiraiDGTPsoFSq92QJsGpvLQywJ+ogY= 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 1769463422215344.1983453833103; Mon, 26 Jan 2026 13:37:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkUG6-0003l1-J4; Mon, 26 Jan 2026 16:36:30 -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 1vkUG3-0003iq-7M for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:27 -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 1vkUG1-0003Lt-Eo for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:26 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-223-dc8OTwWVNvy5DBXyVBNw6A-1; Mon, 26 Jan 2026 16:36:22 -0500 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-5013c19b92dso145539301cf.2 for ; Mon, 26 Jan 2026 13:36:22 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502f7f9cd9esm89769281cf.33.2026.01.26.13.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 13:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769463384; 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=etRNZB/RqPeas23lqicq1TZAYZsK5mKaexzj8oDSS3I=; b=JH9+YXGamlgyFTDgF4EMkmoeilQT2ItVGyFvrozuDGmH/ZcS9DEQjnB2KkSQ8YAXMYpJ+i kg9FZjPQ22XWDnIUqo56CCwJ2lw/doXbYJsdhjH5uKpcOZVh+Mg0+LzB1uulLFqwjbqs4G GcAp8iDWKC0T1NkSZAhGT1GeVr/zufA= X-MC-Unique: dc8OTwWVNvy5DBXyVBNw6A-1 X-Mimecast-MFC-AGG-ID: dc8OTwWVNvy5DBXyVBNw6A_1769463382 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769463381; x=1770068181; 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=etRNZB/RqPeas23lqicq1TZAYZsK5mKaexzj8oDSS3I=; b=r46td/hapYjrnFCmqG+3JmqwKsxfVK92zq1PVJq+8/f5fGS0VJuQTrrZ6aMMFob0bG FBLFmPev/unN1oy0pK5CjHCMZH6TEPaku63j1otEUJMloHXNmZoQku27ecs6Y0hfCyT9 JQeQLPjXREJOfU5cvA3QNUOXExcQYIRtRiHSdYIOJOczZQ8LoJCBRcPQq+wREP04mkD6 t4X5Ob056iCeKmu/8kOdkY/BSillu3f8HUxR43JlfMs+dRcdrQ75Bo1jC8A8X0zfFzkf 5TC/BzZCLxDaO1tEP0xS6AlUUdfEy6By5McOgiScqoLHcPgef/am50P1fzTLjhtcU1Ir GEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769463381; x=1770068181; 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=etRNZB/RqPeas23lqicq1TZAYZsK5mKaexzj8oDSS3I=; b=OaafJV2Xt43Y5GUNGpWZLxkneJ0mWnpliVRTY4++SRs+ZbmN3kJcV/ovugEVtfGOSw eIaLHkZyNNhwFyMtLNpWOvEVWW7YoKBoBvk7IKONWg8LLASV+GREHzQfaUudc+GL6mMm bK9CFk832XAiJg6PD2pgO9OyhmlCQ4znCX4TmXbdzMI+DrCABTU/kJfbaPGyWEq3TSQ1 vKIT+U602h4W8/2khI6cskkV01VGE16YRst2GZt6d7X8FLc4jBKrbSBK4vC2EF9MX1wH 11DpqSRMLDC12/bbK/ydHLIP5D1X+r4Pr+13NT7N+C8MHRUwkctQPt4ZPXqPlrH+7BTc FUkQ== X-Gm-Message-State: AOJu0Ywp9GUr1TlORyQh9ypXX8C75gTSjlhEn4Gqpbhp2bkMQFE49rHE QdRr9GHl4iokdN6xvwyzo/NoR9PgJnZSV+eZNrUCkgQsTuz3ahABL78INX4CXAMys1ySXhCVzGv VxwGNrJgWvKyZahwLOspkuAhCaJksHXBMdferiwfMjGayAWiYBcfb5ei4U4uVHo7IE5sNiL6dRD hti6zCTAY2IPQdUFMcItzK9Trzk7nAeMHYOoyvYg== X-Gm-Gg: AZuq6aJMJfysozluq3gHFdiFKgMlN3HaF6vd6q64fPw3rZFeajeb5Uc7TRMOFUYv4Fb n54+N6OL9SitaqmnjsKN/BzuAc/fRjhRt3bifWS8ytN8J5utGdbsrFYp+IHltQOq2VwqlSJ28iz fycEI+e76yfp0L4rnMyNPQUBcPEkwmEPaMYwSWIqaj6YftyonzWq6lE8bX5E0AHkOnPYLlg3J2/ 9dRF3HUpALwcuGbbys1wp9V0n0JA745TuP/7E1ietT55ntpDDyqLTdITbqVN2ocOerNY2fBJ8Ks L4NWFolTmc4Dh5u3GKaC71oy6mA+pZVOslxmdD+ZakXHQMqdyl/FVIQwN8on4uukIrxxKuqIZZa 8 X-Received: by 2002:a05:622a:d4:b0:4f0:24e2:8de6 with SMTP id d75a77b69052e-50314c9379dmr79323921cf.64.1769463381541; Mon, 26 Jan 2026 13:36:21 -0800 (PST) X-Received: by 2002:a05:622a:d4:b0:4f0:24e2:8de6 with SMTP id d75a77b69052e-50314c9379dmr79323431cf.64.1769463380984; Mon, 26 Jan 2026 13:36:20 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Prasad Pandit , Stefan Hajnoczi , peterx@redhat.com, Fabiano Rosas , Juraj Marcin , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Dr. David Alan Gilbert" Subject: [PATCH v2 2/5] migration: Fix double notification of DONE/FAIL for postcopy Date: Mon, 26 Jan 2026 16:36:11 -0500 Message-ID: <20260126213614.3815900-3-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260126213614.3815900-1-peterx@redhat.com> References: <20260126213614.3815900-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 client-ip=170.10.129.124; envelope-from=peterx@redhat.com; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1769463425942158500 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. When at this, update the notifier transition graph in the comment, and move it from migration_add_notifier() to be closer to where the enum is defined. 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 Reviewed-by: Fabiano Rosas --- include/migration/misc.h | 16 ++++++++++++---- migration/migration.c | 3 +-- ui/spice-core.c | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e26d418a6e..1cd6cfd7f7 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -59,10 +59,22 @@ void migration_shutdown(void); bool migration_is_running(void); bool migration_thread_is_self(void); =20 +/* + * Notifiers may receive events in any of the following orders: + * + * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] + * -> MIG_EVENT_PRECOPY_DONE + * + * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] + * -> MIG_EVENT_PRECOPY_FAILED + * + * - MIG_EVENT_PRECOPY_FAILED + */ typedef enum MigrationEventType { MIG_EVENT_PRECOPY_SETUP, MIG_EVENT_PRECOPY_DONE, MIG_EVENT_PRECOPY_FAILED, + MIG_EVENT_POSTCOPY_START, MIG_EVENT_MAX } MigrationEventType; =20 @@ -81,10 +93,6 @@ typedef int (*MigrationNotifyFunc)(NotifierWithReturn *n= otify, /* * 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 */ void migration_add_notifier(NotifierWithReturn *notify, MigrationNotifyFunc func); diff --git a/migration/migration.c b/migration/migration.c index 341b9be80e..bd24006c1a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2591,7 +2591,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(MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(MIG_EVENT_POSTCOPY_START, NULL); =20 migration_downtime_end(ms); =20 @@ -2640,7 +2640,6 @@ fail: migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); } migration_block_activate(NULL); - migration_call_notifiers(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 Sat Feb 7 05:49:34 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=1769463472; cv=none; d=zohomail.com; s=zohoarc; b=gTeHBJPBLIg/0z+4ZrBXFA8ofIzyVkbZgVAb89rKp2HC2pKFKFcgn59KGOWdDDZ451YPbYFlbsW/vFBlnrFRx4y72+CWqv297MM1nf0bljmX3iRLXU73AB3GXT9d5RV4mXi+hJCL/nBdWqYPWPCqKkqfsX0Z2JREH5+SE4M8ado= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769463472; 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=cRHZgxbr0wPoDbo/Jl1zs6PXyi4flpY3KByUtN/i888=; b=UJTEJgBRZWiwno8mgB8ZFlMtyIU2wOIDLwbiJM8Uhi/sZFTuvJJSf0FHedR1zPoJqH9uUQL3kXxrweWYqelq1TOR3tMQPM0FHeDi31R7DZkgceVx+BMMHwnJhJE3AGemETyQXiUu5TUnw47a1dwqcTobo6R6qNY17XQGdwvCC9Q= 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 176946347284174.5091834827997; Mon, 26 Jan 2026 13:37:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkUG8-0003pe-3F; Mon, 26 Jan 2026 16:36:32 -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 1vkUG4-0003k9-OS for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:29 -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 1vkUG3-0003MH-6n for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:28 -0500 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-ihSK-VXmOgGY5ZrFTtINcA-1; Mon, 26 Jan 2026 16:36:23 -0500 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-5013c19b92dso145539651cf.2 for ; Mon, 26 Jan 2026 13:36:23 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502f7f9cd9esm89769281cf.33.2026.01.26.13.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 13:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769463386; 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=cRHZgxbr0wPoDbo/Jl1zs6PXyi4flpY3KByUtN/i888=; b=jUlmjqVCneoPPxOiePNpYOt8x+ZVTldS24wlr77gPCTTx8BV9bAWXbpwnQlztFqcQ514kn aPDhSqcifByn1+rJSODk/gHSZOifC7pt92oUVQuem0kYQS5sP6Xi8981civniNT5dJGc1A nzq8KmWum2whxZtbk20MzB+rzC2iX84= X-MC-Unique: ihSK-VXmOgGY5ZrFTtINcA-1 X-Mimecast-MFC-AGG-ID: ihSK-VXmOgGY5ZrFTtINcA_1769463383 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769463383; x=1770068183; 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=cRHZgxbr0wPoDbo/Jl1zs6PXyi4flpY3KByUtN/i888=; b=Txrek7Na3HuoF0IVXMxMNHhQwaClW0PuaMZ4vldqT5G9YpwZq/6UFV6FWHjV9TSdSL 8EV3KJuqKLenwEUCAYw/mWiuEQj7qzvc0QKD+KmJiY7G/1FmnY46s2xApOebL/zhGjHo 1RYEwR7WvCB4iEYdPOJwwAq+kUtoH3JSU0kptkGSqwtSyFp9CA9vD2dYENt4Ds5teGKr Q0edgSr1qbpTptOG7dNjbAH0neAL8X897C+QHB/EQ72A+EesGGYjiI34H5zSmA3Dtglo ilL9j2BVODNkgtl8bZXOtlv9jkeZaSJWNHHZ0rNwGn/nOubvF9fbrbIzJbq2mkp07MvH RMfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769463383; x=1770068183; 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=cRHZgxbr0wPoDbo/Jl1zs6PXyi4flpY3KByUtN/i888=; b=XIe6OLTIUKG7g1P9ui245rM3VpH/aQV21t/oNaQBqKXyHeiT8REPL0LtGIPqN1Troe 2+sNhDd0v2ubD26w/8I/0/ryziZM4g+TAefeprpEP//PRqEPZN383KA2i803K9wsWs7r OPKlgncgFwHU25wUsTo2b8HqeqUPi4sGGgcY4yerC9iCUjzmc90MMAV/OOglCIb1UbOj 5UJQe4ZO54/YIK6inhzu5YoDNZvJObD/QfA9Io9OXLLMK7CTIaPcaoXpioEeLzAG1ffg ZpvHjPQzFUXWzczfDWMjhBDCt3fS4EWdrO8zPWwv6IGWgQre1S83IRv012w9sS+c/8J2 F7Uw== X-Gm-Message-State: AOJu0YyO3tB2xGigS5+NC2QnrWVrXx1c/o/eR94vqRXVyXXGi2q3IUDa xOWyGSx1VjVqWgbF7bf49Ak3BC48spOH/+eHR/4f0dHpBxlhU9KuHL745nmqSaMDLO7RX/7OtWI lyCKk8cqOJZrZaEq7y0xgjIBAnAGYlAMu0SBSMHLulGWI4oHpydt6QZQzuBsLInAieba2ZOTeYt sTllgfZzUjB9CRIpE/k/j3a6DHExG6vF6IRtGNcQ== X-Gm-Gg: AZuq6aItzkhPBjnGta2jTVaL1kf/KJMbFuDneh3+Whhd1qhZ9urFSxHklVnnA3suLcm ACADISAtaWOEULcHHHD3cnLPuIiYrRxj3YF66xwApA5fTz6L/Zd6AtceDrsbIdsB2binr6+JVRF 4tjBK+MSp/SVTBc2XBZcqZBNaIoKZhtuIZR1XGYgghcRCvr6+7xuc3KqaAibiQAONEi7e+eS57q ZoXO4puOGEP7hYgfF7MYTOox+6Oiy+Kg1xrGzFPuNaiBpUKnrVDvr5ohY/xq8rLFW/yKdQdIwfZ DO+rlzUoI4yUcwBm8EQCA//OX4sF/oNRRgUWYkrrtRhIxmVN5iwmzTOzPKykkNpNfwtfiejCYPb o X-Received: by 2002:a05:622a:107:b0:501:489d:f405 with SMTP id d75a77b69052e-50314bcfbd2mr65576181cf.30.1769463382718; Mon, 26 Jan 2026 13:36:22 -0800 (PST) X-Received: by 2002:a05:622a:107:b0:501:489d:f405 with SMTP id d75a77b69052e-50314bcfbd2mr65575911cf.30.1769463382127; Mon, 26 Jan 2026 13:36:22 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Prasad Pandit , Stefan Hajnoczi , peterx@redhat.com, Fabiano Rosas , Juraj Marcin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 3/5] migration: Notify migration FAILED before starting VM Date: Mon, 26 Jan 2026 16:36:12 -0500 Message-ID: <20260126213614.3815900-4-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260126213614.3815900-1-peterx@redhat.com> References: <20260126213614.3815900-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 client-ip=170.10.129.124; envelope-from=peterx@redhat.com; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1769463475427154100 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 Acked-by: Stefan Hajnoczi Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/migration.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bd24006c1a..8d1c294b47 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1283,7 +1283,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(); @@ -1333,9 +1332,14 @@ static void migration_cleanup(MigrationState *s) MIGRATION_STATUS_CANCELLED); } =20 - type =3D migration_has_failed(s) ? MIG_EVENT_PRECOPY_FAILED : - MIG_EVENT_PRECOPY_DONE; - migration_call_notifiers(type, NULL); + /* + * FAILED notification should have already happened. Notify DONE if + * migration completed successfully. + */ + if (!migration_has_failed(s)) { + migration_call_notifiers(MIG_EVENT_PRECOPY_DONE, NULL); + } + yank_unregister_instance(MIGRATION_YANK_INSTANCE); } =20 @@ -3323,6 +3327,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(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 Sat Feb 7 05:49:34 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=1769463452; cv=none; d=zohomail.com; s=zohoarc; b=Us7DGj/3mO9JhsB8VZge4uv0ufVKPqPQIa5aKOgZxpcX1cK1rYaIeUZQt/KpfeYlfZUkNZSmh1Y1skESbFJTNfaQsFNvwvIZveezsl5XFJZvX1bhwcFm2fAuPE1DKkAX485N0fkVByTG9CcqcXLPqBkqCbfMKKYBwIpfEbuIGig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769463452; 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=wjvmilWuHa/g+TZvKS56qSu8dynrYCrt9ztlOJrDTaM=; b=X+6uHQmtws9K76EBurCmQqWYLuyyxEx30LmP2qbkiyXTlPmZq8OamZ+Z4D4BVSCZOkLtISkXj3KfvK5xnTdo8GSAKytpSkmbEp8YzvQQ/NF9YOEK2PaG6XD7FNXkVuEoWAYS5e6cEqkWTC8iLxQBw90ml7VjCup8NdX6uF927kA= 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 1769463452796862.5415803054266; Mon, 26 Jan 2026 13:37:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkUG7-0003ol-DA; Mon, 26 Jan 2026 16:36:31 -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 1vkUG5-0003kG-CS for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:29 -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 1vkUG3-0003Md-VP for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:29 -0500 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-MAaU1zW_OWiLgAcR7aC1uA-1; Mon, 26 Jan 2026 16:36:25 -0500 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-5014936958cso186003351cf.2 for ; Mon, 26 Jan 2026 13:36:24 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502f7f9cd9esm89769281cf.33.2026.01.26.13.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 13:36:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769463387; 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=wjvmilWuHa/g+TZvKS56qSu8dynrYCrt9ztlOJrDTaM=; b=DA3D7fwzfuVFmzPcMMS/BAB/YK7mKu33VgVY+XzzH/cpiqCZBCPQ1BChVdc4Octc4mP2qU sKt1Jk2LNfFiQbz3Nv/yZRKfvuKK9C62ce+eVUsZrGpJDxz5fU7X8Y841qcVhSG4s86ZIH r0ZjfjLPmc6rlJtf0uO80e1x9E7BmLY= X-MC-Unique: MAaU1zW_OWiLgAcR7aC1uA-1 X-Mimecast-MFC-AGG-ID: MAaU1zW_OWiLgAcR7aC1uA_1769463384 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769463383; x=1770068183; 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=wjvmilWuHa/g+TZvKS56qSu8dynrYCrt9ztlOJrDTaM=; b=ALGZhOWjbyF/HpiQQ7ar/1qQPeMTKzFOV8SdkuG8fWCVffPTlWbnzpV55WQsGZhQ9/ dgC4ETN5mTW58yS1Q5veZWvVbAcI/sk9i51V2Yk4T7d5aqHJvmnVqk31PVNqaj17e2n1 ce1cNnCqLtGbMk2vjn+M1yD/ovcSnZE2D6DK320xVJqpXmw3XZ5JL9O3qDhtc5iEq0W4 Di5ACYJ71Gn8McLq9bOyVT4O7dKSv4+Z5c/M5XrY2A/zYcTmV2x6/NkQKB0/XVJ2ikRg AdXe7BzmsowCCWufj2QXwy0ryOm68E3Tl04mI6iRFIWrLPDVO1ctJMbGAfu/zFCIG8kf 5Dfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769463383; x=1770068183; 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=wjvmilWuHa/g+TZvKS56qSu8dynrYCrt9ztlOJrDTaM=; b=uDeo2dBZH9aRsRgyRQPHiOIcD9AfgOeUmvgLyUiY5FWlM036Ly/SBOJk3nhCWi2XVq j0kdcpbynfT14fCSMr1zdSulNOHkmK3QOyNp4407ptJwkw3l1UO3caHUGUsNXdRl2QZM aDtXtgMrbr7++AEs0aPdRm+gfSdAkJynaayjPuLVeUHJilUD+oIeDs4uNyZr6cDCQe0Z xX5R6kU7D4GXGB120UHGp40Uu4/vrNs/VKF6dh/ZbkvhX0SSlwZmcY/5wW1Scl+rb8I6 GA/ZbHefCnnylrH0f9AGi5+urUnCDv+HILnmhoUUnYr1Eh+F3STo/WizWSCokRQelF5l rfVw== X-Gm-Message-State: AOJu0YyIPqE9gQPls8L0LGJE9mpUNPvSwrfwrqFnLf2ZA07X1q4JC8M0 2bxlgmPDeSIb+87gk6/Co39MhV/NEZu/wV3G/uDNIeaS8lijP4Lli2PTcaXtyXu0Vb+wYuGOSlz rvwN542kXclcLL3Dyx7sZm8bjBU4mTzap77EbdoG3oc2K/sF8+jBkPrgd0+1U03Kg/bPgnXz2in zVdKKmCUyg7QLCIPnV2KgTvgdLr+/kxdoYxnfu2A== X-Gm-Gg: AZuq6aJ78NotwGC7SrFT+WjwfSzisA1xWJbO5JEGPgHjr+06ZfW/F/OL7H2PnqD6tOV n/gFWQ/zb4OQvTAzyz1aYsUMidjDxRZL8BdBjyk5iBq7Otx6QnAfMDG9Dlt3djx4/zASCzCf96i LjYjBD+6mNCrHq/a0d3KgR9mV/lRwC+AlFRSgkJGFwj4FjcRlE8uk8w4vbqn/0ddPqcI/H0yLP8 /mg6e8Dz11EBjw3y3UIlkS7lrHRE5fyGlb4Ht0KFc27/r3+KKaLu2lmNDPMte9Cf6/0h8kvlj3g Q1wPC7YqkfRI3OWpm43thOT0Th2a3GeXmk8eukiU5o8utSDviqCdkHRXM8fL1dx+ksrkDAzsHKt I X-Received: by 2002:ac8:7fd4:0:b0:502:9f0c:79f2 with SMTP id d75a77b69052e-50314c690b7mr75949151cf.44.1769463383446; Mon, 26 Jan 2026 13:36:23 -0800 (PST) X-Received: by 2002:ac8:7fd4:0:b0:502:9f0c:79f2 with SMTP id d75a77b69052e-50314c690b7mr75948871cf.44.1769463383044; Mon, 26 Jan 2026 13:36:23 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Prasad Pandit , Stefan Hajnoczi , peterx@redhat.com, Fabiano Rosas , Juraj Marcin Subject: [PATCH v2 4/5] migration: Drop explicit block activation in postcopy fail path Date: Mon, 26 Jan 2026 16:36:13 -0500 Message-ID: <20260126213614.3815900-5-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260126213614.3815900-1-peterx@redhat.com> References: <20260126213614.3815900-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 client-ip=170.10.133.124; envelope-from=peterx@redhat.com; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1769463454813158500 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. Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- migration/migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 8d1c294b47..a5b0561cbe 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2643,7 +2643,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 Sat Feb 7 05:49:34 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=1769463994; cv=none; d=zohomail.com; s=zohoarc; b=bDkRNVtU0d/rb4Yk1oQ8wmTT+unS5yfNuck4FU7mzMeQ+2MLsjToB1B2R1/dH/3YsS1jf0Dx0cPBnsPLWveDm8Y3xe3NicDRGMOoy7wP2nFKFJgCE200BmrB+s5CnFATTCRwCqb2PBKhkRtTKhd1GmzUgiu/T/e0zhIW++QA7kA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769463994; 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=eZsH9FitHIES6sa1xE0K6RU7GHKSAzNerQxPCHFO/t8=; b=MhlfkEQ+B2E1hmIQatCHZxtgpbI0g/3v0fohZsm6wxsLa4+/fazKr9jhs/AgpyLO5HZX7l/YVg6T+IcUPFYYuEdd3ciLWZ4IJgj88SF6OxBkPNl95GZSoG1BW04qAsc4ayeR3rkT76AVf9omUQARI/i4jxY/RrHRRLxdZzr14ls= 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 1769463994879226.49903412281378; Mon, 26 Jan 2026 13:46:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkUGA-0003tB-Sk; Mon, 26 Jan 2026 16:36:34 -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 1vkUG6-0003lC-JB for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:30 -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 1vkUG4-0003Mj-F0 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 16:36:30 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-zFjdUfJmOk226zm-jHJv7Q-1; Mon, 26 Jan 2026 16:36:26 -0500 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-502a341e108so156959431cf.1 for ; Mon, 26 Jan 2026 13:36:26 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502f7f9cd9esm89769281cf.33.2026.01.26.13.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 13:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769463387; 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=eZsH9FitHIES6sa1xE0K6RU7GHKSAzNerQxPCHFO/t8=; b=Vn7dYWB3I9w1JIHSgtgDeyyr6Vhh+ei+LLxf3ElgZe1ysTj14B9bp15hWSdqB5yKgeotq7 r6h5i33nk0Bk7+127b74WH5MgRuksBqB7pzRwCRNFEeenss3pu8savDnNPX6ZnrPapvIdV oT48AoPS7bd9o9e+xwiIFY0FZZk+kEc= X-MC-Unique: zFjdUfJmOk226zm-jHJv7Q-1 X-Mimecast-MFC-AGG-ID: zFjdUfJmOk226zm-jHJv7Q_1769463386 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769463385; x=1770068185; 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=eZsH9FitHIES6sa1xE0K6RU7GHKSAzNerQxPCHFO/t8=; b=Nuy7StluGo12REfMfMcB0yWSrZFV07+TLaiM9h1fjA1lmcHC+QzLZhET73eUFUS4xi NA1zm2hs7dULlfA1LWFLTCqvArdF9JTAiKfi1dsq+RTvz92FmY9rcLyY1INjXik1bbgZ Fjm0kLoIpx0Lj3RBi/TGOC5GN2bJVewjlie7efvc2uG2wdyLnzaQLq805U02fihNUk3x ebu+2va9AVH1rCsj10oQGF2EEye69ZJJAFk0I2ToxDYQOb9jvjH66KWFb6khGTMK35Ct W0b+5NJja67pjZ8P0Pc/YaNqFZfcaD7kXYU4isN6rK1eBac6R2FdGjq4c1lnYH4uM/sO q0bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769463385; x=1770068185; 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=eZsH9FitHIES6sa1xE0K6RU7GHKSAzNerQxPCHFO/t8=; b=jnjS+IdkvLCLhsWAklal5A0Xbw48jdPdidlXxVw9bVrwkn3OXqI8DfCw+mI+kuo/FK 4rWDAnn6CLm0IQGR3T+kTqTTvMgcI7XrgoEkp11PshJwbfI/Yl/6Xj5f0MM/S6e5+6FN Q6zRU69CUVx/vNAeGau9qVMiN2AkySfIlRBiPah+XmuJVHtpnQzRzvyipIRyvhEzewRU kVlohhajOaXG+aj+UsWjI8irEz3yUi4MlhztKrH+zHx6e5KoQo3ICm8AAiExWLb4Weyl Mjq0/MW2Fb0wZ0N52tTLunM0g+DG4pn10spY620c6J2woglZr7N+o0mIXnlk8EmJmOzH +SXw== X-Gm-Message-State: AOJu0YzPcbE5WSywV2CGotLopFzJQB5LlgFTZ6/I8b5Wab4HyS8HqeRE HCataMAmaxU/CPG/4koC18LXCYumLanya/H/GTtqz4cy88IomfwtIf0IBL/sl+k44WLPjefboA1 jw0xWwT+Dxw8f5wl8teAnKi8j+7/sp9J6zJaTlZ6tWm+DKbB2MHbYikYqWIg6j5fuwMiTtB1EO/ ZRcowxB06IWumyiBqe/l4vuP9aLN0C2eLqnC+Wug== X-Gm-Gg: AZuq6aLo3vo29z0LAcLHuG8J5KCpaOKh4xMxhurnxSetEiAcLPyEPtiIwWAfpsrz/Fb AM/R7+hqXB1qR4PKBsYra33EzwqvCTWMgKnobC3gFj/4xzWJm0QPLZD7aECA9OTqi/ommRiU9R/ jWxzMJPOg+7M9zUV8FlDkCkWxnYzsm7xw6BMLUgrBmxaoSw52izppzQMXxt560XQbEs6QUQp+Ku ld0tX8mChMsZO4gATX8fGXk3veC5jh6noQivWFqlS8FDHvat/c4QktR6lFvRApFhEc7u+8jQmJz cK8Yv6hiLR4kS6iIZMHcjGPXV0g64JVAd44nB4GFCkElenVeLhLljOHvCZJGaGlz0hejs/6xaS1 x X-Received: by 2002:a05:622a:1102:b0:4ed:6b27:1d1a with SMTP id d75a77b69052e-50314be8cdemr83592211cf.32.1769463385342; Mon, 26 Jan 2026 13:36:25 -0800 (PST) X-Received: by 2002:a05:622a:1102:b0:4ed:6b27:1d1a with SMTP id d75a77b69052e-50314be8cdemr83591751cf.32.1769463384885; Mon, 26 Jan 2026 13:36:24 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Prasad Pandit , Stefan Hajnoczi , peterx@redhat.com, Fabiano Rosas , Juraj Marcin Subject: [PATCH v2 5/5] migration: Rename MIG_EVENT_PRECOPY_* to MIG_EVENT_* Date: Mon, 26 Jan 2026 16:36:14 -0500 Message-ID: <20260126213614.3815900-6-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260126213614.3815900-1-peterx@redhat.com> References: <20260126213614.3815900-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 client-ip=170.10.129.124; envelope-from=peterx@redhat.com; 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, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1769463997422158500 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. Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- include/migration/misc.h | 18 +++++++----------- 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(+), 33 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 1cd6cfd7f7..3159a5e53c 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -62,19 +62,15 @@ bool migration_thread_is_self(void); /* * Notifiers may receive events in any of the following orders: * - * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] - * -> MIG_EVENT_PRECOPY_DONE - * - * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] - * -> MIG_EVENT_PRECOPY_FAILED - * - * - MIG_EVENT_PRECOPY_FAILED + * - MIG_EVENT_SETUP [-> MIG_EVENT_POSTCOPY_START] -> MIG_EVENT_DONE + * - MIG_EVENT_SETUP [-> MIG_EVENT_POSTCOPY_START] -> MIG_EVENT_FAILED + * - MIG_EVENT_FAILED */ 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 @@ -84,7 +80,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, 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 e315a30f92..daa50916d2 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(MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(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 a5b0561cbe..7ab0294d22 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1337,7 +1337,7 @@ static void migration_cleanup(MigrationState *s) * migration completed successfully. */ if (!migration_has_failed(s)) { - migration_call_notifiers(MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(MIG_EVENT_DONE, NULL); } =20 yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1541,7 +1541,7 @@ int migration_call_notifiers(MigrationEventType type,= Error **errp) 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; } } @@ -3331,7 +3331,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(MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(MIG_EVENT_FAILED, NULL); =20 if (runstate_is_live(s->vm_old_state)) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { @@ -3769,7 +3769,7 @@ void migration_start_outgoing(MigrationState *s) rate_limit =3D migrate_max_bandwidth(); =20 /* Notify before starting migration thread */ - if (migration_call_notifiers(MIG_EVENT_PRECOPY_SETUP, &local_err))= { + if (migration_call_notifiers(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