Bug 1386630 - Warning "Display can only be attached through libvirt with --attach" should prompt in window when guest start running
Summary: Warning "Display can only be attached through libvirt with --attach" should p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer
Version: 7.3
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Snir Sheriber
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-19 10:33 UTC by zhoujunqin
Modified: 2017-08-01 15:04 UTC (History)
10 users (show)

Fixed In Version: virt-viewer-5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 15:04:11 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1849 0 normal SHIPPED_LIVE virt-viewer bug fix and enhancement update 2017-08-01 17:49:46 UTC

Description zhoujunqin 2016-10-19 10:33:16 UTC
Description of problem:
Using virt-viewer connects to a shutoff guest with <listen type='none'/>, then start guest,finding virt-viewer windows keeps showing "Waiting for guest domain to start" and warning "Display can only be attached through libvirt with --attach"  prompts in command line.

Version-Release number of selected component (if applicable):
virt-viewer-2.0-12.el7.x86_64
spice-gtk3-0.31-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a shutoff spice guest which <listen type='none'>.
# virsh dumpxml rhel6.8
...
<graphics type='spice'>
   <listen type='none'/>
</graphics>
...

2. Using virt-viewer connects to guest rhel6.8, virt-viewer window showing: "Waiting for guest domain to start"
# virt-viewer rhel6.8

3. Then start guest.
# virsh start rhel6.8
Domain rhel6.8 started

Actual results:
1. After guest starts, there is just a warning in virt-viewer command line:
# virt-viewer rhel6.8

(virt-viewer:15666): virt-viewer-WARNING **: Display can only be attached through libvirt with --attach

2. virt-viewer windows keeps showing "Waiting for guest domain to start".

Expected results:
Prompts "Display can only be attached through libvirt with --attach" warning in virt-viewer window when guest starts.

Additional info:
1.
When use virt-viewer connect to a running guest <listen type='none'> without "-a" option directly, error "Failed to connect: Display can only be attached through libvirt with --attach" shows in window, after click "OK", window will closed and command exit.
2.
Can also reproduce with vnc guest which <listen type='none'>.

Comment 1 Christophe Fergeau 2016-10-24 10:29:37 UTC
(In reply to zhoujunqin from comment #0)
> 1.
> When use virt-viewer connect to a running guest <listen type='none'> without
> "-a" option directly, error "Failed to connect: Display can only be attached
> through libvirt with --attach" shows in window, after click "OK", window
> will closed and command exit.

Or virt-viewer could just fallback to --attach behaviour when it detects a guest where --attach has to be used

Comment 2 Xiaodai Wang 2016-10-27 02:57:37 UTC
> Or virt-viewer could just fallback to --attach behaviour when it detects a
> guest where --attach has to be used

Do you mean virt-viewer will not report any error and connect to guest automatically with --attach implied?

If yes, it may have a little confusion for users when they connect to the guest again when it's running. Because they have to add --attach for a running guest.

Thanks

Comment 3 Christophe Fergeau 2016-10-27 08:12:10 UTC
(In reply to xiaodwan from comment #2)
> > Or virt-viewer could just fallback to --attach behaviour when it detects a
> > guest where --attach has to be used
> 
> Do you mean virt-viewer will not report any error and connect to guest
> automatically with --attach implied?
> 
> If yes, it may have a little confusion for users when they connect to the
> guest again when it's running. Because they have to add --attach for a
> running guest.

It would have to do that in all cases. Actually, for this bug report, I think we'd get the same warning if the guest is already running ?

Comment 4 Xiaodai Wang 2016-10-27 08:22:00 UTC
(In reply to Christophe Fergeau from comment #3)
> (In reply to xiaodwan from comment #2)
> > > Or virt-viewer could just fallback to --attach behaviour when it detects a
> > > guest where --attach has to be used
> > 
> > Do you mean virt-viewer will not report any error and connect to guest
> > automatically with --attach implied?
> > 
> > If yes, it may have a little confusion for users when they connect to the
> > guest again when it's running. Because they have to add --attach for a
> > running guest.
> 
> It would have to do that in all cases. Actually, for this bug report, I
> think we'd get the same warning if the guest is already running ?

Now an error dialog pops and ask user to add "--attach" option if the guest is running. 

If do that in all cases, then "--attach" option will be redundant.

Comment 6 Snir Sheriber 2017-03-08 15:33:21 UTC
Fixed upsrteam (new link):
https://pagure.io/virt-viewer/c/d7ef44d44f4468b6fd792ec492025d6d5df11a08?branch=master

Comment 8 Xiaodai Wang 2017-03-20 08:01:33 UTC
I verified it with virt-viewer-5.0-2.el7.x86_64.

if don't specify --attach when connecting to a shutdown guest, after start up the guest, Error "Display can only be attached through libvirt with --attach" displays in virt-viewer window.

If specify --attach when connecting to a shutdown guest, after start up the guest, virt-viewer can connect to the guest successfully.

So move the bug from ON_QA to VERIFIED.

Comment 9 errata-xmlrpc 2017-08-01 15:04:11 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.

https://access.redhat.com/errata/RHBA-2017:1849


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