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 DEFBB710C6 for ; Wed, 8 Jun 2022 09:19:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D33EA4E17 for ; Wed, 8 Jun 2022 09:19:04 +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 E3CAE4DF5 for ; Wed, 8 Jun 2022 09:19:03 +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 0C9FF43A64 for ; Wed, 8 Jun 2022 09:10:18 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Date: Wed, 8 Jun 2022 07:09:59 +0000 Message-Id: <20220608071000.3852-2-h.laimer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220608071000.3852-1-h.laimer@proxmox.com> References: <20220608071000.3852-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 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] [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, 08 Jun 2022 07:19:34 -0000 ... 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