Re: Obtaining the PID of a domain's QEMU process from C

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

 



On 2/28/19 8:31 PM, Shawn Anastasio wrote:
> Hello all,
> 
> I'm currently writing a C program that uses the libvirt API and I need a
> way to obtain the pid of a given domain's QEMU process.
> 
> Specifically, I'm writing an ivshmem server that uses SO_PEERCRED to get
> the pid of clients that connect to it, and I would like to use that pid
> to look up the domain in libvirt to determine the proper domain ID to
> return to the client.
> 
> As far as I can tell, libvirt doesn't expose this information in an easy
> to access manner. Of course it is possible to call `ps` and grep for the
> information I'm looking for, but I was hoping for a cleaner solution.
> 
> If anybody knows how to do this, advice would be greatly appreciated.
> 
> Thanks in advance,

There isn't any libvirt API for getting the qemu pid, so I think going
outside libvirt is your only option

- Cole

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users



[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux