Mailing List Archive

[PATCH 06 of 32 RFC] libxl: define libxl_spice_info to hold all info about the spice server
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1326215019 0
# Node ID 3308d2dfd9dddb36f8a65e7a44916c6bcf02170e
# Parent ed7106b3f874d93e8ed8d05a8464099e611edd0b
libxl: define libxl_spice_info to hold all info about the spice server

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r ed7106b3f874 -r 3308d2dfd9dd tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Tue Jan 10 16:19:52 2012 +0000
+++ b/tools/libxl/libxl_dm.c Tue Jan 10 17:03:39 2012 +0000
@@ -298,39 +298,39 @@ static char ** libxl__build_device_model
if (info->sdl) {
flexarray_append(dm_args, "-sdl");
}
- if (info->spice) {
+ if (info->spice.enable) {
char *spiceoptions = NULL;
- if (!info->spiceport && !info->spicetls_port) {
+ if (!info->spice.port && !info->spice.tls_port) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
"at least one of the spiceport or tls_port must be provided");
return NULL;
}

- if (!info->spicedisable_ticketing) {
- if (!info->spicepasswd) {
+ if (!info->spice.disable_ticketing) {
+ if (!info->spice.passwd) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
"spice ticketing is enabled but missing password");
return NULL;
}
- else if (!info->spicepasswd[0]) {
+ else if (!info->spice.passwd[0]) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
"spice password can't be empty");
return NULL;
}
}
spiceoptions = libxl__sprintf(gc, "port=%d,tls-port=%d",
- info->spiceport, info->spicetls_port);
- if (info->spicehost)
+ info->spice.port, info->spice.tls_port);
+ if (info->spice.host)
spiceoptions = libxl__sprintf(gc,
- "%s,addr=%s", spiceoptions, info->spicehost);
- if (info->spicedisable_ticketing)
+ "%s,addr=%s", spiceoptions, info->spice.host);
+ if (info->spice.disable_ticketing)
spiceoptions = libxl__sprintf(gc, "%s,disable-ticketing",
spiceoptions);
else
spiceoptions = libxl__sprintf(gc,
- "%s,password=%s", spiceoptions, info->spicepasswd);
+ "%s,password=%s", spiceoptions, info->spice.passwd);
spiceoptions = libxl__sprintf(gc, "%s,agent-mouse=%s", spiceoptions,
- info->spiceagent_mouse ? "on" : "off");
+ info->spice.agent_mouse ? "on" : "off");

flexarray_append(dm_args, "-spice");
flexarray_append(dm_args, spiceoptions);
diff -r ed7106b3f874 -r 3308d2dfd9dd tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl Tue Jan 10 16:19:52 2012 +0000
+++ b/tools/libxl/libxl_types.idl Tue Jan 10 17:03:39 2012 +0000
@@ -105,6 +105,26 @@ libxl_vnc_info = Struct("vnc_info", [
("findunused", bool),
])

+libxl_spice_info = Struct("spice_info", [.
+ ("enable", bool),
+ # At least one of spice port or spicetls_post must be given
+ ("port", integer),
+ ("tls_port", integer),
+ # Interface to bind to
+ ("host", string),
+ # enable client connection with no password
+ ("disable_ticketing", bool),
+ ("passwd", string),
+ ("agent_mouse", bool),
+ ])
+
+libxl_sdl_info = Struct("sdl_info", [.
+ ("enable", bool),
+ ("opengl", bool),
+ ("display", string),
+ ("xauthority", string),
+ ])
+
libxl_dominfo = Struct("dominfo",[
("uuid", libxl_uuid),
("domid", libxl_domid),
@@ -237,16 +257,7 @@ libxl_device_model_info = Struct("device
("keymap", string),
("sdl", bool),
("opengl", bool), # (requires sdl enabled)
- ("spice", bool),
- # At least one of spice port or spicetls_post must be given
- ("spiceport", integer),
- ("spicetls_port", integer),
- # Interface to bind to
- ("spicehost", string),
- # enable client connection with no password
- ("spicedisable_ticketing", bool),
- ("spicepasswd", string),
- ("spiceagent_mouse", bool),
+ ("spice", libxl_spice_info),
("nographic", bool),
("gfx_passthru", bool),
("serial", string),
diff -r ed7106b3f874 -r 3308d2dfd9dd tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Tue Jan 10 16:19:52 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c Tue Jan 10 17:03:39 2012 +0000
@@ -378,13 +378,13 @@ static void printf_info(int domid,
printf("\t\t\t(usb %d)\n", dm_info->usb);
printf("\t\t\t(usbdevice %s)\n", dm_info->usbdevice);
printf("\t\t\t(acpi %d)\n", dm_info->acpi);
- printf("\t\t\t(spice %d)\n", dm_info->spice);
- printf("\t\t\t(spiceport %d)\n", dm_info->spiceport);
- printf("\t\t\t(spicetls_port %d)\n", dm_info->spicetls_port);
- printf("\t\t\t(spicehost %s)\n", dm_info->spicehost);
+ printf("\t\t\t(spice %d)\n", dm_info->spice.enable);
+ printf("\t\t\t(spiceport %d)\n", dm_info->spice.port);
+ printf("\t\t\t(spicetls_port %d)\n", dm_info->spice.tls_port);
+ printf("\t\t\t(spicehost %s)\n", dm_info->spice.host);
printf("\t\t\t(spicedisable_ticketing %d)\n",
- dm_info->spicedisable_ticketing);
- printf("\t\t\t(spiceagent_mouse %d)\n", dm_info->spiceagent_mouse);
+ dm_info->spice.disable_ticketing);
+ printf("\t\t\t(spiceagent_mouse %d)\n", dm_info->spice.agent_mouse);
printf("\t\t)\n");
break;
case LIBXL_DOMAIN_TYPE_PV:
@@ -1191,19 +1191,20 @@ skip_vfb:
if (!xlu_cfg_get_long (config, "opengl", &l, 0))
dm_info->opengl = l;
if (!xlu_cfg_get_long (config, "spice", &l, 0))
- dm_info->spice = l;
+ dm_info->spice.enable = l;
if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
- dm_info->spiceport = l;
+ dm_info->spice.port = l;
if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
- dm_info->spicetls_port = l;
- xlu_cfg_replace_string (config, "spicehost", &dm_info->spicehost, 0);
+ dm_info->spice.tls_port = l;
+ xlu_cfg_replace_string (config, "spicehost", &dm_info->spice.host, 0);
if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
- dm_info->spicedisable_ticketing = l;
- xlu_cfg_replace_string (config, "spicepasswd", &dm_info->spicepasswd, 0);
+ dm_info->spice.disable_ticketing = l;
+ xlu_cfg_replace_string (config, "spicepasswd",
+ &dm_info->spice.passwd, 0);
if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
- dm_info->spiceagent_mouse = l;
+ dm_info->spice.agent_mouse = l;
else
- dm_info->spiceagent_mouse = 1;
+ dm_info->spice.agent_mouse = 1;
if (!xlu_cfg_get_long (config, "nographic", &l, 0))
dm_info->nographic = l;
if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: [PATCH 06 of 32 RFC] libxl: define libxl_spice_info to hold all info about the spice server [ In reply to ]
Ian Campbell writes ("[Xen-devel] [PATCH 06 of 32 RFC] libxl: define libxl_spice> libxl: define libxl_spice_info to hold all info about the spice server

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel