From nobody Fri Dec 12 14:07:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1765274270; cv=none; d=zohomail.com; s=zohoarc; b=T1xpq901rrQBEgvlrP85r4HMLZjgVafuiybrxhQJqu3g6r0mT/olkPSSKrJBuvhIOxFVssqQulfiWLPSzck0KJiD0ncF4i9ynMBCvYSdzLsQQJ/Y3m3VbCpWHgbnWJMw2i0/o8+CGIYaK0aOX7jUD9foB73ZUmfbV2liUSyL26k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765274270; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=mDGC8vRzktcKdGpXnYye2fWHsfX7YhgKMR0CfMBJIWI=; b=KWJjJpMQM5evUQ7e0Bfh1r2oGTNgt3nKzTMxVpc1Rsm06xyER+9fZ3WDAMlGH9SK9PpYw2h3DqVq3D0fZi5WEB+44l/tA/pn7TKVhxVoAFH3NIXkTxKQRnwMkfWBqV8axHhyia3QoE+K7NUGIi/mwJ4lJEO84IbBJ8qy3Jl0eEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1765274270233344.4230509886668; Tue, 9 Dec 2025 01:57:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3B47B4191E; Tue, 9 Dec 2025 04:57:37 -0500 (EST) Received: from [172.19.199.80] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0A0C6442A1; Tue, 9 Dec 2025 04:49:02 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 1565243DEA; Tue, 9 Dec 2025 04:46:52 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AC59443E5E for ; Tue, 9 Dec 2025 04:46:26 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-ifFkJ1ZYMJOlCFoGbZVoYA-1; Tue, 09 Dec 2025 04:46:14 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DA81319560B2 for ; Tue, 9 Dec 2025 09:46:13 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A76D1956095 for ; Tue, 9 Dec 2025 09:46:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765273586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mDGC8vRzktcKdGpXnYye2fWHsfX7YhgKMR0CfMBJIWI=; b=QgNS/2Gw74fCEKGkaQ7XDV9Fw6MzkdaWV+dmbeEIzLns2xCnB4NI+WliMCPU6ogSApzjmc L+sR1kl/yOWDi8mvXFs1tUCSFf5Aoxj1NlFM05SpJ+n9Cs8Rn9ig/Ga/oD4RSLydc0DvMA VmdS9u1rcFupewzcyMyehMd6d/l8/EI= X-MC-Unique: ifFkJ1ZYMJOlCFoGbZVoYA-1 X-Mimecast-MFC-AGG-ID: ifFkJ1ZYMJOlCFoGbZVoYA_1765273574 To: devel@lists.libvirt.org Subject: [PATCH 2/9] qemu: snapshot: Setup disks for manual snapshot only when the VM is actually paused Date: Tue, 9 Dec 2025 10:46:02 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Invern8Pt-F3s_dj42_PHWPxMqx5r5nOBFas-agMt3o_1765273574 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CVBKPZVHJ7PIZWWYPL2PAUWLNJ6AUYSX X-Message-ID-Hash: CVBKPZVHJ7PIZWWYPL2PAUWLNJ6AUYSX X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1765274270856158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When creating a snapshot with 'VIR_DOMAIN_SNAPSHOT_CREATE_LIVE' the VM is paused only after dumping the memory state. This means that also the steps to do a 'manual' disk snapshot (deactivation of the block nodes in qemu) must happen only once the VM is paused. Move the manual snapshot setup code after the memory snapshot code. Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 302775af92..bf25c70826 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1707,10 +1707,6 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, } } - if (has_manual && - qemuSnapshotCreateActiveExternalDisksManual(vm, snap, VIR_ASYNC_JO= B_SNAPSHOT) < 0) - goto cleanup; - /* We need to collect reply from 'query-named-block-nodes' prior to the * migration step as qemu deactivates bitmaps after migration so the r= esult * would be wrong */ @@ -1769,6 +1765,10 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, /* the domain is now paused if a memory snapshot was requested */ + if (has_manual && + qemuSnapshotCreateActiveExternalDisksManual(vm, snap, VIR_ASYNC_JO= B_SNAPSHOT) < 0) + goto cleanup; + if ((ret =3D qemuSnapshotCreateActiveExternalDisks(vm, snap, blockNamedNodeData, f= lags, VIR_ASYNC_JOB_SNAPSHO= T)) < 0) --=20 2.52.0