From nobody Tue Feb 10 04:13:35 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646916182; cv=none; d=zohomail.com; s=zohoarc; b=Y7jd5xeJ8MOX4Oyl55YkAgh8hhZ636ecyXa/5jb8pWx6eDFHapYqK/3PG6UpCgM6lCspi2pKGDUxXbJ0e0gc2rLBLzMbrJAI7DydlvcEGqNGVrCDcQMEtojnSD1Fd3LQ0GcrNdJS+wHrIs17uJ2UEUi3HgHmAyp9Bnc/ZWXmKbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646916182; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d4wh57aeWBY0mboQgsCI9NmDIR9b/sGKxAfJCvf9qwk=; b=W04t2YeeS4n9r/Vdm6UfMoV63Vi/VUl7eHnKqWghjuwGjhTiFb/V9q8IKu0/S0jihn0eR3+A/QRUJkEWho642gNkn1LNRdEOQEceM2j1USbLJnCiwYCb76aZQlgmsMbcXf2mxEpke/P85lZZN0MRLFQQetZMq9dCwtp+rrnwCfE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1646916182713157.94907753540656; Thu, 10 Mar 2022 04:43:02 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-221-cydv6N26OmijLj2RO95DWA-1; Thu, 10 Mar 2022 07:40:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B43BB1C168E3; Thu, 10 Mar 2022 12:40: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 9EAB54010A14; Thu, 10 Mar 2022 12:40: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 37F871953576; Thu, 10 Mar 2022 12:40:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 38076195FD5A for ; Thu, 10 Mar 2022 12:40:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EB5567D3CD; Thu, 10 Mar 2022 12:40:51 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 591187D3CC for ; Thu, 10 Mar 2022 12:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646916181; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=d4wh57aeWBY0mboQgsCI9NmDIR9b/sGKxAfJCvf9qwk=; b=InFkBP6e2Iiy9V8SJDCNh/pJV4CyWQcbLF0HCSG+1e1QhG9QsO5h9VAIWA+UlHFni8I8kq q0mLtkvmY0tXfcfKfcoAZnn2zbc6c3hXlnP22aK17Fr4c5aiIy+vARmZdwg/+hwc9O9JBk 9CDtamQ4V/Xai347r0APZPkfRS7EvoQ= X-MC-Unique: cydv6N26OmijLj2RO95DWA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/14] conf: Move definition of 'virDomainSnapshotLocation' Date: Thu, 10 Mar 2022 13:40:34 +0100 Message-Id: <67d02c3e04cd3ebaa31b1d1232e1a1fa1343e94c.1646915960.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.2 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646916184648100001 Content-Type: text/plain; charset="utf-8" The snapshot location enum is also needed for the disk definition so if we house it inside domain_conf we can use the proper type for it. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 10 +++++++++- src/conf/domain_conf.h | 14 +++++++++++++- src/conf/snapshot_conf.c | 8 -------- src/conf/snapshot_conf.h | 12 ------------ src/libvirt_private.syms | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 40ff71d7db..721623129c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1402,6 +1402,14 @@ VIR_ENUM_IMPL(virDomainIBS, "fixed-na", ); +VIR_ENUM_IMPL(virDomainSnapshotLocation, + VIR_DOMAIN_SNAPSHOT_LOCATION_LAST, + "default", + "no", + "internal", + "external", +); + /* Internal mapping: subset of block job types that can be present in * XML (remaining types are not two-phase). */ VIR_ENUM_DECL(virDomainBlockJob); @@ -23608,7 +23616,7 @@ virDomainDiskDefFormat(virBuffer *buf, if (def->sgio) virBufferAsprintf(&attrBuf, " sgio=3D'%s'", sgio); - if (def->snapshot && + if (def->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT && !(def->snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE && def->src->readonly)) virBufferAsprintf(&attrBuf, " snapshot=3D'%s'", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9fcf842ee7..5f6b508e89 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -537,6 +537,18 @@ typedef enum { } virDomainMemoryAllocation; +typedef enum { + VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT =3D 0, + VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, + VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL, + VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL, + + VIR_DOMAIN_SNAPSHOT_LOCATION_LAST +} virDomainSnapshotLocation; + +VIR_ENUM_DECL(virDomainSnapshotLocation); + + /* Stores the virtual disk configuration */ struct _virDomainDiskDef { virStorageSource *src; /* non-NULL. XXX Allow NULL for empty cdrom? */ @@ -581,7 +593,7 @@ struct _virDomainDiskDef { virTristateSwitch ioeventfd; virTristateSwitch event_idx; virTristateSwitch copy_on_read; - unsigned int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */ + virDomainSnapshotLocation snapshot; virDomainStartupPolicy startupPolicy; bool transient; virTristateBool transientShareBacking; diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 812cca2ed1..a4b3cd8c2b 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -67,14 +67,6 @@ virDomainSnapshotOnceInit(void) VIR_ONCE_GLOBAL_INIT(virDomainSnapshot); -VIR_ENUM_IMPL(virDomainSnapshotLocation, - VIR_DOMAIN_SNAPSHOT_LOCATION_LAST, - "default", - "no", - "internal", - "external", -); - /* virDomainSnapshotState is really virDomainState plus one extra state */ VIR_ENUM_IMPL(virDomainSnapshotState, VIR_DOMAIN_SNAPSHOT_LAST, diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index c8997c710c..b7e0d441ff 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -26,17 +26,6 @@ #include "moment_conf.h" #include "virenum.h" -/* Items related to snapshot state */ - -typedef enum { - VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT =3D 0, - VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, - VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL, - VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL, - - VIR_DOMAIN_SNAPSHOT_LOCATION_LAST -} virDomainSnapshotLocation; - /** * This enum has to map all known domain states from the public enum * virDomainState, before adding one additional state possible only @@ -139,5 +128,4 @@ int virDomainSnapshotRedefinePrep(virDomainObj *vm, virDomainXMLOption *xmlopt, unsigned int flags); -VIR_ENUM_DECL(virDomainSnapshotLocation); VIR_ENUM_DECL(virDomainSnapshotState); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6f0d72ca38..01503083ef 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -637,6 +637,8 @@ virDomainSmartcardTypeFromString; virDomainSmartcardTypeToString; virDomainSmbiosModeTypeFromString; virDomainSmbiosModeTypeToString; +virDomainSnapshotLocationTypeFromString; +virDomainSnapshotLocationTypeToString; virDomainSoundDefFind; virDomainSoundDefFree; virDomainSoundDefRemove; @@ -1024,8 +1026,6 @@ virDomainSnapshotDiskDefFree; virDomainSnapshotDiskDefParseXML; virDomainSnapshotFormatConvertXMLFlags; virDomainSnapshotIsExternal; -virDomainSnapshotLocationTypeFromString; -virDomainSnapshotLocationTypeToString; virDomainSnapshotRedefinePrep; virDomainSnapshotStateTypeFromString; virDomainSnapshotStateTypeToString; --=20 2.35.1