]> xenbits.xensource.com Git - libvirt.git/commit
Fix connection to already running session libvirtd
authorChristophe Fergeau <cfergeau@redhat.com>
Thu, 28 Aug 2014 21:33:24 +0000 (23:33 +0200)
committerChristophe Fergeau <cfergeau@redhat.com>
Mon, 1 Sep 2014 09:20:32 +0000 (11:20 +0200)
commit0f03ca6d2952718778546bdafb097a1c6efb6359
treed5aacbfa36059382f92931656791c7d348c85ebb
parentc4d2a10238d9534b8bd16eeba27126275339ddba
Fix connection to already running session libvirtd

Since 1b807f92, connecting with virsh to an already running session
libvirtd fails with:
$ virsh list --all
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to
'/run/user/1000/libvirt/libvirt-sock': Transport endpoint is already
connected

This is caused by a logic error in virNetSocketNewConnectUnix: even if
the connection to the daemon socket succeeded, we still try to spawn the
daemon and then connect to it.
This commit changes the logic to not try to spawn libvirtd if we
successfully connected to its socket.

Most of this commit is whitespace changes, use of -w is recommended to
look at it.
src/rpc/virnetsocket.c