]> xenbits.xensource.com Git - libvirt.git/commit
tools: Fix connect command
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 21 Apr 2016 12:06:10 +0000 (14:06 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 2 May 2016 05:18:25 +0000 (07:18 +0200)
commit0c56d94318393a8295cc0613abb6097a6fd60002
tree3f1d29cf5321e79a67f548db14249f5e8cc76189
parentc0730e4d1277f70d591c465ce8bcaf5a3b310830
tools: Fix connect command

The man page says: "(Re)-Connect to the hypervisor. When the shell is
first started, this is automatically run with the URI parameter
requested by the "-c" option on the command line."  However, if you run:

  virsh -c 'test://default' 'connect; uri'

the output will not be 'test://default'.  That's because the 'connect'
command does not care about any virsh-only related settings and if it is
run without parameters, it connects with @uri == NULL.  Not only that
doesn't comply to what the man page describes, but it also doesn't make
sense.  It also means you aren't able to reconnect to whatever you are
connected currently.

So let's fix that in both virsh and virt-admin add a test case for it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
tests/test-lib.sh
tests/virsh-uriprecedence
tools/virsh.c
tools/virt-admin.c