Bug 997802 - domdisplay should show all URI if config both vnc and spice in guest
domdisplay should show all URI if config both vnc and spice in guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Martin Kletzander
Virtualization Bugs
: Upstream
Depends On:
Blocks: 997805
  Show dependency treegraph
 
Reported: 2013-08-16 04:47 EDT by zhe peng
Modified: 2015-03-05 02:24 EST (History)
7 users (show)

See Also:
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 02:24:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description zhe peng 2013-08-16 04:47:58 EDT
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 Berrange 2013-08-16 06:10:31 EDT
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 10:25:10 EDT
Fixed upstream by v1.2.6-255-gdd4791c:

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

    virsh: add option for selecting domdisplay type
Comment 6 Luyao Huang 2014-11-20 22:06:57 EST
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-20 22:12:00 EST
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 04:57:58 EST
Well, we should fix that, whether it's worth back-porting, that I leave to someone else.
Comment 10 Luyao Huang 2014-11-25 01:46:16 EST
(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 02:24:31 EST
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

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