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 2EE8470D8D for ; Wed, 15 Jun 2022 10:24:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2599E2795F for ; Wed, 15 Jun 2022 10:24:53 +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 93D0C27956 for ; Wed, 15 Jun 2022 10:24:52 +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 64CCF43B52 for ; Wed, 15 Jun 2022 10:24:52 +0200 (CEST) Date: Wed, 15 Jun 2022 10:24:50 +0200 From: Wolfgang Bumiller To: Hannes Laimer Cc: pve-devel@lists.proxmox.com Message-ID: <20220615082450.7kbodgk73m5pe4ef@wobu-vie.proxmox.com> References: <20220608071000.3852-1-h.laimer@proxmox.com> <20220608071000.3852-2-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220608071000.3852-2-h.laimer@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.310 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [diskmanage.pm, disks.pm] Subject: [pve-devel] applied: [PATCH pve-storage 1/1] api2: disks: add mounted boolean field X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 08:24:53 -0000 applied, thanks On Wed, Jun 08, 2022 at 07:09:59AM +0000, Hannes Laimer wrote: > ... and remove '(mounted)' from usage string > > Signed-off-by: Hannes Laimer > --- > PVE/API2/Disks.pm | 1 + > PVE/Diskmanage.pm | 7 +++---- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/PVE/API2/Disks.pm b/PVE/API2/Disks.pm > index b618057..bde6132 100644 > --- a/PVE/API2/Disks.pm > +++ b/PVE/API2/Disks.pm > @@ -125,6 +125,7 @@ __PACKAGE__->register_method ({ > }, > used => { type => 'string', optional => 1 }, > gpt => { type => 'boolean' }, > + mounted => { type => 'boolean' }, > size => { type => 'integer'}, > osdid => { type => 'integer'}, > vendor => { type => 'string', optional => 1 }, > diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm > index d67cc6b..253916b 100644 > --- a/PVE/Diskmanage.pm > +++ b/PVE/Diskmanage.pm > @@ -605,6 +605,7 @@ sub get_disks { > size => $sysdata->{size}, > serial => $data->{serial}, > gpt => $data->{gpt}, > + mounted => exists $mounted->{$devpath}, > rpm => $data->{rpm}, > type => $type, > wwn => $data->{wwn}, > @@ -650,10 +651,7 @@ sub get_disks { > } > > my $fstype = $info->{fstype}; > - if (defined($fstype)) { > - return "${fstype} (mounted)" if $mounted->{$devpath}; > - return "${fstype}"; > - } > + return "${fstype}" if defined($fstype); > return 'mounted' if $mounted->{$devpath}; > > return if !$is_partition; > @@ -693,6 +691,7 @@ sub get_disks { > > $partitions->{$part}->{devpath} = "$partpath/$part"; > $partitions->{$part}->{parent} = "$devpath"; > + $partitions->{$part}->{mounted} = exists $mounted->{"$partpath/$part"}; > $partitions->{$part}->{gpt} = $data->{gpt}; > $partitions->{$part}->{type} = 'partition'; > $partitions->{$part}->{size} = > -- > 2.30.2