libvirt/tools
Eric Blake d218344e6c virsh: optimize creation of default connection
Ramon de Carvalho Valle reported a problem with:
virsh connect qemu:///system
as a non-root user.  The real root problem appears to be a regression
in libvirtd being auto-started on the default qemu:///session URI;
however, the symptom points to an independent flaw in virsh - we
shouldn't be wasting efforts on making a connection if we aren't going
to be using that connection.  Fixing virsh avoids Ramon's issue, while
I work in the meantime to fix the real libvirtd regression.

This patch looks big, but that's because 'gcc -Wmissing-field-initializers'
gets triggered by './autobuild.sh --enable-compile-warnings=error', so I
had to add 0 initialization to everyone (rather than my preference of
just adding the non-zero flags to virshCmds and to cmdConnect).

Meanwhile, if you use 'virsh -c URI', the connection must succeed; this
patch _only_ optimizes the default connection to be deferred to a later
point where we know if a particular command to be run needs a connection.

* tools/virsh.c (VSH_CMD_FLAG_NOCONNECT): New flag.
(vshCmdDef): Add new flags field.
(vshCommandRun): Honor new flag.
(domManagementCmds, domMonitoringCmds, storagePoolCmds)
(storageVolCmds, networkCmds, nodedevCmds, ifaceCmds)
(nwfilterCmds, secretCmds, virshCmds, snapshotCmds)
(hostAndHypervisorCmds): Populate new field.
(vshReconnect): Don't warn on initial connection.
2011-05-18 12:47:46 -06:00
..
.gitignore maint: track moved file 2010-08-31 10:00:31 -06:00
Makefile.am virsh: nuke use of TRUE and FALSE 2011-04-19 08:16:14 -06:00
console.c virsh: Free stream when shutdown console 2011-03-14 15:11:03 +08:00
console.h Re-write virsh console to use streams 2010-11-11 16:03:20 +00:00
libvirt-guests.init.sh libvirt-guests: implement START_DELAY 2011-04-15 11:15:06 -06:00
libvirt-guests.sysconf libvirt-guests: implement START_DELAY 2011-04-15 11:15:06 -06:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh.c virsh: optimize creation of default connection 2011-05-18 12:47:46 -06:00
virsh.pod virsh: add parameters --live, --config and --current to cmd schedinfo 2011-05-17 10:52:16 -06:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virt-pki-validate.in virt-*-validate.in: quote all variable references 2011-02-21 10:32:34 -07:00
virt-xml-validate.in virt-*-validate.in: quote all variable references 2011-02-21 10:32:34 -07:00