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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- 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
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]