[pve-devel] [PATCH common] add upid_wait method

Dietmar Maurer dietmar at proxmox.com
Fri Jan 22 18:24:44 CET 2016


> +sub upid_wait {
> +    my ($upid, $waitfunc, $sleep_intervall) = @_;
> +
> +    my $task = upid_decode($upid);
> +
> +    $sleep_intervall = $sleep_intervall ? $sleep_intervall : 1;
> +
> +    while (PVE::ProcFSTools::check_process_running($task->{pid},
> $task->{pstart})) {
> +
> +	&$waitfunc($task) if $waitfunc && ref($waitfunc) eq 'CODE';

I would completely remove this waitfunc() code.

If someone need this, he can implement the loop himself..

sub upid_wait {
   my ($upid) = @_;
...




More information about the pve-devel mailing list