[libvirt] [PATCH] add fullscreen support to qemu sdl xml (via fullscreen='true' attribute for the graphics element)

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

 



diff --git a/src/domain_conf.c b/src/domain_conf.c

index 32ed59f..018d07f 100644

--- a/src/domain_conf.c

+++ b/src/domain_conf.c

@@ -212,6 +212,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def)

     case VIR_DOMAIN_GRAPHICS_TYPE_SDL:

         VIR_FREE(def->data.sdl.display);

         VIR_FREE(def->data.sdl.xauth);

+        VIR_FREE(def->data.sdl.fullscreen);

         break;

     }

 

@@ -1403,6 +1404,7 @@ virDomainGraphicsDefParseXML(virConnectPtr conn,

     } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {

         def->data.sdl.xauth = virXMLPropString(node, "xauth");

         def->data.sdl.display = virXMLPropString(node, "display");

+        def->data.sdl.fullscreen = virXMLPropString(node, "fullscreen");

     }

 

 cleanup:

@@ -2951,6 +2953,10 @@ virDomainGraphicsDefFormat(virConnectPtr conn,

         if (def->data.sdl.xauth)

             virBufferEscapeString(buf, " xauth='%s'",

                                   def->data.sdl.xauth);

+        if (def->data.sdl.fullscreen)

+            virBufferEscapeString(buf, " fullscreen='%s'",

+                                  def->data.sdl.fullscreen);

+

         break;

     }

 

diff --git a/src/domain_conf.h b/src/domain_conf.h

index 51cf6d5..436d0b1 100644

--- a/src/domain_conf.h

+++ b/src/domain_conf.h

@@ -268,6 +268,7 @@ struct _virDomainGraphicsDef {

         struct {

             char *display;

             char *xauth;

+            char *fullscreen;

         } sdl;

     } data;

 };

diff --git a/src/qemu_conf.c b/src/qemu_conf.c

index e6c378f..e53f5f0 100644

--- a/src/qemu_conf.c

+++ b/src/qemu_conf.c

@@ -35,6 +35,7 @@

 #include <sys/wait.h>

 #include <arpa/inet.h>

 #include <sys/utsname.h>

+#include <stdbool.h>

 

 #if HAVE_NUMACTL

 #define NUMA_VERSION1_COMPATIBILITY 1

@@ -1213,6 +1214,7 @@ int qemudBuildCommandLine(virConnectPtr conn,

                vm->def->graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {

         char *xauth = NULL;

         char *display = NULL;

+        bool fullscreen = false;

 

         if (vm->def->graphics->data.sdl.xauth &&

             asprintf(&xauth, "XAUTHORITY=%s",

@@ -1225,10 +1227,17 @@ int qemudBuildCommandLine(virConnectPtr conn,

             goto no_memory;

         }

 

+        if (vm->def->graphics->data.sdl.fullscreen &&

+            STREQ(vm->def->graphics->data.sdl.fullscreen, "true")) {

+           fullscreen=true;

+        }

+

         if (xauth)

             ADD_ENV(xauth);

         if (display)

             ADD_ENV(display);

+        if (fullscreen)

+            ADD_ARG_LIT("-full-screen");

     }

 

     /* Add sound hardware */

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args

new file mode 100644

index 0000000..da2adc0

--- /dev/null

+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args

@@ -0,0 +1 @@

+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test XAUTHORITY=/root/.Xauthority DISPLAY=:0.1 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -full-screen

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml

new file mode 100644

index 0000000..007677a

--- /dev/null

+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml

@@ -0,0 +1,24 @@

+<domain type='qemu'>

+  <name>QEMUGuest1</name>

+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>

+  <memory>219200</memory>

+  <currentMemory>219200</currentMemory>

+  <vcpu>1</vcpu>

+  <os>

+    <type arch='i686' machine='pc'>hvm</type>

+    <boot dev='hd'/>

+  </os>

+  <clock offset='utc'/>

+  <on_poweroff>destroy</on_poweroff>

+  <on_reboot>restart</on_reboot>

+  <on_crash>destroy</on_crash>

+  <devices>

+    <emulator>/usr/bin/qemu</emulator>

+    <disk type='block' device='disk'>

+      <source dev='/dev/HostVG/QEMUGuest1'/>

+      <target dev='hda' bus='ide'/>

+    </disk>

+    <input type='mouse' bus='ps2'/>

+    <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority' fullscreen='true'/>

+  </devices>

+</domain>

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c

index 6e5355a..a04d508 100644

--- a/tests/qemuxml2argvtest.c

+++ b/tests/qemuxml2argvtest.c

@@ -195,6 +195,7 @@ mymain(int argc, char **argv)

     DO_TEST("disk-usb", 0);

     DO_TEST("graphics-vnc", 0);

     DO_TEST("graphics-sdl", 0);

+    DO_TEST("graphics-sdl-fullscreen", 0);

     DO_TEST("input-usbmouse", 0);

     DO_TEST("input-usbtablet", 0);

     DO_TEST("input-xen", 0);

diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c

index c810f78..613926a 100644

--- a/tests/qemuxml2xmltest.c

+++ b/tests/qemuxml2xmltest.c

@@ -98,6 +98,7 @@ mymain(int argc, char **argv)

     DO_TEST("disk-usb");

     DO_TEST("graphics-vnc");

     DO_TEST("graphics-sdl");

+    DO_TEST("graphics-sdl-fullscreen");

     DO_TEST("input-usbmouse");

     DO_TEST("input-usbtablet");

     DO_TEST("input-xen");

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]