Bug 882110 - Remote-viewer shows no error if connect to a spice port through vnc protocol
Remote-viewer shows no error if connect to a spice port through vnc protocol
Status: NEW
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gtk-vnc (Show other bugs)
6.4
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Daniel Berrange
Desktop QE
:
Depends On:
Blocks: 921330
  Show dependency treegraph
 
Reported: 2012-11-30 01:50 EST by tingting zheng
Modified: 2016-11-01 04:30 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 921330 (view as bug list)
Environment:
Last Closed:
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)

  None (edit)
Description tingting zheng 2012-11-30 01:50:22 EST
Description of problem:
Remote-viewer shows no error if connect to a spice port through vnc protocol

Version-Release number of selected component (if applicable):
virt-viewer-0.5.2-16.el6.x86_64
libvirt-0.10.2-10.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a spice guest,set it port as 5900.
# virsh dumpxml test
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>


2. Use remote-viewer vnc instead spice to connect the guest,the window just pop out without error showed.
# remote-viewer vnc://localhost:5900 --debug
connect : Connection refused
** (remote-viewer:14182): DEBUG: Insert window 0 0x13f5890
** (remote-viewer:14182): DEBUG: fullscreen display 0: 0
** (remote-viewer:14182): DEBUG: fullscreen display 0: 0
** (remote-viewer:14182): DEBUG: Opening display to vnc://localhost:5900
** (remote-viewer:14182): DEBUG: Guest vnc://localhost:5900 has a vnc display
** (remote-viewer:14182): DEBUG: After open connection callback fd=-1
** (remote-viewer:14182): DEBUG: Opening connection to display at vnc://localhost:5900
** (remote-viewer:14182): DEBUG: notebook show status 0x13f60a0
** (remote-viewer:14182): DEBUG: notebook show status 0x13f60a0
** (remote-viewer:14182): DEBUG: notebook show display 0x13f60a0
** (remote-viewer:14182): DEBUG: Display size request 100x100 (desktop 100x100)
** (remote-viewer:14182): DEBUG: Allocated 400x375
** (remote-viewer:14182): DEBUG: Child allocate 375x375
** (remote-viewer:14182): DEBUG: Display size request 50x50 (desktop 100x100)
** (remote-viewer:14182): DEBUG: Allocated 400x375
** (remote-viewer:14182): DEBUG: Child allocate 375x375
** (remote-viewer:14182): DEBUG: Window closed
** (remote-viewer:14182): DEBUG: close vnc=0x13de760
** (remote-viewer:14182): DEBUG: Disconnected
** (remote-viewer:14182): DEBUG: close vnc=0x138b880
** (remote-viewer:14182): DEBUG: notebook show status 0x13f60a0
** (remote-viewer:14182): DEBUG: Guest vnc://localhost:5900 display has disconnected, shutting down
** (remote-viewer:14182): DEBUG: Disposing window 0x13f5890

** (remote-viewer:14182): DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0

3.If use remote-viewer vnc to connect a guest with port which doesn't exist even for spice,there is error:
eg:
# remote-viewer vnc://localhost:5909 
Window pop out,and error shows as:Unable to connect to the graphic server vnc://localhost:5909


Actual results:
As step2 shows.

Expected results:
There is error messages shows:Unable to connect to the graphic server vnc://localhost:5900

Additional info: 
1.Remote-viewer shows error if connect to a vnc port through spice protocol,error showed as:Unable to connect to the graphic server spice://$ip:$port
Comment 1 Jonathon Jongsma 2013-11-18 16:35:31 EST
It appears that this is caused by the fact that upon connecting to the server port, the vnc client tries to read 12 bytes from the server to determine the vnc server version (see vnc_connection_initialize()).  The spice server never sends anything, because it's waiting for the client to send a link message.  So remote-viewer sits there waiting forever.  Perhaps there should be a timeout for the initial connection, after which point we give up and indicate an error.
Comment 3 Fabiano Fidêncio 2014-09-16 10:08:24 EDT
As pointed by Jonathon, the gtk-vnc waits for the 12 bytes from the server to determine the server version.
Looking deeply in the code we can see that vnc_connection_read_wire() tries to connect to the socket but receives no data ("Error receiving data: Resource temporarily unavailable") what will cause a call to g_io_wait() and then coroutine_yield() where gtk-vnc waits forever.

I don't see it as a remote-viewer bug, maybe a gtk-vnc bug, but most likely not a bug, at least for me.

I'm reassigning  it to gtk-vnc for now, then the maintainer can decide if it can be considered as a bug or not.

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