Bug 1201177

Summary: virt-viewer should report an error when use it connecting a non-existing guest
Product: Red Hat Enterprise Linux 6 Reporter: zhoujunqin <juzhou>
Component: virt-viewerAssignee: Virt Viewer Maint <virt-viewer-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.7CC: cfergeau, dblechte, fidencio, mzhan, pgrunt, rbalakri, tzheng, xiaodwan
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-viewer-2.0-4.el6 Doc Type: Bug Fix
Doc Text:
No doc needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 06:32:10 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
old-virt-viewer.png none

Description zhoujunqin 2015-03-12 08:55:33 UTC
Description of problem:
Now virt-viewer support GUI to connect guests, but when use it connecting a non-existing guest, there is no error message showed.

Version-Release number of selected component (if applicable):
virt-viewer-2.0-3.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
Use virt-viewer to connect non-existing guest.(eg:non-existing)
# virt-viewer non-existing


Actual results:
virt-viewer GUI launched but no error message showed to tell user there is no such guest existing on host.

Expected results:
If it's by design, it's better to add related info in debug log.

If not, virt-viewer should report an error when use it connecting a non-existing guest.

Additional info:
1. There is no useful message in debug info:
# virt-viewer non-existing --debug
(virt-viewer:8619): virt-viewer-DEBUG: fullscreen display 0: 0
(virt-viewer:8619): virt-viewer-DEBUG: connecting ...
(virt-viewer:8619): virt-viewer-DEBUG: Opening connection to libvirt with URI <null>
(virt-viewer:8619): virt-viewer-DEBUG: Add handle 7 1 0x113ef10
(virt-viewer:8619): virt-viewer-DEBUG: initial connect
(virt-viewer:8619): virt-viewer-DEBUG: notebook show status 0x10d0000
(virt-viewer:8619): virt-viewer-DEBUG: Dispatch handler 7 1 0x113ef10
(virt-viewer:8619): virt-viewer-DEBUG: Dispatch handler 7 2 0x113ef10
(virt-viewer:8619): virt-viewer-DEBUG: Dispatch handler 7 1 0x113ef10

2. When use remote-viewer connecting such guest, we can get a clear error:
# remote-viewer  non-existing
Cannot determine the connection type from URI

Comment 1 Fabiano Fidêncio 2015-03-12 09:00:36 UTC
(In reply to zhoujunqin from comment #0
> Actual results:
> virt-viewer GUI launched but no error message showed to tell user there is
> no such guest existing on host.

We show a dialog with "Failed to connect: No virtual machine found". Is it not enough?

Comment 2 Fabiano Fidêncio 2015-03-12 09:07:06 UTC
In reply to Fabiano Fidêncio from comment #1)
> (In reply to zhoujunqin from comment #0
> > Actual results:
> > virt-viewer GUI launched but no error message showed to tell user there is
> > no such guest existing on host.
> 
> We show a dialog with "Failed to connect: No virtual machine found". Is it
> not enough?

And here is a video:
https://fidencio.fedorapeople.org/rhbz%231201177.webm

Comment 4 zhoujunqin 2015-03-12 10:51:50 UTC
(In reply to Fabiano Fidêncio from comment #1)
> (In reply to zhoujunqin from comment #0
> > Actual results:
> > virt-viewer GUI launched but no error message showed to tell user there is
> > no such guest existing on host.
> 
> We show a dialog with "Failed to connect: No virtual machine found". Is it
> not enough?

I think it ok.
And you can also refer the error dialog for old virt-viewer version:
such as: virt-viewer-0.6.0-11.el6.x86_64

# virt-viewer  non-existing

A dialog pop up with "Cannot find guest domain non-existing".
After click "OK" button, dialog closed.

Both i think it's ok, thanks.
I will attach screenshot for you: old-virt-viewer.png

Comment 5 zhoujunqin 2015-03-12 10:52:38 UTC
Created attachment 1000918 [details]
old-virt-viewer.png

Comment 6 Fabiano Fidêncio 2015-03-12 11:10:39 UTC
(In reply to zhoujunqin from comment #4)
> (In reply to Fabiano Fidêncio from comment #1)
> > (In reply to zhoujunqin from comment #0
> > > Actual results:
> > > virt-viewer GUI launched but no error message showed to tell user there is
> > > no such guest existing on host.
> > 
> > We show a dialog with "Failed to connect: No virtual machine found". Is it
> > not enough?
> 
> I think it ok.
> And you can also refer the error dialog for old virt-viewer version:
> such as: virt-viewer-0.6.0-11.el6.x86_64
> 
> # virt-viewer  non-existing
> 
> A dialog pop up with "Cannot find guest domain non-existing".
> After click "OK" button, dialog closed.
> 
> Both i think it's ok, thanks.
> I will attach screenshot for you: old-virt-viewer.png

And my screenshot is running the same version 2.0-3.el6 version of virt-viewer.
So, as far as I understand virt-viewer already works in the expected way and this is not a bug.

Comment 7 tingting zheng 2015-03-12 11:23:53 UTC
(In reply to Fabiano Fidêncio from comment #6)

> And my screenshot is running the same version 2.0-3.el6 version of
> virt-viewer.
> So, as far as I understand virt-viewer already works in the expected way and
> this is not a bug.

No,with virt-viewer-2.0-3.el6.x86_64,there is no such error shows which is as decribed in this bug.

Comment 8 Pavel Grunt 2015-03-12 13:38:38 UTC
(In reply to tingting zheng from comment #7)
> (In reply to Fabiano Fidêncio from comment #6)
> 
> > And my screenshot is running the same version 2.0-3.el6 version of
> > virt-viewer.
> > So, as far as I understand virt-viewer already works in the expected way and
> > this is not a bug.
> 
> No,with virt-viewer-2.0-3.el6.x86_64,there is no such error shows which is
> as decribed in this bug.

As Fabiano said we show a dialog.
When there are any running machines - list of running machines is shown
When there are no running machines - "Failed to connect: No virtual machine found"
When libvirtd is not running - "Unable to connect to libvirt with URI: uri."

Do you want to have the same information in the debug log ? Do you want to have this message "virt-viewer-DEBUG: Cannot find guest non-existing" in the debug log ?

> # remote-viewer  non-existing
> Cannot determine the connection type from URI

The error is different because the usage is different. virt-viewer makes connection to libvirt, remote-viewer makes connection based on uri (ie remote-viewer spice://HOST:PORT).

Comment 9 Pavel Grunt 2015-03-12 15:43:17 UTC
As I described in the previous comment an user is informed by a dialog. Closing

Comment 10 tingting zheng 2015-03-13 02:53:42 UTC
(In reply to Pavel Grunt from comment #8)
> (In reply to tingting zheng from comment #7)
> > (In reply to Fabiano Fidêncio from comment #6)
> > 
> > > And my screenshot is running the same version 2.0-3.el6 version of
> > > virt-viewer.
> > > So, as far as I understand virt-viewer already works in the expected way and
> > > this is not a bug.


Misunderstand with the above info.
In my host,there are some running guest,and I use virt-viewer $unexisting to launch an unexisting guest,the dialog about the available guest shows,no such "Failed to connect: No virtual machine found" shows.


> > No,with virt-viewer-2.0-3.el6.x86_64,there is no such error shows which is
> > as decribed in this bug.
> 
> As Fabiano said we show a dialog.
> When there are any running machines - list of running machines is shown
> When there are no running machines - "Failed to connect: No virtual machine
> found"
> When libvirtd is not running - "Unable to connect to libvirt with URI: uri."

So from your comments I understand it is by design from the new version of virt-viewer.

Comment 11 zhoujunqin 2015-03-13 10:28:59 UTC
(In reply to Pavel Grunt from comment #8)
> (In reply to tingting zheng from comment #7)
> > (In reply to Fabiano Fidêncio from comment #6)
> > 
> > > And my screenshot is running the same version 2.0-3.el6 version of
> > > virt-viewer.
> > > So, as far as I understand virt-viewer already works in the expected way and
> > > this is not a bug.
> > 
> > No,with virt-viewer-2.0-3.el6.x86_64,there is no such error shows which is
> > as decribed in this bug.
> 
> As Fabiano said we show a dialog.
> When there are any running machines - list of running machines is shown

Hi Pavel Grunt,
as we talked, i think we'd better have a clear info in debug log to tell user guest "non-existing" isn't existing, and the same list available guests for users is ok, thanks.

So i reopen this bug.

Comment 14 CongDong 2015-03-25 07:56:43 UTC
Reproduce with virt-viewer-2.0-3.el6
Steps:

# virt-viewer sadfasdf --debug
(virt-viewer:4323): virt-viewer-DEBUG: fullscreen display 0: 0
(virt-viewer:4323): virt-viewer-DEBUG: connecting ...
(virt-viewer:4323): virt-viewer-DEBUG: Opening connection to libvirt with URI <null>
(virt-viewer:4323): virt-viewer-DEBUG: Add handle 15 1 0xa447c0
(virt-viewer:4323): virt-viewer-DEBUG: initial connect
(virt-viewer:4323): virt-viewer-DEBUG: notebook show status 0x9dc000
(virt-viewer:4323): virt-viewer-DEBUG: Couldn't get uuid from libvirt
(virt-viewer:4323): virt-viewer-DEBUG: notebook show status 0x9dc000
(virt-viewer:4323): virt-viewer-DEBUG: Cannot get guest state
(virt-viewer:4323): virt-viewer-DEBUG: Remove handle 1 15
(virt-viewer:4323): virt-viewer-DEBUG: Disposing window 0x9b40f0

(virt-viewer:4323): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0


Verify with:virt-viewer-debuginfo-2.0-4.el6

# virt-viewer sadfasdf --debug
(virt-viewer:4633): virt-viewer-DEBUG: connecting ...
(virt-viewer:4633): virt-viewer-DEBUG: Opening connection to libvirt with URI <null>
(virt-viewer:4633): virt-viewer-DEBUG: Add handle 15 1 0x12bd7b0
(virt-viewer:4633): virt-viewer-DEBUG: initial connect
(virt-viewer:4633): virt-viewer-DEBUG: notebook show status 0x1202000
(virt-viewer:4633): virt-viewer-DEBUG: Cannot find guest sadfasdf
(virt-viewer:4633): virt-viewer-DEBUG: Couldn't get uuid from libvirt
(virt-viewer:4633): virt-viewer-DEBUG: notebook show status 0x1202000
(virt-viewer:4633): virt-viewer-DEBUG: Cannot get guest state
(virt-viewer:4633): virt-viewer-DEBUG: Remove handle 1 15
(virt-viewer:4633): virt-viewer-DEBUG: Disposing window 0x122d0f0

(virt-viewer:4633): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0


As the result, "Cannot find guest sadfasdf" in the debug message, so move to VERIFIED

Comment 16 errata-xmlrpc 2015-07-22 06:32:10 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://rhn.redhat.com/errata/RHBA-2015-1322.html