[pve-devel] [PATCH container] fix #2820: block adding new volume with same id if it's pending delete
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Jul 1 09:11:56 CEST 2020
On June 30, 2020 3:56 pm, Oguz Bektas wrote:
> do a simple check to see if our $opt is already in the delete section.
>
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
> src/PVE/LXC/Config.pm | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 0a28380..237e2e5 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -974,6 +974,9 @@ sub update_pct_config {
> my $value = $param->{$opt};
> if ($opt =~ m/^mp(\d+)$/ || $opt eq 'rootfs') {
> $class->check_protection($conf, "can't update CT $vmid drive '$opt'");
> + if ($conf->{pending}->{delete} =~ m/$opt/) {
this is incomplete:
- $conf->{pending} or $conf->{pending}->{delete} might be undef
- the matching is fuzzy (e.g., there might be a pending deletion of
mp10, and we are currently hotplugging mp1)
- we can actually just put the new mpX into the pending queue, and
remove the entry from the pending deletion queue? (it's hotplugging
that is the problem, not queuing the pending change)
> + die "${opt} is in pending delete queue. please select another mountpoint ID\n";
> + }
> my $mp = $class->parse_volume($opt, $value);
> $check_content_type->($mp) if ($mp->{type} eq 'volume');
> } elsif ($opt eq 'hookscript') {
> --
> 2.20.1
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
More information about the pve-devel
mailing list