]> git.proxmox.com Git - pve-container.git/commitdiff
close #1478: add check for unsupported config
authorPhilip Abernethy <p.abernethy@proxmox.com>
Wed, 23 Aug 2017 15:04:37 +0000 (17:04 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Sep 2017 06:54:46 +0000 (08:54 +0200)
Adds a check if an unprivileged container is configured to use
quota on any of its mountpoints. If so an understandable error
message is given. Ideally I'd like to catch those
configurations on the GUI, too, to avoid users just running
into it.

src/PVE/API2/LXC/Status.pm

index 89a2fca37a64c846ab7e5d001c4911fd5caf4150..0d24ea6b179a5ef9cba36b0da52839d8e787aaf8 100644 (file)
@@ -177,6 +177,14 @@ __PACKAGE__->register_method({
                        PVE::LXC::Config->check_lock($conf);
                    }
 
+                   if ($conf->{unprivileged}) {
+                       PVE::LXC::Config->foreach_mountpoint($conf, sub {
+                           my ($ms, $mountpoint) = @_;
+                           die "Quotas are not supported by unprivileged containers.\n" if $mountpoint->{quota};
+                       });
+
+                   }
+
                    my $storage_cfg = cfs_read_file("storage.cfg");
 
                    PVE::LXC::update_lxc_config($vmid, $conf);