From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Lukas Sichert" <l.sichert@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH manager v9 4/5] fix #7339: lvm: add discard-on-remove option to UI
Date: Thu, 16 Jul 2026 10:49:49 +0200 [thread overview]
Message-ID: <DJZV7CRW9TDO.1G55ORI2J561R@proxmox.com> (raw)
In-Reply-To: <20260713160008.121125-5-l.sichert@proxmox.com>
On Mon Jul 13, 2026 at 6:00 PM CEST, Lukas Sichert wrote:
[snip]
> + let onRemoveString = PVE.Parser.printPropertyString(onRemove);
> + if (onRemoveString !== '') {
> + values['on-volume-remove'] = onRemoveString;
> + } else if (!me.isCreate) {
> + if (!values.delete) {
> + values.delete = [];
> + }
> + values.delete.push('on-volume-remove');
`values.delete` is not guaranteed to be an array. In other places in
pve-manager, we have explicit checks such as this one:
```
if (Array.isArray(values.delete)) {
values.delete.push(key);
} else {
values.delete = [values.delete, key];
}
```
A consequence of this is that if you edit an existing LVM storage with
snapshot-as-volume-chain and discard-on-remove unchecked, you cannot
edit the storage, even if you changed another value. The "OK" button
will simply not do anything. From just a quick glance at the code I
think this is because in the StorageBase component's initComponent,
there is a `deleteEmpty: !me.isCreate` for the snapshot-as-volume-chain
checkbox added for LVM storages, which then results in values.delete
being a string (?) instead of an array (it only becomes an array if more
than 1 value is deleted).
Adding a check like above should solve this.
> + }
> +
> + return me.callParent([values]);
> + },
> +
[snip]
next prev parent reply other threads:[~2026-07-16 8:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 16:00 [PATCH docs/manager/storage v9 0/5] fix #7339: lvmthick: add option to free storage for deleted VMs Lukas Sichert
2026-07-13 16:00 ` [PATCH storage v9 1/5] lvm: saferemove: keep LVs where zero-out failed for manual zero-out Lukas Sichert
2026-07-15 10:26 ` Fiona Ebner
2026-07-16 9:37 ` Michael Köppl
2026-07-13 16:00 ` [PATCH storage v9 2/5] lvm: saferemove: zero out volumes range by range Lukas Sichert
2026-07-15 10:26 ` Fiona Ebner
2026-07-13 16:00 ` [PATCH storage v9 3/5] fix #7339: lvm: add discard action for removed volumes Lukas Sichert
2026-07-15 10:26 ` Fiona Ebner
2026-07-16 10:46 ` Lukas Sichert
2026-07-13 16:00 ` [PATCH manager v9 4/5] fix #7339: lvm: add discard-on-remove option to UI Lukas Sichert
2026-07-15 10:26 ` Fiona Ebner
2026-07-16 8:49 ` Michael Köppl [this message]
2026-07-13 16:00 ` [PATCH docs v9 5/5] fix #7339: lvm: document discard option Lukas Sichert
2026-07-15 10:26 ` 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=DJZV7CRW9TDO.1G55ORI2J561R@proxmox.com \
--to=m.koeppl@proxmox.com \
--cc=l.sichert@proxmox.com \
--cc=pve-devel@lists.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.