Description of problem: virsh connect should reconnect local hypervisor when connected a bad hypervisor and failed libvirt connection should reconnect local hypervisor after connect a bad hypervisor Version-Release number of selected component (if applicable): libvirt-0.9.10-21.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.# virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # connect test error: Failed to connect to the hypervisor error: no connection driver available for No connection for URI test error: Failed to reconnect to the hypervisor virsh # list error: Failed to reconnect to the hypervisor error: no valid connection error: no connection driver available for No connection for URI test error: Failed to reconnect to the hypervisor virsh # connect virsh # list Id Name State ---------------------------------------------------- Actual results: libvirt connection is broken after connect a bad hyperv Expected results: libvirt connection is not broken after connect a bad hyperv Additional info: if user want to continue use virsh after connect a bad hypervisor,he must connect a valid hypervisor manualed ,so if libvirt can restore a valid hypervisor to user after a bad connection ,this is a good user experience
Disussion in upstream. https://www.redhat.com/archives/libvir-list/2012-June/msg00270.html
I sent a patch upstream: http://www.redhat.com/archives/libvir-list/2016-April/msg01349.html
Pushed upstream now: commit a02a859be40ab49b79cc3c4ff4d735878139cf30 Author: Cole Robinson <crobinso> Date: Wed Apr 20 13:56:27 2016 -0400 virsh: Don't clear old connection if 'connect $uri' fails