[pve-devel] [PATCH guest-common v13 2/12] add dir mapping section config
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Feb 19 18:00:34 CET 2025
Am 19.02.25 um 11:06 schrieb Fiona Ebner:
> Am 22.01.25 um 11:08 schrieb Markus Frank:
>> +my $map_fmt = {
>> + node => get_standard_option('pve-node'),
>> + path => {
>> + description => "Absolute directory path that should be shared with the guest.",
>> + type => 'string',
>> + format => 'pve-storage-path',
>
> I now noticed that paths with commas do not work for the mapping. They
> cannot be passed along, since the API endpoint requires the full mapping
> as a property string and we have no way of escaping commas AFAIK. To
> make it work, we could require paths to be (base64?) encoded when passed
> via API. We might also want to think about writing them encoded to the
> config file since it's also saved as the property string there.
>
> If we do not want to support such paths, I think we should restrict the
> allowed characters, e.g. our storage plugin already has a
> $SAFE_CHAR_WITH_WHITESPACE_CLASS_RE that could be used to register a
> restricted format (if we don't already have one). Doesn't support
> anything non-ASCII either though. And it does support '=' which causes
> issues in the UI (seems to work in the backend though).
>
> @other devs: opinions?
We got quotation for property strings to handle such cases in the rust
code bases, I forgot how far we got with adding that support in the perl
side (CC'ing Wolfgang for that).
Besides that, properties that accept paths should be ideally quite
flexible. We still can start out with a more restricted format if that
makes development (for now) easier, to avoid scope creep and "ugly"
encodings that make editing configs directly way harder.
More information about the pve-devel
mailing list