[libvirt] [PATCH 1/4] qemu: fix wrong errno report in qemuMonitorOpenUnix

Jincheng Miao jmiao at redhat.com
Wed Jul 16 03:24:25 UTC 2014


----- Original Message -----
> virProcessKill can be called on cleanup paths. I think it might be wiser
> to rewrite virProcessKill() to guarantee that it does not modify errno
> than it is to make all callers have to store a temporary.

Hi Eric,

this virProcessKill only test whether this process is alive, I think it
shouldn't be moved to cleanup path. :P

Yes, this is a special use case of virProcessKill in qemuMonitorOpenUnix.
But for other use case of virProcessKill, I think errno is really needed,
some useful error information will be stored to errno:
EINVAL, EPERM, ESRCH.

So if we want to guarantee caller no need to store a temporary errno in
this curcirmstance, we could just rewrite virProcessKill when signum == 0,
do not overwrite errno when failure.

> 
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 




More information about the libvir-list mailing list