[pve-devel] [PATCH] fix hotplug ip configuration

Dietmar Maurer dietmar at proxmox.com
Mon Jun 29 12:52:44 CEST 2015


> +sub find_lxc_pid {
> +    my ($vmid) = @_;
> +
> +    my $pid = undef;
> +    my $parser = sub {
> +	my $line = shift;
> +	$pid = $1 if $line =~ m/PID:\s+(\d+)/;
> +    };
> +    PVE::Tools::run_command(['lxc-info', '-n', $vmid], outfunc => $parser);
> +
> +   return $pid;
> +}
> +

I wonder if we can avoid running lxc-info, by using something similar 
we have in:

sub find_lxc_console_pids { ... }

We can get the pids of all running containers, including pids for console,
and we can also replace list_active_containers() ?



More information about the pve-devel mailing list