From: Fiona Ebner <f.ebner@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
"Shannon Sterz" <s.sterz@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage 3/4] plugin: extend snapshot name parsing to legacy volnames
Date: Thu, 31 Jul 2025 14:32:56 +0200 [thread overview]
Message-ID: <4d45bee5-0fa5-4b1f-910c-45243e61e10c@proxmox.com> (raw)
In-Reply-To: <1753964395.jcfdgotafi.astroid@yuna.none>
Am 31.07.25 um 2:20 PM schrieb Fabian Grünbichler:
> On July 31, 2025 2:09 pm, Fiona Ebner wrote:
>> Am 31.07.25 um 1:15 PM schrieb Fabian Grünbichler:
>>> otherwise a volume like `100/oldstyle-100-disk-0.qcow2` can be snapshotted, but
>>> the snapshot file is treated as a volume instead of a snapshot afterwards.
>>>
>>> this also avoids issues with volnames with `vm-` in their names, similar to the
>>> LVM fix for underscores.
>>>
>>> Co-authored-by: Shannon Sterz <s.sterz@proxmox.com>
>>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>>> ---
>>> src/PVE/Storage/Plugin.pm | 8 ++++----
>>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
>>> index affe7b0..db05e0e 100644
>>> --- a/src/PVE/Storage/Plugin.pm
>>> +++ b/src/PVE/Storage/Plugin.pm
>>> @@ -702,9 +702,9 @@ sub cluster_lock_storage {
>>> }
>>>
>>> my sub parse_snap_name {
>>> - my ($name) = @_;
>>> + my ($filename, $volname) = @_;
>>>
>>> - if ($name =~ m/^snap-(.*)-vm(.*)$/) {
>>> + if ($filename =~ m/^snap-(.*)-\Q$volname\E$/) {
>>> return $1;
>>> }
>>> }
>>> @@ -715,7 +715,7 @@ sub parse_name_dir {
>>> if ($name =~ m!^((vm-|base-|subvol-)(\d+)-[^/\s]+\.(raw|qcow2|vmdk|subvol))$!) {
>>> my $isbase = $2 eq 'base-' ? $2 : undef;
>>> return ($1, $4, $isbase); # (name, format, isBase)
>>> - } elsif (parse_snap_name($name)) {
>>> + } elsif ($name =~ m!^snap-.*\.qcow2$!) {
>>
>> Should we reserve this schema for all formats and not just qcow2 while
>> we're at it? For example, would keep open the possibility with TPM state
>> snapshots as separate files or something similar that might pop up in
>> the future.
>
> I mean, we don't create such volumes anyway, it's only custom ones and
> for those we collide with existing ones in any case. the vsplit patch
> series should provide us with clean namespaces for the new vtypes, and
> then we can simply only ever allocate using those..
Yes, makes sense to not restrict further than necessary now if we
already have a path forward :)
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-07-31 12:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 11:15 [pve-devel] [PATCH storage 0/4] fix snapshot filename regressions Fabian Grünbichler
2025-07-31 11:15 ` [pve-devel] [PATCH storage 1/4] plugin: fix parse_name_dir regression for custom volume names Fabian Grünbichler
2025-07-31 11:15 ` [pve-devel] [PATCH storage 2/4] fix #6584: plugin: list_images: only include parseable filenames Fabian Grünbichler
2025-07-31 11:15 ` [pve-devel] [PATCH storage 3/4] plugin: extend snapshot name parsing to legacy volnames Fabian Grünbichler
2025-07-31 12:09 ` Fiona Ebner
2025-07-31 12:20 ` Fabian Grünbichler
2025-07-31 12:32 ` Fiona Ebner [this message]
2025-07-31 11:15 ` [pve-devel] [RFC storage 4/4] plugin: parse_name_dir: drop deprecation warning Fabian Grünbichler
2025-07-31 12:17 ` Fiona Ebner
2025-07-31 12:06 ` [pve-devel] [PATCH storage 0/4] fix snapshot filename regressions Shannon Sterz
2025-07-31 12:17 ` [pve-devel] applied: " Thomas Lamprecht
2025-07-31 12:24 ` [pve-devel] " Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d45bee5-0fa5-4b1f-910c-45243e61e10c@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=s.sterz@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.