[pve-devel] [PATCH container] pct list: Add a 'Lock' column

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Mar 1 11:07:49 CET 2016


This seems more useful than a 'mounted' state as a
mount-locked container can also be running.
---
 src/PVE/CLI/pct.pm | 6 +++---
 src/PVE/LXC.pm     | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index e599353..6e7fcc0 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -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'], 
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 663a680..b8ff98a 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -797,6 +797,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};
-- 
2.1.4





More information about the pve-devel mailing list