[pve-devel] [RFC pve-container 2/2] destroy owned mountpoints on pct destroy
Dietmar Maurer
dietmar at proxmox.com
Thu Sep 3 11:15:18 CEST 2015
applied
On 09/01/2015 04:33 PM, Wolfgang Bumiller wrote:
> ---
> src/PVE/LXC.pm | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index bf2a964..5f23532 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -1263,11 +1263,12 @@ sub get_primary_ips {
> sub destroy_lxc_container {
> my ($storage_cfg, $vmid, $conf) = @_;
>
> - my $rootinfo = parse_ct_mountpoint($conf->{rootfs});
> - if (defined($rootinfo->{volume})) {
> - my ($vtype, $name, $owner) = PVE::Storage::parse_volname($storage_cfg, $rootinfo->{volume});
> - PVE::Storage::vdisk_free($storage_cfg, $rootinfo->{volume}) if $vmid == $owner;;
> - }
> + foreach_mountpoint($conf, sub {
> + my ($ms, $mountpoint) = @_;
> + my ($vtype, $name, $owner) = PVE::Storage::parse_volname($storage_cfg, $mountpoint->{volume});
> + PVE::Storage::vdisk_free($storage_cfg, $mountpoint->{volume}) if $vmid == $owner;
> + });
> +
> rmdir "/var/lib/lxc/$vmid/rootfs";
> unlink "/var/lib/lxc/$vmid/config";
> rmdir "/var/lib/lxc/$vmid";
More information about the pve-devel
mailing list