[pve-devel] [TRIVIAL PATCH pve-container] Only get PID info in fin_lxc_pid sub

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 30 14:40:14 CEST 2015


with the -p switch lxc-info only ouputs the PID line,
this makes the call quite a bit faster.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 3fdce0f..8b2fb88 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -990,7 +990,7 @@ sub find_lxc_pid {
         my $line = shift;
         $pid = $1 if $line =~ m/^PID:\s+(\d+)$/;
     };
-    PVE::Tools::run_command(['lxc-info', '-n', $vmid], outfunc => $parser);
+    PVE::Tools::run_command(['lxc-info', '-n', $vmid, '-p'], outfunc => $parser);
 
     die "unable to get PID for CT $vmid (not running?)\n" if !$pid;
 
-- 
2.1.4




More information about the pve-devel mailing list