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

Dietmar Maurer dietmar at proxmox.com
Tue Mar 1 12:04:10 CET 2016


applied, but I wonder if we can display more useful infos, like "qm list"?

> On March 1, 2016 at 11:07 AM Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
> 
> 
> 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
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list