Bug 1577842

Summary: RFE: make UNIX socket path configurable for virtlockd/virtlogd
Product: [Community] Virtualization Tools Reporter: mathieu.tarral
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, libvirt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mathieu.tarral 2018-05-14 09:10:10 UTC
Description of problem:

Compile and install libvirt in $HOME/usr

If you edit /etc/libvirt/libvirtd.conf to set 
unix_sock_dir = "/var/run/libvirt",

virLogManagerDaemonPath() will not read the configuration file, and still try to connect to LOCALSTATEDIR/run/libvirt/virtlogd-sock, which is wrong.


Version-Release number of selected component (if applicable):
3.0.0

How reproducible:
always


Steps to Reproduce:
1. compile and install libvirt 3.0.0 to $HOME/usr
2. edit $HOME/usr/etc/libvirt/libvirtd.conf, and set /run/libvirt/virtlogd-sock
3. run $HOME/usr/sbin/libvirtd
4. run $HOME/usr/sbin/virtlogd
4. try to start a VM

Actual results:
It fails because libvirt tries to connect to the wrong socket path.

Expected results:
libvirt should connect to /var/run/libvirt/virtlogd-sock

Additional info:
Discussed on the mailing list with Martin Kletzander.

Could you provide a fix ?
I don't really have the time to learn how to contribute to libvirt.

Thanks !

Comment 1 Daniel Berrangé 2018-05-14 09:30:51 UTC
Err, if you've set configure --prefix  to install into $HOME/user, then /etc/libvirt/libvirtd.conf is no longer the right path.

Unless you set an explicit --sysconfdir=/etc arg to configure, the right config file is going to be $HOME/usr/etc/libvirt/libvirtd.conf

Comment 2 mathieu.tarral 2018-05-14 10:24:32 UTC
Hi Daniel,

There is a word missing here in my initial report:

> If you edit /etc/libvirt/libvirtd.conf to set 
> unix_sock_dir = "/var/run/libvirt",

should be

If you edit $HOME/usr/etc/libvirt/libvirtd.conf to set 
unix_sock_dir = "/var/run/libvirt",

As you said:
> the right config file is going to be $HOME/usr/etc/libvirt/libvirtd.conf
yes, and the bug is that  virLogManagerDaemonPath() doesn't read this config file to get the unix_sock_dir location.

Is this more clear ?
Thanks.

Comment 3 Daniel Berrangé 2018-05-14 10:48:33 UTC
Note that the libvirtd.conf file is only for configuring libvirtd daemon - it has no impact on virtlogd or virtlockd, which have their own configuration files.

Now, neither virtlogd.conf or virtlockd.conf support changing unix_sock_dir right now, so that would be an RFE.

If we make those paths configurable, we'll also need another config file option to set the path for the client to use, as those config files are both for the server side.