[pve-devel] [PATCH storage v2 2/3] disks: die if storage name is already in use

Aaron Lauterer a.lauterer at proxmox.com
Thu Aug 18 17:31:53 CEST 2022



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.





More information about the pve-devel mailing list