Bug 997802

Summary: domdisplay should show all URI if config both vnc and spice in guest
Product: Red Hat Enterprise Linux 7 Reporter: zhe peng <zpeng>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: berrange, dyuan, lhuang, mkletzan, mzhan, rbalakri, ydu
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.8-8.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 997805 (view as bug list) Environment:
Last Closed: 2015-03-05 07:24:31 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:
Bug Depends On:    
Bug Blocks: 997805    

Description zhe peng 2013-08-16 08:47:58 UTC
Description of problem:
domdisplay should show all uri if config both vnc and spice in guest

Version-Release number of selected component (if applicable):
libvirt-1.1.1-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. config vnc and spice in same time
#virsh dumpxml $guest
....
 <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <graphics type='spice' port='5901' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
....

#virsh domdisplay $guest
vnc://127.0.0.1:0


Expected result:
vnc://127.0.0.1:0
spice://127.0.0.1:5901

Additional info:

Comment 1 Daniel Berrangé 2013-08-16 10:10:31 UTC
Listing multiple URI by default would be a behavioural change which will likely break existing scripts using virsh.

IMHO the semantics of 'virsh domdisplay' should be to list the *first* <graphics> element.  We should add a flag  "--type vnc|sdl" to allow an app to explicitly request a particular graphics element by type.

Comment 4 Martin Kletzander 2014-07-24 14:25:10 UTC
Fixed upstream by v1.2.6-255-gdd4791c:

commit dd4791c00dd57398141be32950c6aa9cfb8383cc
Author: Martin Kletzander <mkletzan>
Date:   Thu Jul 24 14:23:12 2014 +0200

    virsh: add option for selecting domdisplay type

Comment 6 Luyao Huang 2014-11-21 03:06:57 UTC
Check the help:

# virsh domdisplay --help
  NAME
    domdisplay - domain display connection URI

  SYNOPSIS
    domdisplay <domain> [--include-password] [<type>]

  DESCRIPTION
    Output the IP address and port number for the graphical display.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    --include-password  includes the password into the connection URI if available
    [--type] <string>  select particular graphics display (e.g. "vnc", "spice", "rdp")


Check the manual of virsh:

       domdisplay domain [--include-password]
           Output a URI which can be used to connect to the graphical display of the domain via VNC, SPICE or RDP. If --include-password is specified, the SPICE channel password
           will be included in the URI.


no --type, this is a small issue.

Prepare a running guest have vnc and spice:
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 12    r6                             running


# virsh dumpxml r6
    <graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <graphics type='spice' port='5903' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>

# virsh  domdisplay r6 --type spice 
spice://127.0.0.1:5903

# virsh  domdisplay r6 --type vnc 
vnc://127.0.0.1:2

Comment 7 Luyao Huang 2014-11-21 03:12:00 UTC
Hi Martin,

I find a issue when i verify this bug.

       domdisplay domain [--include-password]
           Output a URI which can be used to connect to the graphical display of the domain via VNC, SPICE or RDP. If --include-password is specified, the SPICE channel password
           will be included in the URI.

There is no doc for this new option in virsh manual.

Do you think is it worth to give a patch for the manual of virsh?

Thanks in advance for your answer.



Thanks,
Luyao Huang

Comment 8 Martin Kletzander 2014-11-21 09:57:58 UTC
Well, we should fix that, whether it's worth back-porting, that I leave to someone else.

Comment 10 Luyao Huang 2014-11-25 06:46:16 UTC
(In reply to Martin Kletzander from comment #8)
> Well, we should fix that, whether it's worth back-porting, that I leave to
> someone else.

Thanks for your answer and verify this bug with libvirt-1.2.8-8.el7:

Check the manual of virsh:
       domdisplay domain [--include-password] [[--type] type]
           Output a URI which can be used to connect to the graphical display of the domain via VNC, SPICE or RDP.  The particular graphical display type can be selected using the
           type parameter (e.g. "vnc", "spice", "rdp").  If --include-password is specified, the SPICE channel password will be included in the URI.

Do the same step with the comment 6.

Comment 12 errata-xmlrpc 2015-03-05 07:24:31 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/RHSA-2015-0323.html