]> xenbits.xensource.com Git - libvirt.git/commit
virsh: don't override connection URI from argv
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Thu, 21 Apr 2016 06:32:00 +0000 (09:32 +0300)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Thu, 21 Apr 2016 06:37:48 +0000 (09:37 +0300)
commit0217089b89af757192302cb78fd0f248b3256baf
tree2a46a223b4c849d92ba3fb6e677d9f2d32025311
parent003fa6d676b44bca3f5d3d0c71f475d37cf3285d
virsh: don't override connection URI from argv

Currently, if a connection URI was specified on the command line by the
'-c' switch, virsh connects to it, but after connecting overrides its
value with the one it tries to obtain from the VIRSH_DEFAULT_CONNECT_URI
environment variable.

This makes virsh connecting to the wrong URI if it disconnects from the
hypervisor and then tries to reconnect, and also leaks the original connname.

Fix by calling virGetEnvBlockSUID() before virshParseArgv().
tools/virsh.c