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 6141A8AA15 for ; Fri, 19 Aug 2022 10:22:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5877E18319 for ; Fri, 19 Aug 2022 10:22: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 for ; Fri, 19 Aug 2022 10:22: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 A488B4330D for ; Fri, 19 Aug 2022 10:22:03 +0200 (CEST) Date: Fri, 19 Aug 2022 10:21:57 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20220715115808.1385388-1-a.lauterer@proxmox.com> <20220715115808.1385388-3-a.lauterer@proxmox.com> <1660736115.7grkvr18dc.astroid@nora.none> <3c556291-e140-1623-6b0d-eeb2920aab30@proxmox.com> In-Reply-To: <3c556291-e140-1623-6b0d-eeb2920aab30@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1660897234.79lpydl84s.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.161 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 - Subject: Re: [pve-devel] [PATCH storage v2 2/3] disks: die if storage name is already in use 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: Fri, 19 Aug 2022 08:22:04 -0000 On August 18, 2022 5:31 pm, Aaron Lauterer wrote: >=20 >=20 > On 8/18/22 17:22, Aaron Lauterer wrote: >>=20 >>=20 >> On 8/17/22 13:42, Fabian Gr=C3=BCnbichler wrote:[..] >>>> +=C2=A0=C2=A0=C2=A0 die "a systemd mount unit already exists: ${mountu= nitpath}\n" if -e=20 >>>> $mountunitpath; >>> >>> could check if it's identical to the one we'd generate (in the spirit o= f >>> patch #3 ;)) >>=20 >> I looked into it, depending on how hard we want to match the mount unit,= this=20 >> could be a bit hard. It contains the /dev/disk/by-uuid/... path which wi= ll not=20 >> be the same as it changes with each FS creation (IIUC). >=20 > The question is, if it is a good idea to have the check since there is no= easy=20 > way for the user to remedy the problem without doing a manual `rm=20 > /etc/systemd/system/foo.mount`. *could* be solved by having a force parameter I guess? not sure that's a=20 good idea, just throwing it out there ;) > Putting more work into improving the whole storage mgmt situation is of c= ourse=20 > also something we could do. >=20 > [...] >>=20 >>>> =C2=A0 sub preparetree { >>>> @@ -336,6 +340,7 @@ __PACKAGE__->register_method ({ >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 my $user =3D $rpcenv->get_user(); >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 my $name =3D $param->{name}; >>>> +=C2=A0=C2=A0=C2=A0 my $node =3D $param->{node}; >>> >>> nit: please also change the usage further below in this API handler if >>> you do this >>=20 >> what exactly do you mean? defining local variables for $param->{..} ones= ? >>=20 >=20 > okay I think I got it. was confused by looking at another part of the cod= e. >=20