$d->{disk} = 0;
# use 4GB by default ??
if (my $rootfs = $conf->{rootfs}) {
- my $rootinfo = PVE::LXC::Config->parse_ct_rootfs($rootfs);
+ my $rootinfo = PVE::LXC::Config->parse_volume('rootfs', $rootfs);
$d->{maxdisk} = $rootinfo->{size} || (4*1024*1024*1024);
} else {
$d->{maxdisk} = 4*1024*1024*1024;
die "missing 'rootfs' configuration\n"
if !defined($conf->{rootfs});
- my $mountpoint = PVE::LXC::Config->parse_ct_rootfs($conf->{rootfs});
+ my $mountpoint = PVE::LXC::Config->parse_volume('rootfs', $conf->{rootfs});
$raw .= "lxc.rootfs.path = $dir/rootfs\n";
sub destroy_lxc_container {
my ($storage_cfg, $vmid, $conf, $replacement_conf) = @_;
- PVE::LXC::Config->foreach_mountpoint($conf, sub {
+ PVE::LXC::Config->foreach_volume_full($conf, {include_unused => 1}, sub {
my ($ms, $mountpoint) = @_;
delete_mountpoint_volume($storage_cfg, $vmid, $mountpoint->{volume});
});
my $storecfg = PVE::Storage::config();
- PVE::LXC::Config->foreach_mountpoint($conf, sub {
+ PVE::LXC::Config->foreach_volume($conf, sub {
my ($ms, $mountpoint) = @_;
my $volid = $mountpoint->{volume};
if !PVE::Storage::volume_has_feature($storecfg, 'template', $volid);
});
- PVE::LXC::Config->foreach_mountpoint($conf, sub {
+ PVE::LXC::Config->foreach_volume($conf, sub {
my ($ms, $mountpoint) = @_;
my $volid = $mountpoint->{volume};
} elsif ($opt eq 'rootfs' || $opt =~ /^mp\d+$/) {
$rpcenv->check_vm_perm($authuser, $vmid, $pool, ['VM.Config.Disk']);
return if $delete;
- my $data = $opt eq 'rootfs' ? PVE::LXC::Config->parse_ct_rootfs($newconf->{$opt})
- : PVE::LXC::Config->parse_ct_mountpoint($newconf->{$opt});
+ my $data = PVE::LXC::Config->parse_volume($opt, $newconf->{$opt});
raise_perm_exc("mount point type $data->{type} is only allowed for root\@pam")
if $data->{type} ne 'volume';
} elsif ($opt eq 'memory' || $opt eq 'swap') {
my $res = 1;
- PVE::LXC::Config->foreach_mountpoint_reverse($conf, sub {
+ PVE::LXC::Config->foreach_volume_full($conf, {'reverse' => 1}, sub {
my ($ms, $mountpoint) = @_;
my $volid = $mountpoint->{volume};
my (undef, $rootuid, $rootgid) = parse_id_maps($conf);
eval {
- PVE::LXC::Config->foreach_mountpoint($conf, sub {
+ PVE::LXC::Config->foreach_volume($conf, sub {
my ($ms, $mountpoint) = @_;
$mountpoint->{ro} = 0 if $ignore_ro;
my (undef, $rootuid, $rootgid) = PVE::LXC::parse_id_maps($conf);
my $chown_vollist = [];
- PVE::LXC::Config->foreach_mountpoint($settings, sub {
+ PVE::LXC::Config->foreach_volume($settings, sub {
my ($ms, $mountpoint) = @_;
my $volid = $mountpoint->{volume};
}
};
- PVE::LXC::Config->foreach_mountpoint($conf, $update_mp);
+ PVE::LXC::Config->foreach_volume($conf, $update_mp);
return $changes;
}