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

xserver-xorg-video-qxl: Changes to 'upstream-unstable'



 NEWS                                |   13 ++
 configure.ac                        |    5 
 examples/spiceqxl.xorg.conf.example |  187 +++++++++++++++++++-----------------
 scripts/Xspice                      |   74 ++++++++------
 src/qxl_uxa.c                       |   10 +
 src/spiceqxl_audio.c                |    2 
 src/spiceqxl_main_loop.c            |   99 +++++++++++++++++--
 src/spiceqxl_spice_server.c         |   12 +-
 8 files changed, 266 insertions(+), 136 deletions(-)

New commits:
commit 8d344cf49fdb021ab80354eaaa57a419a6746a56
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Mon Dec 19 17:36:36 2016 +0100

    NEWS: Xspice now works with X.org 1.19

diff --git a/NEWS b/NEWS
index 237d121..f4cf81f 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ Fix Xspice crashing after 11 days
 Add --numheads argument to Xspice script
 Allow to setup video codec for streaming when using Xspice (requires
 spice-server 0.13.2)
-X.Org 1.19 fixes (Xspice is still non-functional with it)
+Add support for X.Org 1.19
 Fix compilation on arches which do not have outb (aarch64)
 
 Major changes in 0.1.4

commit a283cda0c4dbacb1d4b398b45f271275a3d1121a
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Mon Dec 19 17:28:41 2016 +0100

    Revert "Remove unused 'event_mask' field"
    
    This reverts commit bfb724076d575d5a49d08913b86885688251a176.
    This was pushed by mistake.

diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index 86dcad3..0213693 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -338,6 +338,7 @@ static void xspice_wakeup_handler(pointer data, int nfds, pointer readmask)
 
 struct SpiceWatch {
     int fd;
+    int event_mask;
     SpiceWatchFunc func;
     void *opaque;
 };
@@ -346,11 +347,11 @@ static void watch_fd_notified(int fd, int xevents, void *data)
 {
     SpiceWatch *watch = (SpiceWatch *)data;
 
-    if (xevents & X_NOTIFY_READ) {
+    if ((watch->event_mask & SPICE_WATCH_EVENT_READ) && (xevents & X_NOTIFY_READ)) {
         watch->func(watch->fd, SPICE_WATCH_EVENT_READ, watch->opaque);
     }
 
-    if (xevents & X_NOTIFY_WRITE) {
+    if ((watch->event_mask & SPICE_WATCH_EVENT_WRITE) && (xevents & X_NOTIFY_WRITE)) {
         watch->func(watch->fd, SPICE_WATCH_EVENT_WRITE, watch->opaque);
     }
 }
@@ -360,6 +361,7 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
     int x_event_mask = 0;
 
     SetNotifyFd(watch->fd, NULL, X_NOTIFY_NONE, NULL);
+    watch->event_mask = 0;
 
     if (event_mask & SPICE_WATCH_EVENT_READ) {
         x_event_mask |= X_NOTIFY_READ;
@@ -372,6 +374,7 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
         return -1;
     }
     SetNotifyFd(watch->fd, watch_fd_notified, x_event_mask, watch);
+    watch->event_mask = event_mask;
 
     return 0;
 }

commit bfb724076d575d5a49d08913b86885688251a176
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Mon Dec 19 10:51:09 2016 +0100

    Remove unused 'event_mask' field
    
    With the Xorg 1.19 codepaths, the 'event_mask' field of SpiceWatch is
    only useful for sanity checking the event we get from Xorg. This commit
    assumes Xorg is sane, and removes this extra field.

diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index 0213693..86dcad3 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -338,7 +338,6 @@ static void xspice_wakeup_handler(pointer data, int nfds, pointer readmask)
 
 struct SpiceWatch {
     int fd;
-    int event_mask;
     SpiceWatchFunc func;
     void *opaque;
 };
@@ -347,11 +346,11 @@ static void watch_fd_notified(int fd, int xevents, void *data)
 {
     SpiceWatch *watch = (SpiceWatch *)data;
 
-    if ((watch->event_mask & SPICE_WATCH_EVENT_READ) && (xevents & X_NOTIFY_READ)) {
+    if (xevents & X_NOTIFY_READ) {
         watch->func(watch->fd, SPICE_WATCH_EVENT_READ, watch->opaque);
     }
 
-    if ((watch->event_mask & SPICE_WATCH_EVENT_WRITE) && (xevents & X_NOTIFY_WRITE)) {
+    if (xevents & X_NOTIFY_WRITE) {
         watch->func(watch->fd, SPICE_WATCH_EVENT_WRITE, watch->opaque);
     }
 }
@@ -361,7 +360,6 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
     int x_event_mask = 0;
 
     SetNotifyFd(watch->fd, NULL, X_NOTIFY_NONE, NULL);
-    watch->event_mask = 0;
 
     if (event_mask & SPICE_WATCH_EVENT_READ) {
         x_event_mask |= X_NOTIFY_READ;
@@ -374,7 +372,6 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
         return -1;
     }
     SetNotifyFd(watch->fd, watch_fd_notified, x_event_mask, watch);
-    watch->event_mask = event_mask;
 
     return 0;
 }

commit 009776a8a3fb096b11ec95033d1e1a366e26f188
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Thu Dec 15 10:47:51 2016 +0100

    Xspice: Replace malloc/strdup use with xnfalloc/xnfstrdup
    
    spiceqxl_*.c files are Xspice-only code. They contain a few uses of
    malloc/strdup, and none of these are checked for failure. It's better to
    replace these with xfnalloc/xnfstrdup which are provided by the X server
    and cannot fail (aborts on failure).
    
    Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/src/spiceqxl_audio.c b/src/spiceqxl_audio.c
index 52a45f0..ec9260d 100644
--- a/src/spiceqxl_audio.c
+++ b/src/spiceqxl_audio.c
@@ -405,7 +405,7 @@ static void handle_one_change(qxl_screen_t *qxl, struct inotify_event *e)
             return;
         }
 
-        fname = malloc(strlen(e->name) + strlen(qxl->playback_fifo_dir) + 1 + 1);
+        fname = xnfalloc(strlen(e->name) + strlen(qxl->playback_fifo_dir) + 1 + 1);
         strcpy(fname, qxl->playback_fifo_dir);
         strcat(fname, "/");
         strcat(fname, e->name);
diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index af20a5a..0213693 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -209,7 +209,7 @@ int watch_count = 0;
 
 static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
 {
-    SpiceWatch *watch = malloc(sizeof(SpiceWatch));
+    SpiceWatch *watch = xnfalloc(sizeof(SpiceWatch));
 
     DPRINTF(0, "adding %p, fd=%d at %d", watch,
         fd, watch_count);
@@ -381,7 +381,7 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
 
 static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
 {
-    SpiceWatch *watch = malloc(sizeof(SpiceWatch));
+    SpiceWatch *watch = xnfalloc(sizeof(SpiceWatch));
 
     DPRINTF(0, "adding %p, fd=%d", watch, fd);
 
diff --git a/src/spiceqxl_spice_server.c b/src/spiceqxl_spice_server.c
index 6e8cf50..38257d0 100644
--- a/src/spiceqxl_spice_server.c
+++ b/src/spiceqxl_spice_server.c
@@ -200,23 +200,23 @@ void xspice_set_spice_server_options(OptionInfoPtr options)
         len = strlen(x509_dir) + 32;
 
         if (x509_key_file_base) {
-            x509_key_file = strdup(x509_key_file_base);
+            x509_key_file = xnfstrdup(x509_key_file_base);
         } else {
-            x509_key_file = malloc(len);
+            x509_key_file = xnfalloc(len);
             snprintf(x509_key_file, len, "%s/%s", x509_dir, X509_SERVER_KEY_FILE);
         }
 
         if (x509_cert_file_base) {
-            x509_cert_file = strdup(x509_cert_file_base);
+            x509_cert_file = xnfstrdup(x509_cert_file_base);
         } else {
-            x509_cert_file = malloc(len);
+            x509_cert_file = xnfalloc(len);
             snprintf(x509_cert_file, len, "%s/%s", x509_dir, X509_SERVER_CERT_FILE);
         }
 
         if (x509_cacert_file_base) {
-            x509_cacert_file = strdup(x509_cert_file_base);
+            x509_cacert_file = xnfstrdup(x509_cert_file_base);
         } else {
-            x509_cacert_file = malloc(len);
+            x509_cacert_file = xnfalloc(len);
             snprintf(x509_cacert_file, len, "%s/%s", x509_dir, X509_CA_CERT_FILE);
         }
     }

commit db353f559d32119e811eab71a9d3128847a64609
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Wed Dec 14 10:37:03 2016 +0100

    xspice: Adjust to X.org 1.19 changes
    
    In newer X.org versions, it's no longer supported to modify the set of
    FDs passed to a BlockHandler method to get notified when the FD has data
    to be read. This was limited anyway as we could only get read events
    this way, and had to do our own polling to get notified about socket
    writeability.
    
    Starting from xserver 1.19, the supported way of doing this is to use
    the SetNotifyFd/RemoveNotifyFd API, which is actually a much better way
    as it matches very well the 'watch' API spice-server expects Xspice to
    implement.
    
    This commit switches to that new API, which removes the need for
    RegisterBlockAndWakeupHandlers().
    
    Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Uri Lublin <uril@redhat.com>

diff --git a/configure.ac b/configure.ac
index e865e75..b737d0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,8 +68,6 @@ PKG_CHECK_EXISTS(xfont2,
 
 # Obtain compiler/linker options for the driver dependencies
 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $xfont_pc $REQUIRED_MODULES)
-# Check for xorg 1.19 as XSpice is currently not working with it
-PKG_CHECK_EXISTS([xorg-server >= 1.18.99], [has_xorg119=yes])
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
@@ -141,9 +139,6 @@ if test "x$enable_xspice" = "xyes"; then
         AC_SUBST(SPICE_LIBS)
     ],
     )
-    if test x"${enable_xspice}" = "xyes" && test x"${has_xorg119}" = "xyes"; then
-        AC_MSG_ERROR("XSpice cannot currently work against X.Org 1.19")
-    fi
 else
     enable_xspice=no
 fi
diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index 49b715a..af20a5a 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -193,6 +193,7 @@ static void timer_remove(SpiceTimer *timer)
     free(timer);
 }
 
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 23
 struct SpiceWatch {
     RingItem link;
     int fd;
@@ -236,11 +237,6 @@ static void watch_remove(SpiceWatch *watch)
     watch_count--;
 }
 
-static void channel_event(int event, SpiceChannelEventInfo *info)
-{
-    NOT_IMPLEMENTED
-}
-
 static int set_watch_fds(fd_set *rfds, fd_set *wfds)
 {
     SpiceWatch *watch;
@@ -276,7 +272,7 @@ static void xspice_block_handler(pointer data, OSTimePtr timeout, pointer readma
 /*
  * xserver only calls wakeup_handler with the read fd_set, so we
  * must either patch it or do a polling select ourselves, this is the
- * later approach. Since we are already doing a polling select, we
+ * latter approach. Since we are already doing a polling select, we
  * already select on all (we could avoid selecting on the read since
  * that *is* actually taken care of by the wakeup handler).
  */
@@ -338,9 +334,93 @@ static void xspice_wakeup_handler(pointer data, int nfds, pointer readmask)
     select_and_check_watches();
 }
 
+#else /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 23 */
+
+struct SpiceWatch {
+    int fd;
+    int event_mask;
+    SpiceWatchFunc func;
+    void *opaque;
+};
+
+static void watch_fd_notified(int fd, int xevents, void *data)
+{
+    SpiceWatch *watch = (SpiceWatch *)data;
+
+    if ((watch->event_mask & SPICE_WATCH_EVENT_READ) && (xevents & X_NOTIFY_READ)) {
+        watch->func(watch->fd, SPICE_WATCH_EVENT_READ, watch->opaque);
+    }
+
+    if ((watch->event_mask & SPICE_WATCH_EVENT_WRITE) && (xevents & X_NOTIFY_WRITE)) {
+        watch->func(watch->fd, SPICE_WATCH_EVENT_WRITE, watch->opaque);
+    }
+}
+
+static int watch_update_mask_internal(SpiceWatch *watch, int event_mask)
+{
+    int x_event_mask = 0;
+
+    SetNotifyFd(watch->fd, NULL, X_NOTIFY_NONE, NULL);
+    watch->event_mask = 0;
+
+    if (event_mask & SPICE_WATCH_EVENT_READ) {
+        x_event_mask |= X_NOTIFY_READ;
+    }
+    if (event_mask & SPICE_WATCH_EVENT_WRITE) {
+        x_event_mask |= X_NOTIFY_WRITE;
+    }
+    if (x_event_mask == 0) {
+        DPRINTF(0, "Unexpected watch event_mask: %i", event_mask);
+        return -1;
+    }
+    SetNotifyFd(watch->fd, watch_fd_notified, x_event_mask, watch);
+    watch->event_mask = event_mask;
+
+    return 0;
+}
+
+static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
+{
+    SpiceWatch *watch = malloc(sizeof(SpiceWatch));
+
+    DPRINTF(0, "adding %p, fd=%d", watch, fd);
+
+    watch->fd = fd;
+    watch->func = func;
+    watch->opaque = opaque;
+    if (watch_update_mask_internal(watch, event_mask) != 0) {
+        free(watch);
+        return NULL;
+    }
+
+    return watch;
+}
+
+static void watch_update_mask(SpiceWatch *watch, int event_mask)
+{
+    DPRINTF(0, "fd %d to %d", watch->fd, event_mask);
+    watch_update_mask_internal(watch, event_mask);
+}
+
+static void watch_remove(SpiceWatch *watch)
+{
+    DPRINTF(0, "remove %p (fd %d)", watch, watch->fd);
+    RemoveNotifyFd(watch->fd);
+    free(watch);
+}
+#endif
+
+static void channel_event(int event, SpiceChannelEventInfo *info)
+{
+    NOT_IMPLEMENTED
+}
+
+
 SpiceCoreInterface *basic_event_loop_init(void)
 {
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 23
     ring_init(&watches);
+#endif
     bzero(&core, sizeof(core));
     core.base.major_version = SPICE_INTERFACE_CORE_MAJOR;
     core.base.minor_version = SPICE_INTERFACE_CORE_MINOR; // anything less then 3 and channel_event isn't called
@@ -355,7 +435,10 @@ SpiceCoreInterface *basic_event_loop_init(void)
     return &core;
 }
 
+
 void xspice_register_handlers(void)
 {
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 23
     RegisterBlockAndWakeupHandlers(xspice_block_handler, xspice_wakeup_handler, 0);
+#endif
 }

commit 13d4afc1ba55eaed3e7ed4da8c948d3f334598d3
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Thu Apr 14 18:05:59 2016 +0200

    build-sys: Update for 0.1.5 release

diff --git a/NEWS b/NEWS
index 59e0e4b..237d121 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+Major changes in 0.1.5
+======================
+
+Fix X restarts when kms is in use with multiple monitors
+Various Xspice fixes and improvements (agent fixes, command line handling,
+documentation, delayed fps, audio playback)
+Fix Xspice crashing after 11 days
+Add --numheads argument to Xspice script
+Allow to setup video codec for streaming when using Xspice (requires
+spice-server 0.13.2)
+X.Org 1.19 fixes (Xspice is still non-functional with it)
+Fix compilation on arches which do not have outb (aarch64)
+
 Major changes in 0.1.4
 ======================
 Added smartcard support to XSpice
diff --git a/configure.ac b/configure.ac
index 62ffb71..e865e75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-qxl],
-        [0.1.4],
+        [0.1.5],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-qxl])
 AC_CONFIG_SRCDIR([Makefile.am])

commit ce00ab5df8cee45b0dc029973d6eeb937547144d
Author: Francois Gouget <fgouget@codeweavers.com>
Date:   Thu Dec 8 09:15:55 2016 +0100

    spiceqxl: Improve the Xspice and Xorg configuration option descriptions
    
    Group the options more logically and improve their descriptions.
    Add the missing help strings for Xspice --help and standardize the
    messages to start with a lowercase and not end with a period.
    In the Xorg configuration, always show the default in the
    commented-out sample.
    
    Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
    Acked-by: Christophe Fergeau <cfergeau@redhat.com>

diff --git a/examples/spiceqxl.xorg.conf.example b/examples/spiceqxl.xorg.conf.example
index b6f4840..ba828a4 100644
--- a/examples/spiceqxl.xorg.conf.example
+++ b/examples/spiceqxl.xorg.conf.example
@@ -2,111 +2,126 @@ Section "Device"
     Identifier "XSPICE"
     Driver "spiceqxl"
 
-    # Enable regular port. Either this or SpiceTlsPort, or one of XSPICE_PORT or
-    # XSPICE_TLS_PORT environment variables must be specified
-    # Specify 0 to disable the use of the regular port
-    # default: 5900
-    #Option "SpicePort" "5900"
+    # ---- Network and security options
 
-    # Enable a TLS (encrypted) port. Either this or SpicePort must be specified,
-    # either here or via environment varialbes or via xspice --port or --tls-port
-    #Option "SpiceTlsPort" "5901"
-    
-    # Listen to a specific interface. Default is to listen to all (0.0.0.0)
-    #Option "SpiceAddr" ""
+    # Do not require a client password.
+    # default: False
+    #Option "SpiceDisableTicketing" "False"
+
+    # Set the password required to connect to the Spice server.
+    #Option "SpicePassword" ""
 
-    # Enable usage of SASL supported by spice-gtk client. Not required,
+    # Enable usage of SASL supported by the spice-gtk client. Not required,
     # default: False
-    #Option "SpiceSasl" "True"
+    #Option "SpiceSasl" "False"
+
+    # Use Spice's regular unencrypted port. One of SpicePort or SpiceTlsPort
+    # must be specified. SpicePort can also be set through the XSPICE_PORT
+    # environment variable or the --port Xspice option.
+    # Specify 0 to disable the use of the regular port
+    # default: 5900
+    #Option "SpicePort" "5900"
 
-    # Do not request any password from client
-    #Option "SpiceDisableTicketing" "0"
+    # Use a TLS (encrypted) port. One of SpicePort or SpiceTlsPort must be
+    # specified. SpiceTlsPort can also be set through the XSPICE_TLS_PORT
+    # environment variable or the --tls-port Xspice option.
+    #Option "SpiceTlsPort" "5900"
 
-    # Set directory where cacert, server key and server cert are searched
-    # using the same predefined names qemu uses:
+    # Set the directory where the CA certificate, server key and server
+    # certificate are searched for TLS, using the same predefined names QEMU
+    # uses:
     #   cacert.pem, server-key.pem, server-cert.pem
     #Option "SpiceX509Dir" ""
 
-    # Set password client will be required to produce.
-    #Option "SpicePassword" ""
+    # Set the CA certificate file location for TLS.
+    #Option "SpiceCacertFile" ""
 
-    # Set spice server key file.
+    # Set the server key file location for TLS.
     #Option "SpiceX509KeyFile" ""
 
-    # Set cert file location.
+    # Set the server key's password for TLS.
+    #Option "SpiceX509KeyPassword" ""
+
+    # Set the server certificate file location for TLS.
     #Option "SpiceX509CertFile" ""
 
-    # Set key file password.
-    #Option "SpiceX509KeyPassword" ""
+    # Set the server DH file location for TLS.
+    #Option "SpiceDhFile" ""
 
-    # Set tls ciphers used.
+    # Set the TLS ciphers preference order.
     #Option "SpiceTlsCiphers" ""
 
-    # Set cacert file.
-    #Option "SpiceCacertFile" ""
+    # Listen to a specific interface.
+    # default: Listen to all (0.0.0.0).
+    #Option "SpiceAddr" ""
 
-    # Set dh file used.
-    #Option "SpiceDhFile" ""
+    # Set to True to only listen on IPv4 interfaces.
+    # default: False
+    #Option "SpiceIPV4Only" "False"
 
-    # Set streaming video method. Options are filter, off, all
-    # default: filter
-    #Option "SpiceStreamingVideo" ""
+    # Set to True to only listen on IPv6 interfaces.
+    # default: False
+    #Option "SpiceIPV6Only" "False"
+
+    # If set, the Spice server will exit when the first client disconnects.
+    # default: False
+    #Option "SpiceExitOnDisconnect" "True"
+
+
+    # ---- Monitor configuration options
+
+    # The number of heads to allocate by default.
+    # default: 4
+    #Option "NumHeads" "4"
 
-    # Set video codecs to use.  Provide a semicolon list of
-    # codecs, in preference order.  Each codec requires an encoder
-    # which can be one of spice or gstreamer, and then a codec type,
-    # for instance mjpeg or vp8. The default is spice:mjpeg,
-    # which uses the builtin mjpeg encoder.
-    #Option "SpiceVideoCodecs" ""
+
+    # ---- Compression options
 
     # Set zlib glz wan compression. Options are auto, never, always.
     # default: auto
     #Option "SpiceZlibGlzWanCompression" ""
 
-    # Set jpeg wan compression. Options are auto, never, always
+    # Set jpeg wan compression. Options are auto, never, always.
     # default: auto
     #Option "SpiceJpegWanCompression" ""
 
-    # Set image compression. Options are off,auto_glz,auto_lz,quic,glz,lz.
+    # Set image compression. Options are off, auto_glz, auto_lz, quic, glz, lz.
     # default: auto_glz
     #Option "SpiceImageCompression" ""
 
-    # Set to true to only listen on ipv4 interfaces.
-    # default: False
-    #Option "SpiceIPV4Only" ""
-
-    # Set to true to only listen on ipv6 interfaces.
-    # default: False
-    #Option "SpiceIPV6Only" ""
-
     # If non zero, the driver will render all operations to the frame buffer,
-    #  and keep track of a changed rectangle list.  The changed rectangles
-    #  will be transmitted at the rate requested (e.g. 10 Frames Per Second)
+    # and keep track of a changed rectangle list. The changed rectangles
+    # will be transmitted at the rate requested (e.g. 10 frames per second).
     # This can dramatically reduce network bandwidth for some use cases.
     #Option "SpiceDeferredFPS" "10"
 
-    # If set, the Spice Server will exit when the first client disconnects
-    #Option "SpiceExitOnDisconnect" "1"
+    # Set the streaming video method. Options are filter, off, all.
+    # default: filter
+    #Option "SpiceStreamingVideo" ""
+
+    # Sets a semicolon-separated list of preferred video codecs.
+    # Each takes the form encoder:codec, with spice:mjpeg being the default,
+    # and other options being provided by gstreamer for the mjpeg, vp8 and h264
+    # codecs.
+    #Option "SpiceVideoCodecs" ""
 
-    # Enable caching of images directly written with uxa->put_image
+    # Enable caching of images directly written with uxa->put_image.
     # default: True
     #Option "EnableImageCache" "True"
 
-    # Enable caching of images created by uxa->prepare_access
+    # Enable caching of images created by uxa->prepare_access.
     # default: True
     #Option "EnableFallbackCache" "True"
 
-    # Enable the use of off screen srufaces
+    # Enable the use of off-screen surfaces.
     # default: True
     #Option "EnableSurfaces" "True"
 
-    # The number of heads to allocate by default
-    # default: 4
-    #Option "NumHeads" "4"
 
-    #--------------------------------------------------------------
+    # ---- Xspice-specific buffer options
+
     # Buffer Size notes:
-    #  The following buffer sizes are used for Xspice only
+    #  The following buffer sizes are used for Xspice only.
     #  If you are using the DFPS mode, surface ram is not used,
     #  and you can set it to 1.
     #  Otherwise, the surface buffer should be at least as large
@@ -117,13 +132,12 @@ Section "Device"
     #   is a command buffer 7x the size of the frame buffer.
     #  If you see 'Out of memory' errors in your xorg.log, you probably need
     #   to increase the surface or command buffer sizes.
-    #--------------------------------------------------------------
 
-    # The amount of surface buffer ram, in megabytes, to allocate
+    # The amount of surface buffer ram, in megabytes, to allocate.
     # default: 128
     #Option "SurfaceBufferSize" "128"
 
-    # The amount of command buffer ram, in megabytes, to allocate
+    # The amount of command buffer ram, in megabytes, to allocate.
     # default: 128
     #Option "CommandBufferSize" "128"
 
@@ -134,51 +148,52 @@ Section "Device"
     # default: 16
     #Option "FrameBufferSize" "16"
 
-    # Whether or not to accept Vdagent connections
+
+    # ---- VDAgent options
+
+    # Whether or not to accept Vdagent connections.
     # default: False
     #Option "SpiceVdagentEnabled" "False"
 
-    # Default path to listen for agent virtual io connections
-    #  default: /tmp/xspice-virtio"
+    # Default path to listen for agent virtual io connections.
+    # default: /tmp/xspice-virtio"
     #Option "SpiceVdagentVirtioPath" "/tmp/xspice-virtio"
 
-    # Default path to listen for agent uinput connections
-    #  default: /tmp/xspice-uinput
+    # Default path to listen for agent uinput connections.
+    # default: /tmp/xspice-uinput
     #Option "SpiceVdagentUinputPath" "/tmp/xspice-uinput"
 
-    # Default user id to set for the Virtio and Uinput sockets
-    #  default: 0, or none
-    #  Note: both uid and gid must be given for either to take
-    #  effect
+    # Default user id to set for the Virtio and Uinput sockets.
+    # Note: both uid and gid must be given for either to take effect.
+    # default: 0, or none
     #Option "SpiceVdagentUid" "0"
 
-    # Default group id to set for the Virtio and Uinput sockets
-    #  default: 0, or none
-    #  Note: both uid and gid must be given for either to take
-    #  effect
+    # Default group id to set for the Virtio and Uinput sockets.
+    # Note: both uid and gid must be given for either to take effect.
+    # default: 0, or none
     #Option "SpiceVdagentGid" "0"
 
-    # Set Spice Agent Mouse - Use Agent mouse if an agent connects
+    # Set Spice Agent Mouse - Use Agent mouse if an agent connects.
     # default: True
     #Option "SpiceAgentMouse" "True"
 
-    # Set Spice Playback compression
+    # Set Spice Playback compression.
     # default: True
     #Option "SpicePlaybackCompression" "True"
 
-    # Disable copy and paste
+    # Disable copy and paste.
     # default: False
     #Option "SpiceDisableCopyPaste" "False"
 
-    # If a directory is given, any file in that
-    #  directory will be read for audio data to be sent
-    #  to the client.   Default is no mixing.
-    #Option "SpicePlaybackFIFODir"  "/tmp/"
+    # If a directory is given, any file in that directory will be read
+    # for audio data to be sent to the client.
+    # default: Not set.
+    #Option "SpicePlaybackFIFODir" "/tmp/"
 
-    # A unix domain name for a unix domain socket
-    #  to communicate with a spiceccid smartcard driver
-    #  Default is not to use a smartcard driver.
-    #Option "SpiceSmartCardFile"  "/tmp/spice.pcsc.comm"
+    # A unix domain name for a unix domain socket to communicate with
+    # a spiceccid smartcard driver.
+    # default: Not set.
+    #Option "SpiceSmartCardFile" "/tmp/spice.pcsc.comm"
 EndSection
 
 Section "InputDevice"
diff --git a/scripts/Xspice b/scripts/Xspice
index bf8112f..ada99d1 100755
--- a/scripts/Xspice
+++ b/scripts/Xspice
@@ -52,54 +52,64 @@ wan_compression_options = ['auto', 'never', 'always']
 parser = argparse.ArgumentParser("Xspice",
     description="X and Spice server. example usage: Xspice --port 5900 --disable-ticketing :1.0",
     usage="Xspice [Xspice and Xorg options intermixed]",
-    epilog="Any options not parsed by Xspice get passed to Xorg as is.")
-parser.add_argument('--xorg', default=which('Xorg'))
-parser.add_argument('--auto', action='store_true', help='Automatically create a temporary xorg.conf and start the X server')
-parser.add_argument('--xsession', help='If given, will run after Xorg launch.  Should be a program like x-session-manager')
-parser.add_argument('--config', default='spiceqxl.xorg.conf')
+    epilog="Any option not parsed by Xspice gets passed to Xorg as is.")
+
+# X-related options
+parser.add_argument('--xorg', default=which('Xorg'), help='specify the path to the Xorg binary')
+parser.add_argument('--config', default='spiceqxl.xorg.conf', help='specify the path to the Xspice configuration')
+parser.add_argument('--auto', action='store_true', help='automatically create a temporary xorg.conf and start the X server')
+parser.add_argument('--xsession', help='if given, will run after Xorg launch.  Should be a program like x-session-manager')
+
+# Network and security options
+add_boolean('--disable-ticketing', help="do not require a client password")
+parser.add_argument('--password', help="set the password required to connect to the server")
+add_boolean('--sasl', help="use SASL to authenticate to the server")
 # Don't use any options that are already used by Xorg (unless we must)
 # specifically, don't use -p and -s.
-parser.add_argument('--port', type=int, help='standard spice port')
-parser.add_argument('--exit-on-disconnect', action='store_true', help='Exit the X server when any client disconnects')
-parser.add_argument('--numheads', type=int, help='Number of virtual heads to create.')
-parser.add_argument('--deferred-fps', type=int, help='If given, render to a buffer and send updates only this many times per second')
-parser.add_argument('--tls-port', type=int, help='spice tls port', default=0)
-add_boolean('--disable-ticketing', help="do not require a client password")
-add_boolean('--sasl', help="enable sasl")
-parser.add_argument('--x509-dir', help="x509 directory for tls")
-parser.add_argument('--cacert-file', help="ca certificate file for tls")
-parser.add_argument('--x509-cert-file', help="server certificate file for tls")
-parser.add_argument('--x509-key-file', help="server key file for tls")
-parser.add_argument('--x509-key-password', help="key file password for tls")
-parser.add_argument('--tls-ciphers')
-parser.add_argument('--dh-file')
-parser.add_argument('--password', help="set password required to connect to server")
-parser.add_argument('--image-compression',
-                    choices = ['off', 'auto_glz', 'auto_lz', 'quic',
-                               'glz', 'lz'],
-                    help='auto_glz by default')
+parser.add_argument('--port', type=int, help="use the specified port as Spice's regular unencrypted port")
+parser.add_argument('--tls-port', type=int, help='use the specified port as a TLS (encrypted) port', default=0)
+parser.add_argument('--x509-dir', help="set the directory where the CA certificate, server key and server certificate are searched for TLS, using the same predefined names QEMU uses")
+parser.add_argument('--cacert-file', help="set the CA certificate file location for TLS")
+parser.add_argument('--x509-key-file', help="set the server key file location for TLS")
+parser.add_argument('--x509-key-password', help="set the server key's password for TLS")
+parser.add_argument('--x509-cert-file', help="set the server certificate file location for TLS")
+parser.add_argument('--dh-file', help="set the server DH file location for TLS")
+parser.add_argument('--tls-ciphers', help="set the TLS ciphers preference order")
+add_boolean('--ipv4-only', help="only accept IP v4 connections")
+add_boolean('--ipv6-only', help="only accept IP v6 connections")
+parser.add_argument('--exit-on-disconnect', action='store_true', help='exit the X server when any client disconnects')
+
+# Monitor configuration options
+parser.add_argument('--numheads', type=int, help='number of virtual heads to create')
+
+# Compression options
 parser.add_argument('--jpeg-wan-compression',
                     choices=wan_compression_options,
-                    help='auto by default')
+                    help="set jpeg wan compression")
 parser.add_argument('--zlib-glz-wan-compression',
                     choices=wan_compression_options,
-                    help='auto by default')
+                    help="set zlib glz wan compressions")
+parser.add_argument('--image-compression',
+                    choices = ['off', 'auto_glz', 'auto_lz', 'quic',
+                               'glz', 'lz'],
+                    help="set image compression")
+parser.add_argument('--deferred-fps', type=int, help='if non zero, the driver will render all operations to the frame buffer, and keep track of a changed rectangle list. The changed rectangles will be transmitted at the rate requested (e.g. 10 frames per second). This can dramatically reduce network bandwidth for some use cases')
 # TODO - sound support
 parser.add_argument('--streaming-video', choices=['off', 'all', 'filter'],
-                    help='filter by default')
-parser.add_argument('--video-codecs', help="Sets a semicolon-separated list of preferred video codecs to use. Each takes the form encoder:codec, with spice:mjpeg being the default and other options being provided by gstreamer for the mjpeg, vp8 and h264 codecs.")
-add_boolean('--ipv4-only')
-add_boolean('--ipv6-only')
+                    help='set the streaming video method')
+parser.add_argument('--video-codecs', help='set a semicolon-separated list of preferred video codecs to use. Each takes the form encoder:codec, with spice:mjpeg being the default and other options being provided by gstreamer for the mjpeg, vp8 and h264 codecs')
+
+# VDAgent options
 parser.add_argument('--vdagent', action='store_true', dest='vdagent_enabled', default=False, help='launch vdagent & vdagentd. They provide clipboard & resolution automation')
 parser.add_argument('--vdagent-virtio-path', help='virtio socket path used by vdagentd')
 parser.add_argument('--vdagent-uinput-path', help='uinput socket path used by vdagent')
-parser.add_argument('--vdagent-udcs-path', help='udcs socket path used by vdagent and vdagentd')
+parser.add_argument('--vdagent-udcs-path', help='Unix domain socket path used by vdagent and vdagentd')
 parser.add_argument('--vdagentd-exec', help='path to spice-vdagentd (used with --vdagent)')
 parser.add_argument('--vdagent-exec', help='path to spice-vdagent (used with --vdagent)')
 parser.add_argument('--vdagent-no-launch', default=True, action='store_false', dest='vdagent_launch', help='do not launch vdagent & vdagentd, used for debugging or if some external script wants to take care of that')
 parser.add_argument('--vdagent-uid', default=str(os.getuid()), help='set vdagent user id. changing it makes sense only in conjunction with --vdagent-no-launch')
 parser.add_argument('--vdagent-gid', default=str(os.getgid()), help='set vdagent group id. changing it makes sense only in conjunction with --vdagent-no-launch')
-parser.add_argument('--audio-fifo-dir', help="set fifo directory for playback audio. designed to work with PulseAudio's module-pipe-sink")
+parser.add_argument('--audio-fifo-dir', help="if a directory is given, any file in that directory will be read for audio data to be sent to the client. This is designed to work with PulseAudio's module-pipe-sink")
 
 #TODO
 #Option "SpiceAddr" ""

commit 7657ffb8a5cba20f221c2af93e0c83b81356053c
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Fri Oct 28 11:56:47 2016 +0200

    build: Error out when enabling xspice with X.Org 1.19
    
    xspice needs to be updated to cope with some X.Org 1.19 API changes,
    better to make that explicit at configure time rather than letting
    people discover the hard way (it builds with warnings but will not work)
    that it's broken.

diff --git a/configure.ac b/configure.ac
index 451d42a..62ffb71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,7 +68,8 @@ PKG_CHECK_EXISTS(xfont2,
 
 # Obtain compiler/linker options for the driver dependencies
 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $xfont_pc $REQUIRED_MODULES)
-
+# Check for xorg 1.19 as XSpice is currently not working with it
+PKG_CHECK_EXISTS([xorg-server >= 1.18.99], [has_xorg119=yes])
 
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
@@ -139,7 +140,10 @@ if test "x$enable_xspice" = "xyes"; then
         AC_SUBST(SPICE_CFLAGS)
         AC_SUBST(SPICE_LIBS)
     ],
-)
+    )
+    if test x"${enable_xspice}" = "xyes" && test x"${has_xorg119}" = "xyes"; then
+        AC_MSG_ERROR("XSpice cannot currently work against X.Org 1.19")
+    fi
 else
     enable_xspice=no
 fi

commit 4783c5439552a461516a6d917765000a9b60c295
Author: Christophe Fergeau <cfergeau@redhat.com>
Date:   Fri Oct 28 10:54:55 2016 +0200

    Fix "calles" typo in comment

diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index db89b6d..49b715a 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -274,7 +274,7 @@ static void xspice_block_handler(pointer data, OSTimePtr timeout, pointer readma
 }
 
 /*
- * xserver only calles wakeup_handler with the read fd_set, so we
+ * xserver only calls wakeup_handler with the read fd_set, so we
  * must either patch it or do a polling select ourselves, this is the
  * later approach. Since we are already doing a polling select, we
  * already select on all (we could avoid selecting on the read since

commit 4fbe63601d5806814b9bcaef07349759a4b0834d
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Aug 5 16:58:04 2016 +0200

    Disable composite/a8 surfaces for KMS
    
    This should help with bug #974198

diff --git a/src/qxl_uxa.c b/src/qxl_uxa.c
index 694db27..fa7d85f 100644
--- a/src/qxl_uxa.c
+++ b/src/qxl_uxa.c
@@ -221,12 +221,16 @@ qxl_has_composite (qxl_screen_t *qxl)
 {
 #ifdef XF86DRM_MODE
     if (qxl->kms_enabled) {
+#if 0 /* KMS Composite support seems broken - needs better hw support */
 	static Bool result, checked;
 	if (!checked) {
 	    result = qxl_kms_check_cap(qxl, SPICE_DISPLAY_CAP_COMPOSITE);
 	    checked = TRUE;
 	}
 	return result;
+#else
+	return FALSE;
+#endif
     }
 #endif
 #ifndef XSPICE
@@ -244,12 +248,16 @@ qxl_has_a8_surfaces (qxl_screen_t *qxl)
 {
 #ifdef XF86DRM_MODE
     if (qxl->kms_enabled) {
+#if 0 /* KMS Composite support seems broken - needs better hw support */
         static Bool result, checked;
 	if (!checked) {
             result = qxl_kms_check_cap(qxl, SPICE_DISPLAY_CAP_A8_SURFACE);
 	    checked = TRUE;
 	}
 	return result;
+#else
+	return FALSE;
+#endif
     }
 #endif
 #ifndef XSPICE

commit 0daf59bd23b8b92b69a28b7bb1fa5961a8e86d97
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Aug 5 16:55:31 2016 +0200

    Disable surfaces when KMS is used
    
    This is not working properly at the moment.

diff --git a/src/qxl_uxa.c b/src/qxl_uxa.c
index 875d663..694db27 100644
--- a/src/qxl_uxa.c
+++ b/src/qxl_uxa.c
@@ -414,6 +414,8 @@ qxl_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage)
     ErrorF ("Create pixmap: %d %d @ %d (usage: %d)\n", w, h, depth, usage);
 #endif
 
+    if (qxl->kms_enabled)
+	goto fallback;
     if (uxa_swapped_out (screen))
 	goto fallback;
 


Reply to: