[Spice-devel] [RFCv2 20/21] xspice: README, config, launcher script

Alon Levy alevy at redhat.com
Fri Apr 29 02:49:58 PDT 2011


---
 README.xspice      |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 TODO.xspice        |   27 +++++++++++++
 spiceqxl.xorg.conf |   15 +++++++
 xspice             |   21 ++++++++++
 4 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 README.xspice
 create mode 100644 TODO.xspice
 create mode 100644 spiceqxl.xorg.conf
 create mode 100755 xspice

diff --git a/README.xspice b/README.xspice
new file mode 100644
index 0000000..398bc53
--- /dev/null
+++ b/README.xspice
@@ -0,0 +1,109 @@
+1. Introduction
+2. Building
+2.1 Building from source on fedora
+2.2 (don't) Building from source with your own Xserver
+3. Running
+
+= 1. Introduction =
+Xspice is an implementation of the SPICE protocol for a standalone X server.
+
+The implementation is based on the existing xf86-video-qxl driver, so much so
+that it made sense to continue development in the same repository.
+
+Xspice is similar to Xvnc / Xrdp in that it allows regular X connections, while
+the spice client provides the actual keyboard and mouse and video output.
+
+Technically we are reusing's Xserver's select loop (like tiger-vnc
+does) and reusing the qxl driver, which has been changed in the following
+ways:
+ * it creates only one memslot, covering the whole of memory (much like
+  spice does in simple display mode, i.e. vga, and the tester does)
+ * it invokes the whole of the qxl device from qemu, patching in both
+  directions.
+  * io becomes a function call instead of iob
+  * irq becomes a function call instead of setting a flag
+  * it runs spice server directly
+ * so it is linked with spice-server as a result.
+
+Protocol wise there is no change.
+
+= 2. Building =
+== 2.1 Building from source on fedora ==
+
+The changes for ubuntu/debian should be minimal:
+ * location of drivers for Xorg (just where you put any qxl_drv.so etc.)
+ * location of Xorg config files
+
+In fedora they are:
+DRV_DIR=/usr/lib64/xorg/modules/drivers
+XORG_CONF_DIR=/etc/X11
+
+git clone git://anongit.freedesktop.org/~alon/xspice
+sudo yum install spice-server-devel spice-protocol
+
+cd xspice
+./autogen && make
+sudo cp src/.libs/spiceqxl_drv.so $DRV_DIR
+
+sudo cp spiceqxl.xorg $XORG_CONF_DIR
+
+Note: this is needed because Xorg only looks in a very particular
+config file path, and "." is not there (nor are absolute file names tolerated).
+
+== 2.2 (don't) Building from source with your own Xserver ==
+
+Note: there is no real reason to do this, but since the instructions
+are already written I'm keeping them. (Well, the only reason is if
+you try to fix some stuff in xserver).
+
+This assumes you already have spice-protocol and spice-server
+installed into $TEST prefix below.
+
+TEST=/store/test
+grab xserver, xspice, xextproto and xkbcomp
+
+for src in git://anongit.freedesktop.org/xorg/proto/xextproto \
+git://anongit.freedesktop.org/xorg/app/xkbcomp \
+git://anongit.freedesktop.org/xorg/xserver \
+git://anongit.freedesktop.org/xorg/lib/libxkbfile \
+git://git.freedesktop.org/git/spice/spice-protocol
+git://anongit.freedesktop.org/~alon/xspice; do git clone $src; done
+
+build and install into some non common prefix (not to overwrite
+your existing server) - note that this is just for testing. This
+should all work with the default server as well, but that server
+requires root generally and this is undesireable for testing (and
+running actually).
+
+export PKG_CONFIG_PATH=${TEST}/lib/pkgconfig
+(cd xextproto; ./autogen.sh --prefix=$TEST --without-xmlto && make -j5 install)
+(cd xserver; ./autogen.sh --prefix=$TEST && make -j5 install)
+(cd xkbcomp; ./autogen.sh --prefix=$TEST && make -j5 install)
+(cd libxkbfile; ./autogen.sh --prefix=$TEST && make -j5 install)
+(cd spice-protocol; ./autogen.sh --prefix=$TEST  --datadir=$TEST/lib && make -j5 install)
+(cd xspice; ./autogen.sh --prefix=$TEST && make -j5 install)
+
+mkdir -p $TEST/etc/X11
+
+place the tested config below in $TEST/etc/X11/spiceqxl.xorg.conf.
+
+last bit is a little ugly (FIXME), copy over the xkb bits from the existing X11
+installation:
+mkdir -p $TEST/share/X11
+cp -R /usr/share/X11/xkb $TEST/share/X11
+
+= 3. Running =
+$XORG is either your own built $TEST/bin/Xorg or just the default Xorg
+
+Run server with:
+$XORG -noreset -config spiceqxl.xorg.conf :3.0
+
+Or equivalently:
+./xspice :3.0
+(xspice is in the current directory, you can copy it to $PATH)
+
+Run X clients as usual by setting DISPLAY=:3.0
+Run spice client with port 5912 (hardcoded currently):
+
+spicec -h localhost -p 5912
+
diff --git a/TODO.xspice b/TODO.xspice
new file mode 100644
index 0000000..82ea5b5
--- /dev/null
+++ b/TODO.xspice
@@ -0,0 +1,27 @@
+TODO:
+
+ OOM. Not releasing?
+  Out of memory allocating 3145748 bytes
+  Out of mem - stats
+
+ Configuration
+  set sport, cert, etc. Via xorg.conf at least. Maybe also command line? follow
+  Xserver ""standard"".
+
+ Cursor channel missing.
+ No copy paste.
+ No agent at all.
+  agent should probably be thought to run with Xspice too. That way
+   mouse emulation in Xspice can be avoided entirely. But how do you
+   get an input device to belong to Xspice :1.0 and not to Xorg :0.0?
+
+ Keyboard:
+  * repeat (xset r 100) does nothing. This is because spice client
+   of course does repeat. But would be nice to transmit this.
+ 
+ Video: youtube seemed choppy, some frames were repeating (cpu 30%~, so not
+  cpu bound). Possible multimedia time? Isn't this set by the driver, i.e.
+  should be identical with in vm qxl driver?
+
+ Performance:
+  didn't check.
diff --git a/spiceqxl.xorg.conf b/spiceqxl.xorg.conf
new file mode 100644
index 0000000..2561ccf
--- /dev/null
+++ b/spiceqxl.xorg.conf
@@ -0,0 +1,15 @@
+Section "Device"
+ Identifier "XSPICE"
+ Driver "spiceqxl"
+EndSection
+
+Section "Monitor"
+    Identifier    "Configured Monitor"
+EndSection
+
+Section "Screen"
+    Identifier     "Default Screen"
+    Monitor        "Configured Monitor"
+    Device        "XSPICE"
+    DefaultDepth    24
+EndSection
diff --git a/xspice b/xspice
new file mode 100755
index 0000000..225b818
--- /dev/null
+++ b/xspice
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# FIXME this is fedora specific and x86_64 specific
+DRV_DIR=/usr/lib64/xorg/modules/drivers/
+CONFIG_DIR=/etc/X11
+if [ ! -e $DRV_DIR/spiceqxl_drv.so ]; then
+    echo missing spiceqxl driver, please:
+    echo cd \$SRC
+    echo make
+    echo sudo cp src/.libs/spiceqxl_drv.so $DRV_DIR
+    exit -1
+fi
+if [ ! -e $CONFIG_DIR/spiceqxl.xorg.conf ]; then
+    echo missing spiceqxl.xorg.conf, please:
+    echo sudo cp \$SRC/spiceqxl.xorg.conf $CONFIG_DIR
+    exit -1
+fi
+CGDB=
+#CGDB="cgdb --args"
+$CGDB Xorg -noreset -config spiceqxl.xorg.conf $*
+
-- 
1.7.4.4



More information about the Spice-devel mailing list