Bug 999292

Summary: conflict exist in man doc about '--attach'
Product: Red Hat Enterprise Linux 6 Reporter: CongDong <codong>
Component: virt-viewerAssignee: Daniel Berrangé <berrange>
Status: CLOSED CANTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: acathrow, berrange, cfergeau, codong, dblechte, dyuan, hyao, lcui, mzhan, pschiffe, tzheng, xlu, zsong
Target Milestone: rcKeywords: ManPageChange
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 999291 Environment:
Last Closed: 2013-09-09 08:41:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 999914, 999922    
Bug Blocks:    
Attachments:
Description Flags
The virt-viewer log file none

Description CongDong 2013-08-21 06:00:50 UTC
+++ This bug was initially created as a clone of Bug #999291 +++

Can reproduce this on RHEL6.5 with:
# rpm -qa libvirt virt-viewerlibvirt-0.10.2-22.el6.x86_64
virt-viewer-0.5.6-7.el6.x86_64
So clone the bug.


Description of problem:
Parameter "--attach", the results are the same whether I add it or not.
And the man page makes me confused.

Version-Release number of selected component (if applicable):
# rpm -qa libvirt virt-viewer
virt-viewer-0.5.7-1.el7.x86_64
libvirt-1.1.1-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Check the man page : # man virt-viewer
2. Prepare a server with a running guest, configure tcp for libvirt authentication
  Server :
  1)add configurations  in /etc/libvirt/libvirtd.conf

  listen_tls = 0
  listen_tcp = 1
  auth_tcp = "sasl"

  2) add sasl user
  # saslpasswd2 -a libvirt test
  (input your passwd)
  # sasldblistusers2 -f /etc/libvirt/passwd.db
  test.nay.redhat.com: userPassword

  3) uncomment LIBVIRTD_ARGS="--listen" in /etc/sysconfig/libvirtd
  
  4) restart libvirtd


3. On client:
# virt-viewer -a -c qemu+tcp://$ip/system $vm
# virt-viewer -c qemu+tcp://$ip/system $vm

Actual results:
1. -a, --attach
           Use libvirt to directly attach to a local display, instead of making a TCP/UNIX socket
           connection. This avoids the need to authentication with the remote display, if
           authentication with libvirt is already allowed.  This option does not work with remote
           displays.
   As the man pange says: This option does not work with remote displays.
   But if the option can only be used to the local guest, I think it's same with "virt-viewer $vm".
   And it's better to add an example here.

3. The results of two commands are same. An authentication required dialog will popup.

Expected results:
1. The man page should be understand more easily.
2. virt-viewer can connect the guest directly with option '-a'. The authentication required dialog shouldn't popup

Additional info:

Comment 2 Daniel Berrangé 2013-08-21 14:15:45 UTC
(In reply to CongDong from comment #0)
 
> 3. On client:
> # virt-viewer -a -c qemu+tcp://$ip/system $vm


Per the manpage --attach only works when using a local connection. ie you must be using  qemu:///system or qemu:///session.  Any use of +tcp or +tls or +ssh APIs will not work

Comment 3 CongDong 2013-08-22 07:04:46 UTC
(In reply to Daniel Berrange from comment #2)
> (In reply to CongDong from comment #0)
> Per the manpage --attach only works when using a local connection. ie you
> must be using  qemu:///system or qemu:///session.  Any use of +tcp or +tls
> or +ssh APIs will not work

Hi, thanks for reply, but still have two problems:

1. I tried with local connection and remote guest both.
virt-viewer -a -c qemu+tcp://$localip/system $vm
virt-viewer -c qemu+tcp://$localip/system $vm
Both of the two commands have same effect
virt-viewer -a $guest
virt-viewer $guest
Both of the two commands have same effect too.

As the result, I think the option is unless, so can you give me an example? I think should add one in man doc too.


2. In the manpage about "--attach":
 1) This avoids the need to authentication with the remote display, if authentication with libvirt is already allowed.
 2) This option does not work with remote displays.

 From the description in "1)", I think virt-viewer can connect the remote guest without authentication through "-a".
But as the "2)" says, it can't be used with remote displays.
It's conflict.

Comment 4 Daniel Berrangé 2013-08-22 10:24:28 UTC
Can you run

  LIBVIRT_LOG_FILTERS=1:libvirt virt-viewer -c qemu:///system --attach --debug $guest

and attach the output to this bug.

Comment 5 Daniel Berrangé 2013-08-22 11:27:16 UTC
I expect when you run that command you'll see an error in the logs

(virt-viewer:11573): virt-viewer-DEBUG: Error internal error: unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS


And if you do  'setenforce 0', then the error will go away & virt-viewer will do what it is supposed to do.

Comment 6 CongDong 2013-08-23 00:07:55 UTC
Created attachment 789402 [details]
The virt-viewer log file

(In reply to Daniel Berrange from comment #5)
> I expect when you run that command you'll see an error in the logs
> 
> (virt-viewer:11573): virt-viewer-DEBUG: Error internal error: unable to
> execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS
> 
> 
> And if you do  'setenforce 0', then the error will go away & virt-viewer
> will do what it is supposed to do.

Yes, I run the command and there is an error message like you said in the log file, and I run it again after "steenforce 0", the error message didn't appear.
But virt-viewer can always connect the guest just like without "--attach".

Comment 7 Daniel Berrangé 2013-09-09 08:41:53 UTC
The KVM in RHEL-6 does not provide the functionality required for the --attach argument to work.

Comment 8 CongDong 2013-09-10 06:14:40 UTC
(In reply to Daniel Berrange from comment #7)
> The KVM in RHEL-6 does not provide the functionality required for the
> --attach argument to work.

If kvm in RHEL6 does not provide the function, I think should remove the options in virt-viewer.