Bug 538378

Summary: Would be nice to provide virsh with defaults in config file for connection
Product: [Community] Virtualization Tools Reporter: Olivier Berger <olivier.berger>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, mh+redhat-bugzilla-2011, mkletzan, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-08 11:38:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Olivier Berger 2009-11-18 12:41:16 UTC
Description of problem:

virsh seems to have no other way to specify the default connection it has to use other than by environment var VIRSH_DEFAULT_CONNECT_URI

It would be great to be able to store this in a kind of ~/.virshrc file

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

0.7.2

How reproducible:

All times

This is obviously a wishlist.

Comment 1 Ján Tomko 2015-03-16 16:49:30 UTC
*** Bug 732364 has been marked as a duplicate of this bug. ***

Comment 2 Martin Kletzander 2015-04-08 11:38:17 UTC
There is a possibility to setting the default connection (even without using an alias or shell wrapper function) in cat ~/.config/libvirt/libvirt.conf; that file has the same syntax as the system-wide config file /etc/libvirt/libvirt.conf, but sets it for the user only.  Also applies to all connections, not just virsh.

Example config file is the system-wide one, we cannot initialize example file for all users on the system during installation.  Therefore I believe this bug is fixed.