diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-01-31 14:41:00 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-01-31 14:41:00 +0000 |
commit | 3a375e0f6db6e3aa0eea036cf67d6852be76e7c4 (patch) | |
tree | 006ed3ed265c9e2531648bbccbb6881b2188aa4f /tools | |
parent | 6b320d280fd80b09c78dbc78acde3ebd3c46845a (diff) | |
download | xen-3a375e0f6db6e3aa0eea036cf67d6852be76e7c4.tar.gz xen-3a375e0f6db6e3aa0eea036cf67d6852be76e7c4.tar.bz2 xen-3a375e0f6db6e3aa0eea036cf67d6852be76e7c4.zip |
libxl: define libxl_spice_info to hold all info about the spice server
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/libxl_dm.c | 22 | ||||
-rw-r--r-- | tools/libxl/libxl_types.idl | 31 | ||||
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 29 |
3 files changed, 47 insertions, 35 deletions
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index fe0300def0..c5efbe1287 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -290,39 +290,39 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, 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 --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index db43b2e2bc..abd55b82c8 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -100,6 +100,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), @@ -233,16 +253,7 @@ libxl_device_model_info = Struct("device_model_info",[ ("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 --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index ea038746b5..cd2c48c996 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -381,13 +381,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: @@ -1275,19 +1275,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)) |