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 546648A90C for ; Thu, 18 Aug 2022 17:31:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 45D202F27 for ; Thu, 18 Aug 2022 17:31:55 +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 ; Thu, 18 Aug 2022 17:31:54 +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 E63AF44CB9 for ; Thu, 18 Aug 2022 17:31:53 +0200 (CEST) Message-ID: <3c556291-e140-1623-6b0d-eeb2920aab30@proxmox.com> Date: Thu, 18 Aug 2022 17:31:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Content-Language: en-US From: Aaron Lauterer To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= Reply-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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.014 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 NICE_REPLY_A -0.001 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 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: Thu, 18 Aug 2022 15:31:55 -0000 On 8/18/22 17:22, Aaron Lauterer wrote: > > > On 8/17/22 13:42, Fabian Grünbichler wrote:[..] >>> +    die "a systemd mount unit already exists: ${mountunitpath}\n" if -e >>> $mountunitpath; >> >> could check if it's identical to the one we'd generate (in the spirit of >> patch #3 ;)) > > I looked into it, depending on how hard we want to match the mount unit, this > could be a bit hard. It contains the /dev/disk/by-uuid/... path which will not > be the same as it changes with each FS creation (IIUC). The question is, if it is a good idea to have the check since there is no easy way for the user to remedy the problem without doing a manual `rm /etc/systemd/system/foo.mount`. Putting more work into improving the whole storage mgmt situation is of course also something we could do. [...] > >>>   sub preparetree { >>> @@ -336,6 +340,7 @@ __PACKAGE__->register_method ({ >>>       my $user = $rpcenv->get_user(); >>>       my $name = $param->{name}; >>> +    my $node = $param->{node}; >> >> nit: please also change the usage further below in this API handler if >> you do this > > what exactly do you mean? defining local variables for $param->{..} ones? > okay I think I got it. was confused by looking at another part of the code.