[pve-devel] [PATCH container] Add unused volume when mp is modified

Dietmar Maurer dietmar at proxmox.com
Wed Feb 17 10:50:30 CET 2016


comments inline

> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index a737fc0..84aba83 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -1352,6 +1352,12 @@ sub update_pct_config {
>          } elsif ($opt =~ m/^mp(\d+)$/) {
>  	    next if $hotplug_error->($opt);
>  	    check_protection($conf, "can't update CT $vmid drive '$opt'");
> +	    if (defined($conf->{$opt})) {
> +		my $mountpoint = parse_ct_mountpoint($conf->{$opt});
> +		if ($mountpoint->{type} eq 'volume') {
> +		    add_unused_volume($conf, $mountpoint->{volume})

what is $mountpoint->{volume} is unchanged?

> +		}
> +	    }
>  	    $conf->{$opt} = $value;
>  	    $new_disks = 1;
>          } elsif ($opt eq 'rootfs') {

We can also set rootfs, so we need to handle unused volumes here too.




More information about the pve-devel mailing list