Bug 802773 - [PATCH] virt-manager unable to connect the VM graphical console if listen address specified for the graphics
[PATCH] virt-manager unable to connect the VM graphical console if listen add...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Cole Robinson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 09:35 EDT by Tuomas Jormola
Modified: 2012-03-13 11:36 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-13 11:36:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Attempt to fix reported problem related to graphics console with listen address defined (692 bytes, patch)
2012-03-13 09:35 EDT, Tuomas Jormola
no flags Details | Diff

  None (edit)
Description Tuomas Jormola 2012-03-13 09:35:30 EDT
Created attachment 569683 [details]
Attempt to fix reported problem related to graphics console with listen address defined

Description of problem:
If I define a VM with graphics with listen address other than 127.0.0.1, virt-manager can't connect to this console.

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

DistroRelease: Ubuntu 12.04
Package: virt-manager 0.9.1-1ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.29-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
Architecture: amd64
SourcePackage: virt-manager

How reproducible:
Always


Steps to Reproduce:

1. Define a VM with the following kind of graphics config in libvirt XML

   <graphics type='spice' port='5904' autoport='no' listen='10.10.0.16'>
      <listen type='address' address='10.10.0.16'/>
   </graphics>

2. Start the VM

3. Switch to the graphical console of the VM

Actual results:
virt-manager console stays black when trying to connect to the console. The Spice URI is incorrect, KVM is listening 10.10.0.16:5904 for Spice clients, not 127.0.0.1:5904.

Relevant output of virt-manager --debug when connecting without the attached patch applied:

2012-03-13 15:25:42,624 (console:1081): Starting connect process for proto=spice trans=None connhost=localhost connuser=None connport=None gaddr=127.0.0.1 gport=5904 gsocket=None
2012-03-13 15:25:42,624 (console:496): spice uri: spice://localhost?port=5904


Expected results:
virt-manager displays the console by connecting to 10.10.0.16:5904.

Relevant output of virt-manager --debug when connecting without the attached patch applied:
2012-03-13 15:26:36,552 (console:1081): Starting connect process for proto=spice trans=None connhost=10.10.0.16 connuser=None connport=5904 gaddr=10.10.0.16 gport=5904 gsocket=None
2012-03-13 15:26:36,552 (console:496): spice uri: spice://10.10.0.16?port=5904


Additional info:
Attached is a small patch that fixes this issue for me. But please review carefully, I really don't know if this is the proper way to fix this issue.
Comment 1 Cole Robinson 2012-03-13 11:36:35 EDT
Thanks for the patch! Pushed now:

http://git.fedorahosted.org/git?p=virt-manager.git;a=commit;h=422c0216d806f7c71e7197279c032b7f58a42db3

But after inspecting the code I realize there are a few corner cases here where we aren't doing the right thing, so this code is about to be refactored :)

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