From a3d570c7b98d28deb99be4d69ec20a31420e0598 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 11 Dec 2008 11:44:30 +0000 Subject: [PATCH] Adding support for SDL fullscreen option * 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 --- AUTHORS | 1 + ChangeLog | 11 +++++++++ docs/formatdomain.html | 4 ++++ docs/formatdomain.html.in | 4 ++++ docs/libvirt.rng | 10 +++++++- src/domain_conf.c | 19 +++++++++++++++ src/domain_conf.h | 1 + src/qemu_conf.c | 2 ++ .../qemuxml2argv-graphics-sdl-fullscreen.args | 1 + .../qemuxml2argv-graphics-sdl-fullscreen.xml | 24 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 12 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml diff --git a/AUTHORS b/AUTHORS index 4d383bc40f..4f7dfa22aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -56,6 +56,7 @@ Patches have also been contributed by: Ben Guthro Shigeki Sakamoto Gerd von Egidy + Itamar Heim [....send patches to get your name here....] diff --git a/ChangeLog b/ChangeLog index 6cdc07a4ab..000b66d056 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Dec 11 12:39:20 CET 2008 Daniel Veillard + + * 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 avoid a new "make distcheck" failure diff --git a/docs/formatdomain.html b/docs/formatdomain.html index 05e056c57b..65a3566d28 100644 --- a/docs/formatdomain.html +++ b/docs/formatdomain.html @@ -713,6 +713,10 @@ qemu-kvm -net nic,model=? /dev/null
graphics
The graphics element has a mandatory type 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 display + attribute for the display to use, an xauth attribute for + the authentication identifier, and an optional fullscreen + attribute accepting values 'yes' or 'no'. If the latter is used the port attribute specifies the TCP port number (with -1 as legacy syntax indicating that it should be auto-allocated). The autoport attribute is the new diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2482f4bf8a..6d531ce701 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -657,6 +657,10 @@ qemu-kvm -net nic,model=? /dev/null
The graphics element has a mandatory type 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 display + attribute for the display to use, an xauth attribute for + the authentication identifier, and an optional fullscreen + attribute accepting values 'yes' or 'no'. If the latter is used the port attribute specifies the TCP port number (with -1 as legacy syntax indicating that it should be auto-allocated). The autoport attribute is the new diff --git a/docs/libvirt.rng b/docs/libvirt.rng index fdc841506d..52370640ea 100644 --- a/docs/libvirt.rng +++ b/docs/libvirt.rng @@ -638,7 +638,7 @@ @@ -659,6 +659,14 @@ + + + + yes + no + + + diff --git a/src/domain_conf.c b/src/domain_conf.c index 32ed59fcd2..485ffb2436 100644 --- a/src/domain_conf.c +++ b/src/domain_conf.c @@ -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; } diff --git a/src/domain_conf.h b/src/domain_conf.h index 51cf6d56d5..d6029ee3f9 100644 --- a/src/domain_conf.h +++ b/src/domain_conf.h @@ -268,6 +268,7 @@ struct _virDomainGraphicsDef { struct { char *display; char *xauth; + int fullscreen; } sdl; } data; }; diff --git a/src/qemu_conf.c b/src/qemu_conf.c index e6c378f40f..3b846a3e19 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -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 index 0000000000..da2adc0c64 --- /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 0000000000..fe1fe1acaf --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml @@ -0,0 +1,24 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219200 + 219200 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6e5355a524..a04d508fdf 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 c810f78339..613926ab6c 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"); -- GitLab