From nobody Tue Nov 26 05:57:33 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1710194423; cv=none; d=zohomail.com; s=zohoarc; b=eC0SGBoOEa6zgxucNJO+cL56IUMS9GpD8yUk/Kgw9xc3o7YKlS/w5yNvA039kKSQHCwxK/7Wqpn27lsGQT9a/jp454390IzHdwaau2WC9cCcyUrT06rC6cJlVOPSQGIFOp30EqFyc6fC0tuzndtb47r49hKmOO/B8z40fardEo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710194423; 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=qc0i8BnW6Y7BuHtVVuKYvIGbeCP0Ayl8x1jn5Sm+WgI=; b=JHA2O55Um1fQ5/21MgkGLgE5p1nB6z5Yaeh9+u0CbxGncr4IEskGHUm78v+0j36Zh8fKen2gB5lPKI0XKGBMIIYxgizteyBeM41piVZCh0ylVtqpUR88HPfRaWH0QaZdUtzVpz5tvbsFifZuC/EyWUBc1VssdfDen10RLdVkvxQ= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171019442351197.49718715922256; Mon, 11 Mar 2024 15:00:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjngQ-0000IW-Us; Mon, 11 Mar 2024 17:59:46 -0400 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 1rjngN-0000GJ-UI for qemu-devel@nongnu.org; Mon, 11 Mar 2024 17:59:43 -0400 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 1rjngL-0003z0-Pc for qemu-devel@nongnu.org; Mon, 11 Mar 2024 17:59:43 -0400 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-h9wBVvsBOn-BbcloWah00Q-1; Mon, 11 Mar 2024 17:59:39 -0400 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6818b8cb840so15026886d6.1 for ; Mon, 11 Mar 2024 14:59:39 -0700 (PDT) Received: from x1n.. (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id d6-20020a0ce446000000b00690cec16254sm1541932qvm.68.2024.03.11.14.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 14:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710194381; 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=qc0i8BnW6Y7BuHtVVuKYvIGbeCP0Ayl8x1jn5Sm+WgI=; b=GkCnBHnj4lkH300jLClTKDkSWnxOTKzr0JH7TRYYVkcH4AbL30Y2i57vqR3kpeKo5rdgT0 gRgRKCb/MQ0RLH5zwXk+imRRnomdDjCtM3wK4gptK/hMpKE6dTkFTXk5e4YDChuRqYK82Z EtNqxfWj6+YQzGG7FmrmLNPjv95UyHM= X-MC-Unique: h9wBVvsBOn-BbcloWah00Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710194379; x=1710799179; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qc0i8BnW6Y7BuHtVVuKYvIGbeCP0Ayl8x1jn5Sm+WgI=; b=OavWQh9fO3HKYiejE6iDsNy71tvxasmFOz0yvXopX3ra/wpGyb74eRCBLDuGlP5jSF z/lFBg8f0llA+yUP58g2tAgbPSr7B5ARWz0UW3h7qlKUHveJT6BjC/+x6b1QrCOS7JNT ImSzXkHIfxIW38AykLnAk7prlHgPzfghtb6p7tiqJncY6e8eAcdG9pGurNRSySoc8ojs GMJnv/oeEc/9AjWPRxlSEpkNjZymBIVazcjohAhU87tiAbPMurcFIOY4EaP7MwiVwP5O vrLsbluyPDgi3FvCYoDo4M97i1ZJwC5fwzZ6iMYlRSyQKZsjID/+tuZhR4B62EIAO3r/ vvZw== X-Gm-Message-State: AOJu0YxO2eU6514lQqtePbO15slaXoIElbsGLYo0OrC+rIWYawpHZLOE PUet13YBQdk6PqzBFcJiIbhbIjbDzInS6bVeiwXT/9imr7XEmgrG4UX8KpJr/11/+Tu2wbQVxCc AYFH9f6DugtTrt/qZdhWfo7ac/pvA8BuEekETAKjdb87VwCaFY6OBIr+Rz6aQZNxIE0AA5WYQup 5I8Odi/HDUZVe/0IQUmfrkMQEBTiaKgdiGOA== X-Received: by 2002:a05:6214:b6a:b0:690:ca31:f070 with SMTP id ey10-20020a0562140b6a00b00690ca31f070mr5305224qvb.2.1710194379066; Mon, 11 Mar 2024 14:59:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOcDHtuVt2rJwLQXQNhTd4XDalzwWJL/qsute3enz3Sd6W1EkaaNsnBWPX7ewIFEZyhdeKEw== X-Received: by 2002:a05:6214:b6a:b0:690:ca31:f070 with SMTP id ey10-20020a0562140b6a00b00690ca31f070mr5305201qvb.2.1710194378502; Mon, 11 Mar 2024 14:59:38 -0700 (PDT) From: peterx@redhat.com To: qemu-devel@nongnu.org, Peter Maydell Cc: Paolo Bonzini , peterx@redhat.com, Fabiano Rosas , David Hildenbrand , Prasad Pandit , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 08/34] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error Date: Mon, 11 Mar 2024 17:58:59 -0400 Message-ID: <20240311215925.40618-9-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240311215925.40618-1-peterx@redhat.com> References: <20240311215925.40618-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: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.029, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1710194424390100002 From: C=C3=A9dric Le Goater When commit bd2270608fa0 ("migration/ram.c: add a notifier chain for precopy") added PRECOPY_NOTIFY_SETUP notifiers at the end of qemu_savevm_state_setup(), it didn't take into account a possible error in the loop calling vmstate_save() or .save_setup() handlers. Check ret value before calling the notifiers. Reviewed-by: Peter Xu Signed-off-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/r/20240304122844.1888308-10-clg@redhat.com Signed-off-by: Peter Xu --- migration/savevm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index e84b26e1c8..76b57a9888 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1317,7 +1317,7 @@ void qemu_savevm_state_setup(QEMUFile *f) MigrationState *ms =3D migrate_get_current(); SaveStateEntry *se; Error *local_err =3D NULL; - int ret; + int ret =3D 0; =20 json_writer_int64(ms->vmdesc, "page_size", qemu_target_page_size()); json_writer_start_array(ms->vmdesc, "devices"); @@ -1351,6 +1351,10 @@ void qemu_savevm_state_setup(QEMUFile *f) } } =20 + if (ret) { + return; + } + if (precopy_notify(PRECOPY_NOTIFY_SETUP, &local_err)) { error_report_err(local_err); } --=20 2.44.0