]> git.proxmox.com Git - pve-container.git/commitdiff
pct list: Add a 'Lock' column
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 1 Mar 2016 10:07:49 +0000 (11:07 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 1 Mar 2016 11:02:28 +0000 (12:02 +0100)
This seems more useful than a 'mounted' state as a
mount-locked container can also be running.

src/PVE/CLI/pct.pm
src/PVE/LXC.pm

index e5993534a6dbb18ffd9480f83d78d453d7b07ec1..6e7fcc03f488ab188c26030e12b8799da1b848de 100755 (executable)
@@ -510,10 +510,10 @@ our $cmddef = {
     list=> [ 'PVE::API2::LXC', 'vmlist', [], { node => $nodename }, sub {
        my $res = shift;
        return if !scalar(@$res);
-       my $format = "%-10s %-10s %-20s\n";
-       printf($format, 'VMID', 'Status', 'Name');
+       my $format = "%-10s %-10s %-12s %-20s\n";
+       printf($format, 'VMID', 'Status', 'Lock', 'Name');
        foreach my $d (sort {$a->{vmid} <=> $b->{vmid} } @$res) {
-           printf($format, $d->{vmid}, $d->{status}, $d->{name});
+           printf($format, $d->{vmid}, $d->{status}, $d->{lock}, $d->{name});
        }
     }],
     config => [ "PVE::API2::LXC::Config", 'vm_config', ['vmid'], 
index 3cb3d4839c352c40710e14657f25714844b02613..096c88b16ac1e865f5b088056c9e1fdf015b7640 100644 (file)
@@ -810,6 +810,8 @@ sub vmstatus {
 
        $d->{cpus} = $conf->{cpulimit} || $cpucount;
 
+       $d->{lock} = $conf->{lock} || '';
+
        if ($d->{pid}) {
            my $res = get_container_disk_usage($vmid, $d->{pid});
            $d->{disk} = $res->{used};