Red Hat Bugzilla – Bug 997802
domdisplay should show all URI if config both vnc and spice in guest
Last modified: 2015-03-05 02:24:31 EST
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:
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.
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
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
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
Well, we should fix that, whether it's worth back-porting, that I leave to someone else.
(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.
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