RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 712938 - Can't connect to linux guest with WAN options
Summary: Can't connect to linux guest with WAN options
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: spice-client
Version: 6.2
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Christophe Fergeau
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-13 16:52 UTC by Swapna Krishnan
Modified: 2011-12-06 15:22 UTC (History)
8 users (show)

Fixed In Version: spice-client-0.8.2-1.el6
Doc Type: Bug Fix
Doc Text:
Cause When WAN options are given to spice-client, and an agent is running on the guest, spice-client sends a VD_AGENT_DISPLAY_CONFIG to the agent, and wait for repl y. Spice vdagent running on a linux guest does not yes support WAN options, and does not reply on VD_AGENT_DISPLAY_CONFIG. Consequence When WAN options are given to a spice-client connected to a Linux guest, conne ction fails with vdagent timeout. Fix When no agent is running on the guest, or if the agent does not support WAN op tions (VD_AGENT_CAP_DISPLAY_CONFIG capability), spice-client does not wait for a gent on the guest to reply, but continue with the initiating message sequence (sending SPICE_MSGC_MAIN_ATTACH_CHANNELS). Result When WAN options are given to a spice-client connected to a Linux guest, conn ection succeeds. See: Comment 3
Clone Of:
Environment:
Last Closed: 2011-12-06 15:22:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (ChangeLog needs writing ;) (2.22 KB, patch)
2011-07-06 14:56 UTC, Christophe Fergeau
no flags Details | Diff
The initial patch was buggy, fixed version (1.73 KB, patch)
2011-07-19 11:53 UTC, Christophe Fergeau
no flags Details | Diff
this patch was needed on top of the previous one (3.96 KB, patch)
2011-07-21 16:01 UTC, Christophe Fergeau
no flags Details | Diff
agent timeout patch (885 bytes, patch)
2011-07-28 14:22 UTC, Arnon Gilboa
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1518 0 normal SHIPPED_LIVE libcacard and spice-client bug fix and enhancement update 2011-12-06 00:50:43 UTC

Description Swapna Krishnan 2011-06-13 16:52:45 UTC
Description of problem:

If you try to connect to a linux guest with WAN options, SPICE window opens up and is blank - it then fails with vdagent timeout message.  It should give a warning that this is only applicable for windows guest and still connect to guest. 

# spicec -h localhost -p 5904 --color-depth 16
Warning: abort
Error: unhandled exception: vdagent timeout

Host is RHEL 6.1, guest is RHEL 6.1

spice-client-0.8.0-2.el6.x86_64
spice-server-0.8.0-1.el6.x86_64
qemu-kvm-0.12.1.2-2.160.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Connect to a linux guest through spicec with WAN options
2. Connections fails with vdagent timeout
  
Actual results:
Can't connect to linux guest

Expected results:
Connect to linux guest with warning message that WAN options are only for windows guests

Additional info:

Comment 2 Swapna Krishnan 2011-07-05 16:13:56 UTC
Forgot to mention this when I filed the bug.

When spice-vdagentd is running on the linux guest and I try to connect with WAN features, I still get vdagent timeout message. 

Thanks,
- Swapna

Comment 3 Christophe Fergeau 2011-07-06 14:25:18 UTC
I think I figured out what is going on.
It all starts in RedClient::handle_init
This function checks whether we have an agent or not, because if we have an agent, there will be some kind of handshake to check both sides capabilities before all the spice channels are created.

When there is no agent running, the startup process goes on with SPICE_MSGC_MAIN_ATTACH_CHANNELS

When there is a windows agent running, VD_AGENT_ANNOUNCE_CAPABILITIES and VD_AGENT_DISPLAY_CONFIG messages are sent to the agent, and when processing the agent answer to the VD_AGENT_DISPLAY_CONFIG message, SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent and the startup process will go on.

However, when there is no agent running but --color-depth was used, handle_init won't send the SPICE_MSGC_MAIN_ATTACH_CHANNELS message but will wait for the agent handshake to proceed to its end, which won't happen, so it will timeout waiting for agent answers.

Similarly, the linux agent handles VD_AGENT_ANNOUNCE_CAPABILITIES messages, but it doesn't handle VD_AGENT_DISPLAY_CONFIG messages, so we'll never reach the point where a SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent.

I suggest 2 fixes:
- unconditionnally send SPICE_MSGC_ATTACH_CHANNELS when no agent is running in handle_init
- send SPICE_MSGC_MAIN_ATTACH_CHANNELS in RedClient::on_agent_announce_capabilities if the agent doesn't have the VD_AGENT_CAP_DISPLAY_CONFIG capability

Comment 4 Christophe Fergeau 2011-07-06 14:56:14 UTC
Created attachment 511509 [details]
Proposed patch (ChangeLog needs writing ;)

Comment 8 Christophe Fergeau 2011-07-18 16:37:23 UTC
I committed the patch from comment #3 to spice git master

Comment 9 Christophe Fergeau 2011-07-19 11:53:29 UTC
Created attachment 513780 [details]
The initial patch was buggy, fixed version

Comment 10 Christophe Fergeau 2011-07-19 11:54:56 UTC
Comment on attachment 513780 [details]
The initial patch was buggy, fixed version

Wrong bug

Comment 11 Christophe Fergeau 2011-07-21 16:01:38 UTC
Created attachment 514226 [details]
this patch was needed on top of the previous one

First patch was buggy, this patch needs to be applied on top of it.

Comment 12 Christophe Fergeau 2011-07-28 09:01:22 UTC
This is fixed in spice 0.8.2 which RHEL6.2 is being rebased to.

Comment 13 Arnon Gilboa 2011-07-28 14:22:44 UTC
Created attachment 515734 [details]
agent timeout patch

Comment 14 Arnon Gilboa 2011-07-28 15:36:23 UTC
The (already pushed) patch from comment 11 caused the following regression:

When client runs without the auto-conf or disable-effects options (either from CLI or controller), which is the case when using Spice from Admin Portal, the client will unecessarily wait for 30sec before connecting.

The mentioned patch assumed that on_agent_reply() of VD_AGENT_DISPLAY_CONFIG will call send_main_attach_channels() and connect. However, when auto-conf or disable-effects are not used, on_agent_reply() will ignore the reply and not call send_main_attach_channels(). Therefore, send_main_attach_channels() will only be called on agent timeout.

The solution (attachment 515734 [details] by Christophe) is to activate agent timer only if auto-conf or disable-effects. Otherwise, simply call send_main_attach_channels().

Opend BZ #726441 for this one.

Comment 15 Christophe Fergeau 2011-07-28 15:47:23 UTC
(In reply to comment #14)
> When client runs without the auto-conf or disable-effects options (either from
> CLI or controller), which is the case when using Spice from Admin Portal, the
> client will unecessarily wait for 30sec before connecting.

and when the guest is a windows guest with an agent running, this won't happen on linux, or when the agent is not running.

Comment 17 Uri Lublin 2011-07-31 09:25:39 UTC
Comment on attachment 515734 [details]
agent timeout patch

A fix for rhbz#726441 (introduced by a fix for this bug)

Comment 18 Marian Krcmarik 2011-08-03 23:09:15 UTC
Verified on spice-client-0.8.2-2.

Comment 19 Uri Lublin 2011-11-20 14:48:08 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
  When WAN options are given to spice-client, and an agent is running on the guest, spice-client sends a VD_AGENT_DISPLAY_CONFIG to the agent, and wait for repl
y.
  Spice vdagent running on a linux guest does not yes support WAN options, and does not reply on VD_AGENT_DISPLAY_CONFIG.

Consequence
  When WAN options are given to a spice-client connected to a Linux guest, conne
ction fails with vdagent timeout.

Fix
  When no agent is running on the guest, or if the agent does not support WAN op
tions (VD_AGENT_CAP_DISPLAY_CONFIG capability), spice-client does not wait for a
gent on the guest to reply, but continue with the initiating message sequence (sending SPICE_MSGC_MAIN_ATTACH_CHANNELS).

Result
   When WAN options are given to a spice-client connected to a Linux guest, conn
ection succeeds.

See: Comment 3

Comment 20 errata-xmlrpc 2011-12-06 15:22:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1518.html


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