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

[Xen-changelog] [xen-unstable] libxl: define libxl_spice_info to hold all info about the spice server



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328020860 0
# Node ID 5d9e86d7e448f365daa05f1f1b6d70948e927400
# Parent  b1580167b3b255072395a75976d9da216e725ef6
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>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r b1580167b3b2 -r 5d9e86d7e448 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Tue Jan 31 14:40:59 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Tue Jan 31 14:41:00 2012 +0000
@@ -290,39 +290,39 @@
     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 b1580167b3b2 -r 5d9e86d7e448 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Tue Jan 31 14:40:59 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Tue Jan 31 14:41:00 2012 +0000
@@ -100,6 +100,26 @@
     ("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 @@
     ("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 b1580167b3b2 -r 5d9e86d7e448 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jan 31 14:40:59 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jan 31 14:41:00 2012 +0000
@@ -381,13 +381,13 @@
         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 @@
         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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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