From nobody Fri Dec 12 14:08:55 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=1765363686; cv=none; d=zohomail.com; s=zohoarc; b=B2sa5goOgHZ5EVv83QhG8C7vqbtpXt6ogfulcI4omDkzFD9s5IBKcyrCTCi3kgVhtAJGdhXgLmqOHXCBC7yIRgMFpU0AwQGTEpW1XLYl05oU4j0EtffnbKmP4b5HoqxrrWzSYweYaT49Zmz2L02dh15kuTseypE/UYS3gV/uTL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765363686; 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=ISm3syNoMY+HWa6NUED8Ci2n7Q8tGVYKHDgSneT3Cjc=; b=iDWarPDpHyZUiWHYhXee7cYpVZ6FJy6UptjgwYdkmzrjFW3Hg6wD9Hz/iDwYFSmWnaw+G/QjrOh6GcmOz8wYr5VFYcTLqZAClufgsr+P3Mj8P8c+mNf1Qkqhi5S2vKOL6ulIZcZJ5yEMX9w6P11c8o0O78osIJySDqRU57Pg5jc= 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 1765363686158631.7316732526265; Wed, 10 Dec 2025 02:48:06 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 27D3C3FB01; Wed, 10 Dec 2025 05:47:59 -0500 (EST) Received: from [172.19.199.80] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0E39643F0F; Wed, 10 Dec 2025 05:40:56 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 27A2741B32; Wed, 10 Dec 2025 05:32:47 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 8EF1F41B41 for ; Wed, 10 Dec 2025 05:32:46 -0500 (EST) Received: from mx-prod-mc-03.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-462-cFU-_59tOy-G3ys3P-TTrA-1; Wed, 10 Dec 2025 05:32:44 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1FB1A1956058 for ; Wed, 10 Dec 2025 10:32:44 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4955930001B9 for ; Wed, 10 Dec 2025 10:32:43 +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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765362766; 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=ISm3syNoMY+HWa6NUED8Ci2n7Q8tGVYKHDgSneT3Cjc=; b=f052QEAU4OzYrnyv9RvFP8VSW4lRw0Tf9RXxCm9uwbWv45ryrPcO/Y1op45ttwZ8LkArk+ xGvHdIJ1wkg8oWc0qjFo1WxQdTPITWhGz4jDmjBjZ6Ozl2DJk+g+vd4PX+1DcF6yWI+7i9 +4cjMR4wNYyPP+TQSv5BAwhu129YIKo= X-MC-Unique: cFU-_59tOy-G3ys3P-TTrA-1 X-Mimecast-MFC-AGG-ID: cFU-_59tOy-G3ys3P-TTrA_1765362764 To: devel@lists.libvirt.org Subject: [PATCH 09/10] qemu: snapshot: Check earlier if memory snapshot is possible Date: Wed, 10 Dec 2025 11:32:30 +0100 Message-ID: <7a62abc417b96a74533936041e29f17046ed8693.1765362608.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QzS1987qN_oValOccF_J-oUFUAe8ZFdx0Xy6p66l24o_1765362764 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H2OH66W6Q6UBO6UZTCOY66WNCIULY62J X-Message-ID-Hash: H2OH66W6Q6UBO6UZTCOY66WNCIULY62J 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: 1765363686748158500 Content-Type: text/plain; charset="utf-8" From: Nikolay Shirokovskiy Don't unnecessarily pause the VM if the snapshot can't be taken. Signed-off-by: Nikolay Shirokovskiy Signed-off-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index c8954fd805..b75e2b4233 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1661,6 +1661,12 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, virQEMUSaveData *data =3D NULL; g_autoptr(GHashTable) blockNamedNodeData =3D NULL; + if (memory) { + /* When doing a snapshot with memory check if migration is possibl= e */ + if (!qemuMigrationSrcIsAllowed(vm, false, VIR_ASYNC_JOB_SNAPSHOT, = 0)) + return -1; + } + /* If quiesce was requested, then issue a freeze command, and a * counterpart thaw command when it is actually sent to agent. * The command will fail if the guest is paused or the guest agent @@ -1723,10 +1729,6 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, if (memory) { g_autoptr(qemuMigrationParams) snap_params =3D NULL; - /* check if migration is possible */ - if (!qemuMigrationSrcIsAllowed(vm, false, VIR_ASYNC_JOB_SNAPSHOT, = 0)) - goto cleanup; - qemuDomainJobSetStatsType(vm->job->current, QEMU_DOMAIN_JOB_STATS_TYPE_SAVEDUMP); --=20 2.52.0