]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Adding support for SDL fullscreen option
authorDaniel Veillard <veillard@redhat.com>
Thu, 11 Dec 2008 11:44:30 +0000 (11:44 +0000)
committerDaniel Veillard <veillard@redhat.com>
Thu, 11 Dec 2008 11:44:30 +0000 (11:44 +0000)
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c
  tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args
  tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml:
  slightly modified patch for SDL fullscreen from Itamar Heim
* docs/formatdomain.html docs/formatdomain.html.in docs/libvirt.rng:
  update the schemas and docs about the sdl graphic element attributes
* AUTHORS: add Itamar Heim
Daniel

12 files changed:
AUTHORS
ChangeLog
docs/formatdomain.html
docs/formatdomain.html.in
docs/libvirt.rng
src/domain_conf.c
src/domain_conf.h
src/qemu_conf.c
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c

diff --git a/AUTHORS b/AUTHORS
index 4d383bc40f07c1c1c7560693696226036795e896..4f7dfa22aab5d24b525048dd327bbfbb472cc009 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -56,6 +56,7 @@ Patches have also been contributed by:
   Ben Guthro           <bguthro@virtualiron.com>
   Shigeki Sakamoto     <fj0588di@aa.jp.fujitsu.com>
   Gerd von Egidy       <lists@egidy.de>
+  Itamar Heim          <iheim@redhat.com>
 
   [....send patches to get your name here....]
 
index 6cdc07a4ab6da3215688906fa0d7e71fa536a05f..000b66d056987c8684dacb821f4242cbb6a6792f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Dec 11 12:39:20 CET 2008 Daniel Veillard <veillard@redhat.com>
+
+       * src/domain_conf.c src/domain_conf.h src/qemu_conf.c
+         tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
+         tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args
+         tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml:
+         slightly modified patch for SDL fullscreen from Itamar Heim
+       * docs/formatdomain.html docs/formatdomain.html.in docs/libvirt.rng:
+         update the schemas and docs about the sdl graphic element attributes
+       * AUTHORS: add Itamar Heim
+
 Wed Dec 10 20:18:36 +0100 2008 Jim Meyering <meyering@redhat.com>
 
        avoid a new "make distcheck" failure
index 05e056c57b9284d1c42d864fdd27ddfee05a16a2..65a3566d283836751a6edfe963a4a155e5af325b 100644 (file)
@@ -713,6 +713,10 @@ qemu-kvm -net nic,model=? /dev/null
         <dl><dt><code>graphics</code></dt><dd>The <code>graphics</code> element has a mandatory <code>type</code>
        attribute which takes the value "sdl" or "vnc". The former displays
        a window on the host desktop, while the latter activates a VNC server.
+        The former accepts 3 optional arguments: a <code>display</code>
+        attribute for the display to use, an <code>xauth</code> attribute for
+        the authentication identifier, and an optional <code>fullscreen</code>
+        attribute accepting values 'yes' or 'no'.
        If the latter is used the <code>port</code> attribute specifies the TCP
        port number (with -1 as legacy syntax indicating that it should be
        auto-allocated). The <code>autoport</code> attribute is the new
index 2482f4bf8ae43a5099304f3b061383c6e8307afb..6d531ce701646455cfad447de30aa5d4f9ce8784 100644 (file)
@@ -657,6 +657,10 @@ qemu-kvm -net nic,model=? /dev/null
       <dd>The <code>graphics</code> element has a mandatory <code>type</code>
        attribute which takes the value "sdl" or "vnc". The former displays
        a window on the host desktop, while the latter activates a VNC server.
+        The former accepts 3 optional arguments: a <code>display</code>
+        attribute for the display to use, an <code>xauth</code> attribute for
+        the authentication identifier, and an optional <code>fullscreen</code>
+        attribute accepting values 'yes' or 'no'.
        If the latter is used the <code>port</code> attribute specifies the TCP
        port number (with -1 as legacy syntax indicating that it should be
        auto-allocated). The <code>autoport</code> attribute is the new
index fdc841506dd432f22c864bd0d2fd42182e4d11a8..52370640ea1f811244ebef224935ffff1ed2fbb0 100644 (file)
 
   <!--
       A graphic description, currently in Xen only 2 types are supported:
-        - sdl without arguments
+        - sdl with optional display, xauth and fullscreen
        - vnc with a required port and optional listen IP address, password
           and keymap
     -->
              <text/>
            </attribute>
          </optional>
+         <optional>
+           <attribute name='fullscreen'>
+             <choice>
+               <value>yes</value>
+               <value>no</value>
+             </choice>
+           </attribute>
+         </optional>
        </group>
        <group>
           <attribute name='type'>
index 32ed59fcd2aa9bdd83357eb14488f2aa5bc3eb87..485ffb2436425344d4a989ab86622d3d624b34f4 100644 (file)
@@ -1401,6 +1401,22 @@ virDomainGraphicsDefParseXML(virConnectPtr conn,
         def->data.vnc.passwd = virXMLPropString(node, "passwd");
         def->data.vnc.keymap = virXMLPropString(node, "keymap");
     } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
+        char *fullscreen = virXMLPropString(node, "fullscreen");
+
+        if (fullscreen != NULL) {
+            if (STREQ(fullscreen, "yes")) {
+                def->data.sdl.fullscreen = 1;
+            } else if (STREQ(fullscreen, "no")) {
+                def->data.sdl.fullscreen = 0;
+            } else {
+                virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+                             _("unknown fullscreen value '%s'"), fullscreen);
+                VIR_FREE(fullscreen);
+                goto error;
+            }
+            VIR_FREE(fullscreen);
+        } else
+            def->data.sdl.fullscreen = 0;
         def->data.sdl.xauth = virXMLPropString(node, "xauth");
         def->data.sdl.display = virXMLPropString(node, "display");
     }
@@ -2951,6 +2967,9 @@ virDomainGraphicsDefFormat(virConnectPtr conn,
         if (def->data.sdl.xauth)
             virBufferEscapeString(buf, " xauth='%s'",
                                   def->data.sdl.xauth);
+        if (def->data.sdl.fullscreen)
+            virBufferAddLit(buf, " fullscreen='yes'");
+
         break;
     }
 
index 51cf6d56d51ba69c81431b1df0e5d7ed93b04afa..d6029ee3f9d4de3a91f4711c07bcf6b32d1b17b9 100644 (file)
@@ -268,6 +268,7 @@ struct _virDomainGraphicsDef {
         struct {
             char *display;
             char *xauth;
+            int fullscreen;
         } sdl;
     } data;
 };
index e6c378f40f9c266698a02e0699adfd7a603864d1..3b846a3e198e5eca938771b2ef7b6928802ec988 100644 (file)
@@ -1229,6 +1229,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
             ADD_ENV(xauth);
         if (display)
             ADD_ENV(display);
+        if (vm->def->graphics->data.sdl.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 (file)
index 0000000..da2adc0
--- /dev/null
@@ -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 (file)
index 0000000..fe1fe1a
--- /dev/null
@@ -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='yes'/>
+  </devices>
+</domain>
index 6e5355a5248bfceaa360b51428ddb71c34b171b9..a04d508fdf1324a9063e896950a4fa48cbd55bc8 100644 (file)
@@ -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);
index c810f78339e8fe1d003e5beb30933fc5a58555a8..613926ab6ced961ed945b3501c0be21b4603e04b 100644 (file)
@@ -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");