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

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jan 26 10:08:10 CET 2016



Il 26 gennaio 2016 06:33:50 CET, Dietmar Maurer <dietmar at proxmox.com> ha scritto:
>comments inline:
>
>> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
>> index 64a57e9..58d943c 100644
>> --- a/src/PVE/Tools.pm
>> +++ b/src/PVE/Tools.pm
>> @@ -940,6 +940,26 @@ sub upid_read_status {
>>      return "unable to read tail (got $br bytes)";
>>  }
>>  
>> +sub upid_wait {
>> +    my ($upid, $waitfunc, $sleep_intervall) = @_;
>> +
>> +    my $task = upid_decode($upid);
>> +
>> +    $sleep_intervall = $sleep_intervall ? $sleep_intervall : 1;
>> +
>> +    my $next_time = time + $sleep_intervall;
>> +
>> +    while (PVE::ProcFSTools::check_process_running($task->{pid},
>> $task->{pstart})) {
>
>You use PVE::ProcFSTools here, without adding a 'use' clause for that
>library. It also introduces a cyclic library dependency:
>
>PVE::Tools ==> PVE::ProcFSTools ==> PVE::Tools
>
>So I guess PVE::ProcFSTools would be a better place for this helper?

Oh yes it is, was deluded by the other upid helper functions here...

Will resend with also the respined version for the ha-manager where I'd use this function.




More information about the pve-devel mailing list