Bug 996986 - virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf
virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-14 08:16 EDT by James Slagle
Modified: 2013-08-14 09:02 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-14 09:02:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Slagle 2013-08-14 08:16:12 EDT
Description of problem:
virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf.
I have 'uri_default = "qemu:///system"' uncommented in /etc/libvirt/libvirt.conf but running 'virsh uri' shows that I'm still connecting to qemu:///session.

Version-Release number of selected component (if applicable):
[root@dublin libvirt]# rpm -q libvirt libvirt-client
libvirt-1.0.5.5-1.fc19.x86_64
libvirt-client-1.0.5.5-1.fc19.x86_64


How reproducible:
[jslagle@dublin ~]$ grep uri_default /etc/libvirt/libvirt.conf
uri_default = "qemu:///system"
[jslagle@dublin ~]$ virsh uri
qemu:///session
(I tried restarting libvirtd as well, but that had no effect)

Note that setting the value in ~/.config/libvirt/libvirt.conf does work:
[jslagle@dublin ~]$ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf
[jslagle@dublin ~]$ virsh uri
qemu:///system


Actual results:
I'm still connecting to qemu:///session

Expected results:
should be connected to qemu:///system

Additional info:
Comment 1 Daniel Berrange 2013-08-14 08:33:51 EDT
The test steps you list work fine for me.

$ virsh uri
qemu:///session
$ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf
$ virsh uri
qemu:///system


Do you have either LIBVIRT_DEFAULT_URI or VIRSH_DEFAULT_CONNECT_URI env variables set ? Those will override what's in the config file.
Comment 2 James Slagle 2013-08-14 08:55:15 EDT
(In reply to Daniel Berrange from comment #1)
> The test steps you list work fine for me.
> 
> $ virsh uri
> qemu:///session
> $ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf
> $ virsh uri
> qemu:///system

Yes, setting the value in ~/.config/libvirt/libvirt.conf does work for me as I noted.

Setting it in /etc/libvirt/libvirt.conf is what does not work.

> Do you have either LIBVIRT_DEFAULT_URI or VIRSH_DEFAULT_CONNECT_URI env
> variables set ? Those will override what's in the config file.

No.
Comment 3 Daniel Berrange 2013-08-14 09:02:02 EDT
(In reply to James Slagle from comment #2)
> (In reply to Daniel Berrange from comment #1)
> > The test steps you list work fine for me.
> > 
> > $ virsh uri
> > qemu:///session
> > $ echo uri_default = \"qemu:///system\" >> ~/.config/libvirt/libvirt.conf
> > $ virsh uri
> > qemu:///system
> 
> Yes, setting the value in ~/.config/libvirt/libvirt.conf does work for me as
> I noted.
> 
> Setting it in /etc/libvirt/libvirt.conf is what does not work.

That works if you are running virsh as root. The /etc/libvirt directory is intentionally not readable by non-root users, since some of the files there may contain passwords.

Note You need to log in before you can comment on or make changes to this bug.