From 312e9850301a4524deff7d0c47a76f250d492eb3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 27 Jan 2016 11:10:22 +0100 Subject: [PATCH] lxc.rootfs and lxc.rootfs.options are now invalid lxc.rootfs has been a conflicting option already but now lxc.rootfs.options is too $valid_lxc_conf_keys can now containe an optional warning to be printed when such a key is used. --- src/PVE/LXC.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 01610dc..4645e86 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -231,9 +231,10 @@ my $valid_lxc_conf_keys = { 'lxc.mount' => 1, 'lxc.mount.entry' => 1, 'lxc.mount.auto' => 1, - 'lxc.rootfs' => 1, + 'lxc.rootfs' => 'lxc.rootfs is auto generated from rootfs', 'lxc.rootfs.mount' => 1, - 'lxc.rootfs.options' => 1, + 'lxc.rootfs.options' => 'lxc.rootfs.options is not supported' . + ', please use mountpoint options in the "rootfs" key', # lxc.cgroup.* 'lxc.cap.drop' => 1, 'lxc.cap.keep' => 1, @@ -504,8 +505,10 @@ sub parse_pct_config { if ($line =~ m/^(lxc\.[a-z0-9_\-\.]+)(:|\s*=)\s*(.*?)\s*$/) { my $key = $1; my $value = $3; - if ($valid_lxc_conf_keys->{$key} || $key =~ m/^lxc\.cgroup\./) { + if ($valid_lxc_conf_keys->{$key} eq 1 || $key =~ m/^lxc\.cgroup\./) { push @{$conf->{lxc}}, [$key, $value]; + } elsif (my $errmsg = $valid_lxc_conf_keys->{$key}) { + warn "vm $vmid - $key: $errmsg\n"; } else { warn "vm $vmid - unable to parse config: $line\n"; } -- 2.39.2