From nobody Tue Feb 10 20:48:33 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=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.133.124]) by mx.zohomail.com with SMTPS id 1648725597493220.9035638744465; Thu, 31 Mar 2022 04:19:57 -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-368-_VzHbHbTOy2L680R1XejIQ-1; Thu, 31 Mar 2022 07:19:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CEA8D899EEF; Thu, 31 Mar 2022 11:19:49 +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 B6B4E40CFD02; Thu, 31 Mar 2022 11:19:49 +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 94FC81947BBC; Thu, 31 Mar 2022 11:19:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3BEC619451F3 for ; Thu, 31 Mar 2022 11:19:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1AA091457F07; Thu, 31 Mar 2022 11:19:47 +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 168B81457F06 for ; Thu, 31 Mar 2022 11:19:47 +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 F1CEA83395F for ; Thu, 31 Mar 2022 11:19:46 +0000 (UTC) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-dyVunEUHOHiwSNUvGalKmQ-2; Thu, 31 Mar 2022 07:19:44 -0400 Received: by mail-lj1-f173.google.com with SMTP id a30so24071146ljq.13 for ; Thu, 31 Mar 2022 04:19:44 -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.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 04:19:42 -0700 (PDT) X-MC-Unique: _VzHbHbTOy2L680R1XejIQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: dyVunEUHOHiwSNUvGalKmQ-2 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=2KZzcHKRfY8K3m06CzRz8w1FPVSzA2mpYQNLn5IM0BM=; b=JLLyIoqP7n996sDdgHaOiE1LRxQxFXcby+H8REBk4LQXf3OQ/rp8hLHJSMRxECPOL0 Lf0bnx8Ewk6tDRPFoWmXYlIg1p/TnWgpoSUxHTtVXy940hWvwK1LBVgGM5PKtMcWg0aj AqdDIb6Nj4B4tM/ujdOFe/aIMpe0hmlNiYWtF5oRORfSlyzfoHJNvGbdsnR88NaQdNlC MAhnPqsTkw7vYMLVgAA521rqT1ybHx9+mzsObgSY7V+HeH1S3nOf5D9zzbGDi8IrC9kM jtuSAcs9Vo6vN43FPn4sl3kYu5DvEyaVqk4fI8V3HZWPUApIYGQKfke4o/vwdrVC98Pm GIlw== X-Gm-Message-State: AOAM530b9n3nZDO1XrwyoQMrBx7S6kuAMcYCaU11S4mKNoQGesaEWs9u QhaxJhriorVb9QWkufF3n2zOEWu/O5oUBA== X-Google-Smtp-Source: ABdhPJxQIeM9Vovo8H2isjDH2zmVjQiCV+jycOq5oIYQErFZvGxmnLBIubPp6kv7h+iQtbHkRgnesw== X-Received: by 2002:a05:651c:3cc:b0:249:800d:58ea with SMTP id f12-20020a05651c03cc00b00249800d58eamr9969220ljp.41.1648725583576; Thu, 31 Mar 2022 04:19:43 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 06/11] conf: add memory state disk for internal snapshots Date: Thu, 31 Mar 2022 14:19:16 +0300 Message-Id: <20220331111921.450496-7-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.7 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.84 on 10.11.54.1 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: 1648725598601100009 Content-Type: text/plain; charset="utf-8"; x-default="true" This can be used to specify disk where to place vmstate data. Signed-off-by: Nikolay Shirokovskiy --- src/conf/snapshot_conf.c | 13 +++++++++++++ src/conf/snapshot_conf.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 80946beba9..8c9ee03942 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -117,6 +117,7 @@ virDomainSnapshotDefDispose(void *obj) size_t i; =20 g_free(def->memorysnapshotfile); + g_free(def->memorydisk); for (i =3D 0; i < def->ndisks; i++) virDomainSnapshotDiskDefClear(&def->disks[i]); g_free(def->disks); @@ -305,6 +306,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, =20 if ((memoryNode =3D virXPathNode("./memory", ctxt))) { def->memorysnapshotfile =3D virXMLPropString(memoryNode, "file"); + def->memorydisk =3D virXMLPropString(memoryNode, "disk"); =20 if (virXMLPropEnumDefault(memoryNode, "snapshot", virDomainSnapshotLocationTypeFromString, @@ -323,6 +325,8 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, if (def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT) { if (def->memorysnapshotfile) { def->memory =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; + } else if (def->memorydisk) { + def->memory =3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; } else if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE) { if (offline) { def->memory =3D VIR_DOMAIN_SNAPSHOT_LOCATION_NO; @@ -347,6 +351,14 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, return NULL; } =20 + if (def->memorydisk && + def->memory !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL) { + virReportError(VIR_ERR_XML_ERROR, + _("memory disk '%s' requires internal snapshot"), + def->memorydisk); + return NULL; + } + if (offline && def->memory !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT && def->memory !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NO) { @@ -844,6 +856,7 @@ virDomainSnapshotDefFormatInternal(virBuffer *buf, virBufferAsprintf(buf, "memor= y)); virBufferEscapeString(buf, " file=3D'%s'", def->memorysnapshotfile= ); + virBufferEscapeString(buf, " disk=3D'%s'", def->memorydisk); virBufferAddLit(buf, "/>\n"); } =20 diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 1f787f1a94..b7b448a071 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -72,6 +72,7 @@ struct _virDomainSnapshotDef { =20 virDomainSnapshotLocation memory; char *memorysnapshotfile; /* memory state file when snapshot is extern= al */ + char *memorydisk; /* memory state disk when snapshot is internal */ =20 size_t ndisks; /* should not exceed dom->ndisks */ virDomainSnapshotDiskDef *disks; --=20 2.35.1