Bug 721322

Summary: virsh connect failed if specify "unix_sock_dir" in libvirtd configuration file
Product: Red Hat Enterprise Linux 6 Reporter: Huang Wenlong <whuang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.2CC: berrange, cwei, dallan, dyuan, mzhan, rwu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-14 19:15:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Huang Wenlong 2011-07-14 09:56:52 UTC
Description of problem:
virsh connect failed if specify "unix_sock_dir" in libvirtd configuration file 


Version-Release number of selected component (if applicable):

libvirt-0.9.3-2.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.edit /etc/libvirt/libvirtd.conf
unix_sock_dir = "/var/run/tmp/libvirt"

#mkdir -p /var/run/tmp/libvirt

2.service libvirtd restart 

3.virsh -c qemu:///system or virsh list
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
error: failed to connect to the hypervisor
  
Actual results:
virsh connect failed 

Expected results:
virsh connect successfully  

Additional info:

Comment 1 Daniel Berrangé 2011-07-14 10:17:47 UTC
You changed the libvirtd socket, but didn't tell virsh how to find the new location.

 virsh -c qemu:///system?socket=/var/run/tmp/libvirt

Comment 2 Dave Allan 2011-07-14 19:15:42 UTC
Closing as not a bug.

Comment 3 Huang Wenlong 2011-07-15 03:13:39 UTC
(In reply to comment #1)
> You changed the libvirtd socket, but didn't tell virsh how to find the new
> location.
> 
>  virsh -c qemu:///system?socket=/var/run/tmp/libvirt

Hi, Daniel
In this situation some Upper application maybe have some problems like virt-manager (GUI), we can not start-up it via desktop icon (you can start-up it with virt-manger -c with socket in command line),  if the socket is changed .
I think this is a RFE bug at least, virsh should read the libvirt config file to get the latest socket location as the "default" socket location argument in "virsh -c" rather than input it every time in command line. 

Wenlong

Comment 4 Daniel Berrangé 2011-07-15 09:59:24 UTC
virsh can't read the config file because it might not even be on the same machine, and if running non-root it won't have sufficient privileges.

Changing the socket path is something you should never do in normal circumstances, so I don't see this as an issue at all.