[pbs-devel] [PATCH proxmox-backup] api: directory: use relative path when creating removable datastore
Hannes Laimer
h.laimer at proxmox.com
Wed Nov 27 10:03:27 CET 2024
On 11/27/24 09:58, Thomas Lamprecht wrote:
> Can you please add a comment message for this with some rationale, e.g.,
> why the old value was assembled that way, if there was any reasoning back
> then, simple mistakes naturally happen too to everybody, and/or why this
> is now the correct way.
>
> You can also write it as reply and I amend the patch or send a v2,
> whatever you prefer.
>
In an earlier version of this series the datastore path was absolute for
removable datastores. This is a leftover I missed when changing that.
> Am 26.11.24 um 17:51 schrieb Hannes Laimer:
>> Reported-by: Markus Frank <m.frank at proxmox.com>
>> Fixes: 94a068e31 ("api: node: allow creation of removable datastore through directory endpoint")
>> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
>> ---
>> src/api2/node/disks/directory.rs | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/directory.rs
>> index 2f7cc7a27..6a76dd5a7 100644
>> --- a/src/api2/node/disks/directory.rs
>> +++ b/src/api2/node/disks/directory.rs
>> @@ -237,7 +237,7 @@ pub fn create_datastore_disk(
>> let lock = pbs_config::datastore::lock_config()?;
>> let datastore: DataStoreConfig = if removable_datastore {
>> serde_json::from_value(
>> - json!({ "name": name, "path": format!("/{name}"), "backing-device": uuid }),
>> + json!({ "name": name, "path": name, "backing-device": uuid }),
>> )?
>> } else {
>> serde_json::from_value(json!({ "name": name, "path": mount_point }))?
>
More information about the pbs-devel
mailing list