From nobody Tue Feb 10 20:48:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=openvz.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1648725601281380.0512766806261; Thu, 31 Mar 2022 04:20:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-yE1mausDPK28rcBjr1wTyA-1; Thu, 31 Mar 2022 07:19:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6027082A682; Thu, 31 Mar 2022 11:19:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 485B2401E71; Thu, 31 Mar 2022 11:19:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1670D194034D; Thu, 31 Mar 2022 11:19:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4F8D21947BBC for ; Thu, 31 Mar 2022 11:19:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 401CBC27D90; Thu, 31 Mar 2022 11:19:49 +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 3B432C27D8F for ; Thu, 31 Mar 2022 11:19:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 21980801E67 for ; Thu, 31 Mar 2022 11:19:49 +0000 (UTC) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-CwD8F4T3MvKu-uopCB2dkw-1; Thu, 31 Mar 2022 07:19:47 -0400 Received: by mail-lf1-f46.google.com with SMTP id z12so27099022lfu.10 for ; Thu, 31 Mar 2022 04:19:46 -0700 (PDT) Received: from vzbook.. (broadband-90-154-71-96.ip.moscow.rt.ru. [90.154.71.96]) by smtp.gmail.com with ESMTPSA id b24-20020a196458000000b0044ab702b6acsm695653lfj.238.2022.03.31.04.19.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 04:19:43 -0700 (PDT) X-MC-Unique: yE1mausDPK28rcBjr1wTyA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: CwD8F4T3MvKu-uopCB2dkw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3bEZfUiQNmUAefpJNOJu0rfAfgmzSuQbWYYSsPKYGB8=; b=1jOMvWcdD40/ptIIduK6H/ndMfWHjKCsbG+P43FX5xLPpB1qGDlGQM7lPEEPDQmwrk NQzXnpLf1yHBXwJXYg78Tyv2nnjN5CJt4Xfqj6UbiJOOdXTZuUnUEJNnzD2KFT0rkLmy xKMEP6LKF4lexgAbD3xeq9tHLu96M/3hGoSmlCOVMCTEoJFCnWG72sho/eaRGc+fD4+q sF4aZ9K8YGWM6H06B9dW76X1ca/iOMfRs0s4qncvgQv57BePiC4XJ47lPmzXpy3YdvJB gpixalSlZdP+qevs/zSUxdQAcfjFjNlbgwK+evZgJlnc0+BZsvlP92fA26VYEb66mP5M oJuw== X-Gm-Message-State: AOAM531nLw2tEsFvqv4/oN84dqUT/EHiERQrKB6MTa2MmgCaqqZsPGxV 891n3wuLhGZdu8Pfs0LZBQqEa/OfKXNkXw== X-Google-Smtp-Source: ABdhPJyMMeDEOhQLeP/LO6CEyANqm5YiFH8Wa6ew4kpENfTpBmlMMtFMsjR6V40ru6zSeFeilyxc+Q== X-Received: by 2002:a05:6512:4002:b0:44a:53f9:1f21 with SMTP id br2-20020a056512400200b0044a53f91f21mr10207453lfb.400.1648725584378; Thu, 31 Mar 2022 04:19:44 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 07/11] qemu: check internal snaphshot memory disk Date: Thu, 31 Mar 2022 14:19:17 +0300 Message-Id: <20220331111921.450496-8-nikolay.shirokovskiy@openvz.org> In-Reply-To: <20220331111921.450496-1-nikolay.shirokovskiy@openvz.org> References: <20220331111921.450496-1-nikolay.shirokovskiy@openvz.org> 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.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1648725602756100002 Content-Type: text/plain; charset="utf-8"; x-default="true" - check it is supported by the QEMU - check disk itself has internal snapshot - for modern QEMU select it if it is not specified explicitly Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_snapshot.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 579d744c60..54eafb5020 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1852,6 +1852,38 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm, if (virDomainSnapshotAlignDisks(def, NULL, align_location, true) < 0) return -1; =20 + if (def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL) { + bool modern =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SNAPSHOT_= SAVE); + + if (modern) { + size_t i; + + for (i =3D 0; i < def->ndisks; i++) { + if (def->disks[i].snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATI= ON_INTERNAL) + continue; + + if (def->memorydisk) { + if (STREQ(def->memorydisk, def->disks[i].name)) + break; + } else { + def->memorydisk =3D g_strdup(def->disks[i].name); + break; + } + } + + if (i =3D=3D def->ndisks && def->memorydisk) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("memory disk '%s' should itself have inte= rnal snapshot"), + def->memorydisk); + return -1; + } + } else if (def->memorydisk) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("specifing memory disk is not supported by th= is QEMU")); + return -1; + } + } + return 0; } =20 --=20 2.35.1