Bug 999292 - conflict exist in man doc about '--attach'
conflict exist in man doc about '--attach'
Status: CLOSED CANTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-viewer (Show other bugs)
6.5
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
: ManPageChange
Depends On: 999914 999922
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-21 02:00 EDT by CongDong
Modified: 2015-05-11 18:16 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 999291
Environment:
Last Closed: 2013-09-09 04:41:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The virt-viewer log file (5.48 KB, text/x-log)
2013-08-22 20:07 EDT, CongDong
no flags Details

  None (edit)
Description CongDong 2013-08-21 02:00:50 EDT
+++ 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@intel-q9400-4-7.englab.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 Berrange 2013-08-21 10:15:45 EDT
(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 03:04:46 EDT
(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 Berrange 2013-08-22 06:24:28 EDT
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 Berrange 2013-08-22 07:27:16 EDT
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-22 20:07:55 EDT
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 Berrange 2013-09-09 04:41:53 EDT
The KVM in RHEL-6 does not provide the functionality required for the --attach argument to work.
Comment 8 CongDong 2013-09-10 02:14:40 EDT
(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.

Note You need to log in before you can comment on or make changes to this bug.