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 988B98A5A1 for ; Wed, 17 Aug 2022 13:35:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 88696269EC for ; Wed, 17 Aug 2022 13:35:12 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 17 Aug 2022 13:35:11 +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 9C56A42D09 for ; Wed, 17 Aug 2022 13:35:11 +0200 (CEST) Date: Wed, 17 Aug 2022 13:35:05 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20220715115808.1385388-1-a.lauterer@proxmox.com> <20220715115808.1385388-2-a.lauterer@proxmox.com> In-Reply-To: <20220715115808.1385388-2-a.lauterer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1660736044.rtkl2ioqv8.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.162 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. [proxmox.com, diskmanage.pm] Subject: Re: [pve-devel] [PATCH storage v2 1/3] diskmanage: add mounted_paths 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, 17 Aug 2022 11:35:42 -0000 On July 15, 2022 1:58 pm, Aaron Lauterer wrote: > returns a list of mounted paths with the backing devices >=20 > Signed-off-by: Aaron Lauterer > --- > changes since v1: dropped limit to /dev path, returning all mounted > paths now >=20 > PVE/Diskmanage.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm > index 8ed7a8b..b149685 100644 > --- a/PVE/Diskmanage.pm > +++ b/PVE/Diskmanage.pm > @@ -499,6 +499,18 @@ sub mounted_blockdevs { > return $mounted; > } > =20 nit: a short comment here telling us about the returned data might be=20 helpful - else I have to look at parse_proc_mounts or guess what the key=20 and what the value represent.. > +sub mounted_paths { > + my $mounted =3D {}; > + > + my $mounts =3D PVE::ProcFSTools::parse_proc_mounts(); > + > + foreach my $mount (@$mounts) { > + $mounted->{abs_path($mount->[1])} =3D $mount->[0]; > + }; > + > + return $mounted; > +} > + > sub get_disks { > my ($disks, $nosmart, $include_partitions) =3D @_; > my $disklist =3D {}; > --=20 > 2.30.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20