[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 05 of 20] libxl: define libxl_spice_info to hold all info about the spice server



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1327336697 0
# Node ID e241db296cbfa86557cd5cfaf7bb870e455dedad
# Parent  83418dbcfc0ab05da8dc1774e66deeb421eae003
libxl: define libxl_spice_info to hold all info about the spice server

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 83418dbcfc0a -r e241db296cbf tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Mon Jan 23 16:38:17 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Mon Jan 23 16:38:17 2012 +0000
@@ -290,39 +290,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 83418dbcfc0a -r e241db296cbf tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Mon Jan 23 16:38:17 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Mon Jan 23 16:38:17 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 83418dbcfc0a -r e241db296cbf tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Jan 23 16:38:17 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Mon Jan 23 16:38:17 2012 +0000
@@ -380,13 +380,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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.