[libvirt] [PATCH] virsh: Add domdisplay command for VNC and SPICE

Christophe Fergeau cfergeau at redhat.com
Fri Jun 22 08:56:07 UTC 2012


Hey,

On Fri, Jun 22, 2012 at 12:30:37AM -0500, Doug Goldstein wrote:
> Add a new 'domdisplay' command that provides a URI for both VNC and
> SPICE connections. Presently the 'vncdisplay' command provides you with
> the port info that QEMU is listening on but there is no counterpart for
> SPICE. Additionally this provides you with the bind address as specified
> in the XML, which the existing 'vncdisplay' lacks.
> 
> Signed-off-by: Doug Goldstein <cardoe at cardoe.com>
> ---
>  tools/virsh.c |  128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 128 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 4d34d49..88d4681 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -13624,6 +13624,133 @@ cmdSysinfo (vshControl *ctl, const vshCmd
> +
> +            if (obj == NULL || obj->type != XPATH_STRING ||
> +                obj->stringval == NULL || obj->stringval[0] == 0 ||
> +                STREQ((const char *)obj->stringval, "0.0.0.0")) {
> +                vshPrint(ctl, "%s://localhost:%d\n", scheme[iter], port);
> +            } else {
> +                vshPrint(ctl, "%s://%s:%d\n", scheme[iter],
> +                        (const char  *)obj->stringval, port);

For SPICE, a URI you can pass to remote-viewer is
spice://hostname?port=xx&tls-port=yy&password=zzzzzzz
For simple cases, spice://hostname:port will be enough, but if you are
using secure channels you need the former.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120622/f4eb7ece/attachment-0001.sig>


More information about the libvir-list mailing list