Bug 820949

Summary: [remote-viewer]keyboard/mouse can't worked when add secure channel in guest xml
Product: Red Hat Enterprise Linux 6 Reporter: zhe peng <zpeng>
Component: virt-viewerAssignee: Daniel Berrangé <berrange>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3CC: cfergeau, dblechte, dyasny, mzhan, rwu, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-24 11:18:52 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:
Attachments:
Description Flags
guest xml file
none
script to config spice tls on host
none
--spice-debug log file
none
--spice-debug --debug output file none

Description zhe peng 2012-05-11 12:09:52 UTC
Description of problem:
keyboard/mouse can't worked when add secure channel in guest xml 

Version-Release number of selected component (if applicable):
virt-viewer-0.5.2-8.el6.x86_64
libvirt-0.9.10-18.el6.x86_64
spice-server-0.10.1-7.el6.x86_64
spice-gtk-0.11-8.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1.create a spice guest 
2.config tls on host(script in attachment)
3.edit graphics element
<graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
      <channel name='main' mode='secure'/>
      <channel name='inputs' mode='insecure'/>
    </graphics>
  
4: start the guest
5: use remote-viewer to connect the guest
#remote-viewer spice://$hostIP/?tls-port=5904 --spice-host-subject="C=IL,L=Raanana,O=Red Hat,CN=my server" --spice-ca-file='/etc/pki/libvirt-spice/ca-cert.pem'

Actual results:
remote-viewer will open a graphic console,but the keyboard and mouse all can't worked.

got error msg:
(remote-viewer:24967): GSpice-WARNING **: PulseAudio context failed Connection refused

(remote-viewer:24967): GSpice-WARNING **: pa_context_connect() failed: Connection refused

(remote-viewer:24967): GSpice-WARNING **: inputs-3:0: spice_channel_recv_link_msg: unhandled error 6

(remote-viewer:24771): GSpice-CRITICAL **: spice_inputs_key_press: assertion `SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED' failed

(remote-viewer:24771): GSpice-CRITICAL **: spice_inputs_key_press: assertion `SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED' failed

(remote-viewer:24771): GSpice-CRITICAL **: spice_inputs_key_release: assertion `SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED' failed

full log msg please see attachment.

Expected results:
keyboard and mouse worked well.

Additional info:
when use virt-viewer to connect the guest ,keyboard and mouse all worked.
# virt-viewer rhel6.3 --spice-host-subject="C=IL,L=Raanana,O=Red Hat,CN=my server" --spice-ca-file='/etc/pki/libvirt-spice/ca-cert.pem'

use spice-clent, also worked.

if remove
      <channel name='main' mode='secure'/>
      <channel name='inputs' mode='insecure'/> 
from guest xml ,then restart the guest ,all worked well.

Comment 1 zhe peng 2012-05-11 12:11:44 UTC
Created attachment 583819 [details]
guest xml file

Comment 2 zhe peng 2012-05-11 12:12:52 UTC
Created attachment 583820 [details]
script to config spice tls on host

Comment 3 zhe peng 2012-05-11 12:17:05 UTC
Created attachment 583821 [details]
--spice-debug log file

Comment 5 Daniel Berrangé 2012-05-14 10:59:52 UTC
> (remote-viewer:24967): GSpice-WARNING **: inputs-3:0:
> spice_channel_recv_link_msg: unhandled error 6

This is an interested warning. Error code 6 translates to

  SPICE_LINK_ERR_NEED_UNSECURED

which seems to suggest that virt-viewer is trying to use a secure connection for input, where-as the server is configured to require an insecure connection.

Comment 6 Daniel Berrangé 2012-05-14 11:01:44 UTC
You have provided the debug output from '--spice-debug', but I need to see the virt-viewer debug info too. Can you re-try and pass the following args to get a log file which contains all debug info

  virt-viewer --spice-debug --debug ...other args...

Comment 7 zhe peng 2012-05-15 03:29:38 UTC
Created attachment 584517 [details]
--spice-debug --debug output file

Comment 8 Daniel Berrangé 2012-05-15 11:22:32 UTC
> use remote-viewer to connect the guest
> #remote-viewer spice://$hostIP/?tls-port=5904

You haven't told spice what the non-TLS port is, to it can't run the keyboard of the non-TLS channel as the guest XML requires. Please re-try with

   spice://$HostIP/?port=NNNN&tls-port=MMMM

Comment 9 RHEL Program Management 2012-05-19 04:04:11 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 10 zhe peng 2012-05-24 11:18:00 UTC
thanks,Daniel, i use command remote-viewer spice://$hostip/?port=NNNN\&tls-port=MMMM,the keyboard and mouse worked well,so , i think this bug can be closed.