Bug 996986 - virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf
Summary: virsh does not honor uri_default setting in /etc/libvirt/libvirt.conf
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-14 12:16 UTC by James Slagle
Modified: 2013-08-14 13:02 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-14 13:02:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description James Slagle 2013-08-14 12:16:12 UTC
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 Berrangé 2013-08-14 12:33:51 UTC
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 12:55:15 UTC
(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 Berrangé 2013-08-14 13:02:02 UTC
(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.