From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 177A36FE07 for ; Wed, 1 Sep 2021 16:49:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DA1C69DD1 for ; Wed, 1 Sep 2021 16:48:59 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 91FBA9D4A for ; Wed, 1 Sep 2021 16:48:55 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 68A3D444AF; Wed, 1 Sep 2021 16:48:55 +0200 (CEST) Message-ID: Date: Wed, 1 Sep 2021 16:48:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Thunderbird/92.0 Content-Language: en-US To: Proxmox Backup Server development discussion , Hannes Laimer References: <20210830111505.38694-1-h.laimer@proxmox.com> <20210830111505.38694-7-h.laimer@proxmox.com> From: Dominik Csapak In-Reply-To: <20210830111505.38694-7-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.682 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% ENA_SUBJ_ODD_CASE 3.2 Subject has odd case KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.932 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [datastore.rs, lib.rs] Subject: Re: [pbs-devel] [PATCH v2 proxmox-backup 06/15] api2: add 'removable' to DataStoreListItem X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2021 14:49:30 -0000 On 8/30/21 13:14, Hannes Laimer wrote: > --- > pbs-api-types/src/lib.rs | 7 +++++++ > src/api2/admin/datastore.rs | 1 + > 2 files changed, 8 insertions(+) > > diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs > index 576099eb..2965a11a 100644 > --- a/pbs-api-types/src/lib.rs > +++ b/pbs-api-types/src/lib.rs > @@ -437,6 +437,12 @@ pub struct GroupListItem { > optional: true, > schema: SINGLE_LINE_COMMENT_SCHEMA, > }, > + removable: { > + description: "The datastore is marked as removable.", > + type: bool, > + optional: true, > + default: false, > + }, > }, > )] > #[derive(Serialize, Deserialize)] > @@ -445,6 +451,7 @@ pub struct GroupListItem { > pub struct DataStoreListItem { > pub store: String, > pub comment: Option, > + pub removable: bool, > } > > #[api( > diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs > index 16559678..b236dfab 100644 > --- a/src/api2/admin/datastore.rs > +++ b/src/api2/admin/datastore.rs > @@ -1089,6 +1089,7 @@ pub fn get_datastore_list( > DataStoreListItem { > store: store.clone(), > comment: data["comment"].as_str().map(String::from), > + removable: data["backing-device"] != Value::Null, isn't that check wrong? it is only removable if we have a backing-device *and* as backing-device-mount-point? > } > ); > } >