[PATCH] util: virdaemon: fix waiting for child processes

Ján Tomko jtomko at redhat.com
Wed Apr 8 09:15:57 UTC 2020


On a Wednesday in 2020, Rafael Fonseca wrote:
>On Tue, 7 Apr 2020, 22:14 Rafael Fonseca, <r4f4rfs at gmail.com> wrote:
>
>> Unlike `waitpid`, `virProcessWait` only returns -1 (error) or 0
>> (success), so comparing that to `pid` will always be false and the
>> parent will report failure with:
>>
>> error : main:851 : Failed to fork as daemon: No such file or directory
>>
>> even though the grandchild process is succesfully running. Note that the
>> errno message is misleading: it was last set when trying to find a
>> restart state file.
>
>Thanks to Marcin Krol who found the issue and helped me debug it.

You can record his contribution in the git history if you'd like,
e.g.
Reported-by: Marcin Krol <his-e-mail>

Not sure there is a standard tag used for people helping with debugging.


The patch itself looks good to me, although thanks to use of these
helpers some code paths will report an error twice.

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200408/314c6867/attachment-0001.sig>


More information about the libvir-list mailing list