]> git.proxmox.com Git - pve-container.git/commitdiff
fix #2820: don't hotplug over existing mpX
authorOguz Bektas <o.bektas@proxmox.com>
Thu, 2 Jul 2020 10:10:23 +0000 (12:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Jul 2020 10:38:50 +0000 (12:38 +0200)
check if the given mpX already exists in the config.  if it does, then
skip hotplugging and write the changes to [pve:pending] for the next
reboot of CT.

after rebooting the CT, the preexisting mpX will be added as unused and
the mpX will be mounted.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC/Config.pm

index edd587bdccf02c5c2ad7540512f847b7748212f4..5bf12d56286fa337fde36ef7cabf87b41ee53f7f 100644 (file)
@@ -1262,6 +1262,10 @@ sub vmconfig_hotplug_pending {
                    die "skip\n";
                }
 
+               if (exists($conf->{$opt})) {
+                   die "skip\n"; # don't try to hotplug over existing mp
+               }
+
                $class->apply_pending_mountpoint($vmid, $conf, $opt, $storecfg, 1);
                # apply_pending_mountpoint modifies the value if it creates a new disk
                $value = $conf->{pending}->{$opt};