From nobody Tue Feb 10 01:19:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636622150451756.6716401505481; Thu, 11 Nov 2021 01:15:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-1gfTYlN1O6ePsW04JxXG3A-1; Thu, 11 Nov 2021 04:15:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A13818A0F3D; Thu, 11 Nov 2021 09:15:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C25967841; Thu, 11 Nov 2021 09:15:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3E1041800FDD; Thu, 11 Nov 2021 09:15:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AB9BxmU027423 for ; Thu, 11 Nov 2021 04:11:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5F802404727C; Thu, 11 Nov 2021 09:11:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BF5B4047279 for ; Thu, 11 Nov 2021 09:11:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 433538001EA for ; Thu, 11 Nov 2021 09:11:59 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-132-A8n1gFTXMWKONBMXcCXkaQ-1; Thu, 11 Nov 2021 04:11:57 -0500 Received: from [10.28.15.237] (helo=vz8.sw.ru) by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1ml5sB-008xIO-BV for libvir-list@redhat.com; Thu, 11 Nov 2021 11:55:55 +0300 X-MC-Unique: 1gfTYlN1O6ePsW04JxXG3A-1 X-MC-Unique: A8n1gFTXMWKONBMXcCXkaQ-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 1/9] qemu: make snap possibility check before pausing CPUS Date: Thu, 11 Nov 2021 11:55:46 +0300 Message-Id: <20211111085554.14685-2-nshirokovskiy@virtuozzo.com> In-Reply-To: <20211111085554.14685-1-nshirokovskiy@virtuozzo.com> References: <20211111085554.14685-1-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1636622151314100001 Content-Type: text/plain; charset="utf-8" This way we won't unnecessaryly pause VMs. Looks like pausing does not afect qemuMigrationSrcIsAllowed checks so we can check without pausing. Signed-off-by: Nikolay Shirokovskiy Reviewed-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 d105eead27..007c55b82a 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1363,6 +1363,10 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, virQEMUSaveData *data =3D NULL; g_autoptr(GHashTable) blockNamedNodeData =3D NULL; =20 + /* check if migration is possible */ + if (memory && !qemuMigrationSrcIsAllowed(driver, vm, false, 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 @@ -1423,10 +1427,6 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driv= er, =20 /* do the memory snapshot if necessary */ if (memory) { - /* check if migration is possible */ - if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) - goto cleanup; - priv->job.current->statsType =3D QEMU_DOMAIN_JOB_STATS_TYPE_SAVEDU= MP; =20 /* allow the migration job to be cancelled or the domain to be pau= sed */ --=20 2.27.0