[Spice-devel] [x11spice 4/4] Add a --enable-dummy option to configure.
Jeremy White
jwhite at codeweavers.com
Fri Apr 12 14:35:34 UTC 2019
Provide some basic documentation as to how to use the new
spice-video-dummy driver.
Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
Makefile.am | 3 +++
README | 19 +++++++++++++++++++
configure.ac | 7 +++++++
spice-video-dummy/spicedummy.sh | 30 ++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+)
create mode 100755 spice-video-dummy/spicedummy.sh
diff --git a/Makefile.am b/Makefile.am
index b9452f6..cd23d81 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,7 @@
SUBDIRS = src
+if DUMMY
+ SUBDIRS += spice-video-dummy
+endif
rpm: dist
rpmbuild -ba --define "_sourcedir $$PWD" src/data/x11spice.spec
diff --git a/README b/README
index 34e8c1f..3dbee80 100644
--- a/README
+++ b/README
@@ -75,6 +75,25 @@ password you can use to connect.
Refer to the x11spice man page for more details.
+Spice Video Dummy Driver
+------------------------
+If you wish to create a 'headless' connection to a server - create an
+X session without using the main system display - there is a straight
+forward process that is now included with x11spice.
+
+That is, x11spice now optionally builds an Xorg driver that is based
+on the dummy driver and the modesetting driver. This gives a virtual
+frame buffer driver which should include modern Mesa capabilities.
+
+To use this driver, simply add:
+
+ --enable-dummy
+
+to the configure line. This will build the Xorg driver. A simplistic
+example is included showing the general concepts of using this driver.
+Refer to the spice-video-dummy/spicedummy.sh bash script for more
+information.
+
Using code coverage (gcov)
-------------------------
diff --git a/configure.ac b/configure.ac
index cee7ec3..0acb4d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,13 @@ PKG_CHECK_MODULES(PIXMAN, pixman-1)
AM_CONDITIONAL([HAVE_GTEST], [pkg-config --atleast-version=2.38 glib-2.0])
+AC_ARG_ENABLE([dummy], AS_HELP_STRING([--enable-dummy], [Builds the spice-video-dummy driver]), [dummy=true])
+AM_CONDITIONAL([DUMMY], test x$dummy = xtrue)
+
+AS_IF([test "x$dummy" = "xtrue"], [
+ AC_CONFIG_SUBDIRS([spice-video-dummy])
+])
+
AC_PROG_SED
# To use gcov, make sure you have the appropriate autoconf macors,
# and uncomment this line, and the matching one in src/Makefile.am.
diff --git a/spice-video-dummy/spicedummy.sh b/spice-video-dummy/spicedummy.sh
new file mode 100755
index 0000000..c83934c
--- /dev/null
+++ b/spice-video-dummy/spicedummy.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# Example script that shows how to launch the spice video driver
+# and attach x11spice to it. This is not meant for production
+# purposes.
+
+export DISPLAY=:2
+
+password=`hexdump -n2 -e '2/1 "%02x"' /dev/urandom`
+zerodir=`dirname $0`
+dummydir=`(cd $zerodir; pwd)`
+xmodules=`Xorg -showDefaultModulePath 2>&1`
+
+# Start Xorg
+xinit -- `which Xorg` $DISPLAY \
+ -modulepath "$dummydir/src/.libs,$xmodules" \
+ -config "$dummydir/spicedummy.conf" &
+xpid=$!
+sleep 1
+
+$dummydir/../src/x11spice --password=$password --allow-control &
+spicepid=$!
+
+echo Xorg server started as pid $xpid
+echo Spice server started as pid $spicepid
+echo You should be able to connect with a spice client now to port 5900,
+echo using a password of $password
+
+wait $spicepid
+
+kill $xpid
--
2.11.0
More information about the Spice-devel
mailing list