Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-11 Thread Daniel P . Berrangé
On Mon, Mar 11, 2019 at 10:49:45AM +0100, Erik Skultety wrote: > On Mon, Mar 11, 2019 at 09:46:11AM +, Daniel P. Berrangé wrote: > > On Mon, Mar 11, 2019 at 09:33:30AM +0100, Michal Privoznik wrote: > > > On 3/11/19 9:02 AM, Erik Skultety wrote: > > > > On Sat, Mar 09, 2019 at 04:32:00PM +0100,

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-11 Thread Erik Skultety
On Mon, Mar 11, 2019 at 09:46:11AM +, Daniel P. Berrangé wrote: > On Mon, Mar 11, 2019 at 09:33:30AM +0100, Michal Privoznik wrote: > > On 3/11/19 9:02 AM, Erik Skultety wrote: > > > On Sat, Mar 09, 2019 at 04:32:00PM +0100, Michal Prívozník wrote: > > > > On 3/1/19 2:31 AM, Shawn Anastasio wro

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-11 Thread Daniel P . Berrangé
On Mon, Mar 11, 2019 at 09:33:30AM +0100, Michal Privoznik wrote: > On 3/11/19 9:02 AM, Erik Skultety wrote: > > On Sat, Mar 09, 2019 at 04:32:00PM +0100, Michal Prívozník wrote: > > > On 3/1/19 2:31 AM, Shawn Anastasio wrote: > > > > Hello all, > > > > > > > > I'm currently writing a C program th

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-11 Thread Michal Privoznik
On 3/11/19 9:02 AM, Erik Skultety wrote: On Sat, Mar 09, 2019 at 04:32:00PM +0100, Michal Prívozník wrote: On 3/1/19 2:31 AM, 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. Spec

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-11 Thread Erik Skultety
On Sat, Mar 09, 2019 at 04:32:00PM +0100, Michal Prívozník wrote: > On 3/1/19 2:31 AM, 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

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-09 Thread Shawn Anastasio
On 3/9/19 1:14 PM, Peter Crowther wrote: Use a tiny setuid C program that reads the relevant file and writes it to a known UNIX-domain socket that has more liberal permissions? Indeed this is a possibility, but I was hoping for a cleaner solution that fit in with libvirt's existing authenticati

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-09 Thread Peter Crowther
On Sat, 9 Mar 2019 at 17:27, Shawn Anastasio wrote: > Thanks for the response. /var/run/libvirt/qemu/ seems to be exactly what > I'm looking for. It would, however, be nice to be able to access this > file without root privileges. > Use a tiny setuid C program that reads the relevant file and wr

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-09 Thread Shawn Anastasio
Thanks for the response. /var/run/libvirt/qemu/ seems to be exactly what I'm looking for. It would, however, be nice to be able to access this file without root privileges. Is there any way to access the file using the credentials from a connected virConnectPtr? If not, I can stick to my curre

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-09 Thread Michal Prívozník
On 3/1/19 2:31 AM, 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 conn

Re: [libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-03-08 Thread Cole Robinson
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 con

[libvirt-users] Obtaining the PID of a domain's QEMU process from C

2019-02-28 Thread Shawn Anastasio
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