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

[Xen-changelog] [xen-unstable] libxl: define libxl_sdl_info to hold all info about the SDL config



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328020860 0
# Node ID 9f0c4da3cbef636e730280f6755f5968873b2344
# Parent  5d9e86d7e448f365daa05f1f1b6d70948e927400
libxl: define libxl_sdl_info to hold all info about the SDL config

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


diff -r 5d9e86d7e448 -r 9f0c4da3cbef tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Jan 31 14:41:00 2012 +0000
+++ b/tools/libxl/libxl.c       Tue Jan 31 14:41:00 2012 +0000
@@ -2188,16 +2188,16 @@
 int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb)
 {
     memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    vfb->display = NULL;
-    vfb->xauthority = NULL;
     vfb->vnc.enable = 1;
     vfb->vnc.passwd = NULL;
     vfb->vnc.listen = strdup("127.0.0.1");
     vfb->vnc.display = 0;
     vfb->vnc.findunused = 1;
     vfb->keymap = NULL;
-    vfb->sdl = 0;
-    vfb->opengl = 0;
+    vfb->sdl.enable = 0;
+    vfb->sdl.opengl = 0;
+    vfb->sdl.display = NULL;
+    vfb->sdl.xauthority = NULL;
     return 0;
 }
 
@@ -2248,16 +2248,19 @@
                           libxl__sprintf(gc, "%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
                           libxl__sprintf(gc, "%d", vfb->vnc.findunused));
-    flexarray_append_pair(back, "sdl", libxl__sprintf(gc, "%d", vfb->sdl));
-    flexarray_append_pair(back, "opengl", libxl__sprintf(gc, "%d", 
vfb->opengl));
-    if (vfb->xauthority) {
-        flexarray_append_pair(back, "xauthority", vfb->xauthority);
+    flexarray_append_pair(back, "sdl",
+                          libxl__sprintf(gc, "%d", vfb->sdl.enable));
+    flexarray_append_pair(back, "opengl",
+                          libxl__sprintf(gc, "%d", vfb->sdl.opengl));
+    if (vfb->sdl.xauthority) {
+        flexarray_append_pair(back, "xauthority", vfb->sdl.xauthority);
     }
-    if (vfb->display) {
-        flexarray_append_pair(back, "display", vfb->display);
+    if (vfb->sdl.display) {
+        flexarray_append_pair(back, "display", vfb->sdl.display);
     }
 
-    flexarray_append_pair(front, "backend-id", libxl__sprintf(gc, "%d", 
vfb->backend_domid));
+    flexarray_append_pair(front, "backend-id",
+                          libxl__sprintf(gc, "%d", vfb->backend_domid));
     flexarray_append_pair(front, "state", libxl__sprintf(gc, "%d", 1));
 
     libxl__device_generic_add(gc, &device,
diff -r 5d9e86d7e448 -r 9f0c4da3cbef tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Tue Jan 31 14:41:00 2012 +0000
+++ b/tools/libxl/libxl_create.c        Tue Jan 31 14:41:00 2012 +0000
@@ -134,8 +134,8 @@
     dm_info->vnc.display = 0;
     dm_info->vnc.findunused = 1;
     dm_info->keymap = NULL;
-    dm_info->sdl = 0;
-    dm_info->opengl = 0;
+    dm_info->sdl.enable = 0;
+    dm_info->sdl.opengl = 0;
     dm_info->nographic = 0;
     dm_info->serial = NULL;
     dm_info->boot = strdup("cda");
diff -r 5d9e86d7e448 -r 9f0c4da3cbef tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Tue Jan 31 14:41:00 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Tue Jan 31 14:41:00 2012 +0000
@@ -120,16 +120,17 @@
             flexarray_append(dm_args, "-vncunused");
         }
     }
-    if (info->sdl) {
+    if (info->sdl.enable) {
         flexarray_append(dm_args, "-sdl");
-        if (!info->opengl) {
+        if (!info->sdl.opengl) {
             flexarray_append(dm_args, "-disable-opengl");
         }
+        /* XXX info->sdl.{display,xauthority} into $DISPLAY/$XAUTHORITY */
     }
     if (info->keymap) {
         flexarray_vappend(dm_args, "-k", info->keymap, NULL);
     }
-    if (info->nographic && (!info->sdl && !info->vnc.enable)) {
+    if (info->nographic && (!info->sdl.enable && !info->vnc.enable)) {
         flexarray_append(dm_args, "-nographic");
     }
     if (info->serial) {
@@ -287,8 +288,9 @@
                     libxl__sprintf(gc, "%s:%d%s", listen, display,
                         info->vnc.findunused ? ",to=99" : ""));
     }
-    if (info->sdl) {
+    if (info->sdl.enable) {
         flexarray_append(dm_args, "-sdl");
+        /* XXX info->sdl.{display,xauthority} into $DISPLAY/$XAUTHORITY */
     }
     if (info->spice.enable) {
         char *spiceoptions = NULL;
@@ -335,7 +337,7 @@
     if (info->keymap) {
         flexarray_vappend(dm_args, "-k", info->keymap, NULL);
     }
-    if (info->nographic && (!info->sdl && !info->vnc.enable)) {
+    if (info->nographic && (!info->sdl.enable && !info->vnc.enable)) {
         flexarray_append(dm_args, "-nographic");
     }
     if (info->serial) {
@@ -526,7 +528,6 @@
     vfb->vnc = info->vnc;
     vfb->keymap = info->keymap;
     vfb->sdl = info->sdl;
-    vfb->opengl = info->opengl;
 
     vkb->backend_domid = 0;
     vkb->devid = 0;
@@ -981,7 +982,6 @@
         if (vfb->keymap)
             info->keymap = libxl__strdup(gc, vfb->keymap);
         info->sdl = vfb->sdl;
-        info->opengl = vfb->opengl;
     } else
         info->nographic = 1;
     info->domid = domid;
diff -r 5d9e86d7e448 -r 9f0c4da3cbef tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Tue Jan 31 14:41:00 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Tue Jan 31 14:41:00 2012 +0000
@@ -251,8 +251,7 @@
     ("vnc",              libxl_vnc_info),
     # keyboard layout, default is en-us keyboard
     ("keymap",           string),
-    ("sdl",              bool),
-    ("opengl",           bool), # (requires sdl enabled)
+    ("sdl",              libxl_sdl_info),
     ("spice",            libxl_spice_info),
     ("nographic",        bool),
     ("gfx_passthru",     bool),
@@ -279,12 +278,9 @@
     ("backend_domid", libxl_domid),
     ("devid",         integer),
     ("vnc",           libxl_vnc_info),
+    ("sdl",           libxl_sdl_info),
     # set keyboard layout, default is en-us keyboard
     ("keymap",        string),
-    ("sdl",           bool),
-    ("opengl",        bool), # (if enabled requires sdl enabled)
-    ("display",       string),
-    ("xauthority",    string),
     ])
 
 libxl_device_vkb = Struct("device_vkb", [
diff -r 5d9e86d7e448 -r 9f0c4da3cbef tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jan 31 14:41:00 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jan 31 14:41:00 2012 +0000
@@ -372,9 +372,9 @@
         printf("\t\t\t(vncdisplay %d)\n", dm_info->vnc.display);
         printf("\t\t\t(vncunused %d)\n", dm_info->vnc.findunused);
         printf("\t\t\t(keymap %s)\n", dm_info->keymap);
-        printf("\t\t\t(sdl %d)\n", dm_info->sdl);
+        printf("\t\t\t(sdl %d)\n", dm_info->sdl.enable);
         printf("\t\t\t(gfx_passthru %d)\n", dm_info->gfx_passthru);
-        printf("\t\t\t(opengl %d)\n", dm_info->opengl);
+        printf("\t\t\t(opengl %d)\n", dm_info->sdl.opengl);
         printf("\t\t\t(nographic %d)\n", dm_info->nographic);
         printf("\t\t\t(serial %s)\n", dm_info->serial);
         printf("\t\t\t(boot %s)\n", dm_info->boot);
@@ -462,10 +462,10 @@
         printf("\t\t\t(vncdisplay %d)\n", d_config->vfbs[i].vnc.display);
         printf("\t\t\t(vncunused %d)\n", d_config->vfbs[i].vnc.findunused);
         printf("\t\t\t(keymap %s)\n", d_config->vfbs[i].keymap);
-        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl);
-        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].opengl);
-        printf("\t\t\t(display %s)\n", d_config->vfbs[i].display);
-        printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].xauthority);
+        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl.enable);
+        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].sdl.opengl);
+        printf("\t\t\t(display %s)\n", d_config->vfbs[i].sdl.display);
+        printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].sdl.xauthority);
         printf("\t\t)\n");
         printf("\t)\n");
     }
@@ -1060,15 +1060,15 @@
                     free(vfb->keymap);
                     vfb->keymap = strdup(p2 + 1);
                 } else if (!strcmp(p, "sdl")) {
-                    vfb->sdl = atoi(p2 + 1);
+                    vfb->sdl.enable = atoi(p2 + 1);
                 } else if (!strcmp(p, "opengl")) {
-                    vfb->opengl = atoi(p2 + 1);
+                    vfb->sdl.opengl = atoi(p2 + 1);
                 } else if (!strcmp(p, "display")) {
-                    free(vfb->display);
-                    vfb->display = strdup(p2 + 1);
+                    free(vfb->sdl.display);
+                    vfb->sdl.display = strdup(p2 + 1);
                 } else if (!strcmp(p, "xauthority")) {
-                    free(vfb->xauthority);
-                    vfb->xauthority = strdup(p2 + 1);
+                    free(vfb->sdl.xauthority);
+                    vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
 skip_vfb:
@@ -1271,9 +1271,9 @@
             dm_info->vnc.findunused = l;
         xlu_cfg_replace_string (config, "keymap", &dm_info->keymap, 0);
         if (!xlu_cfg_get_long (config, "sdl", &l, 0))
-            dm_info->sdl = l;
+            dm_info->sdl.enable = l;
         if (!xlu_cfg_get_long (config, "opengl", &l, 0))
-            dm_info->opengl = l;
+            dm_info->sdl.opengl = l;
         if (!xlu_cfg_get_long (config, "spice", &l, 0))
             dm_info->spice.enable = l;
         if (!xlu_cfg_get_long (config, "spiceport", &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®.