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 997802 - domdisplay should show all URI if config both vnc and spice in guest
Summary: domdisplay should show all URI if config both vnc and spice in guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 997805
TreeView+ depends on / blocked
 
Reported: 2013-08-16 08:47 UTC by zhe peng
Modified: 2015-03-05 07:24 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.8-8.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 997805 (view as bug list)
Environment:
Last Closed: 2015-03-05 07:24:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

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


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