[Spice-commits] Branch 'spice.v20' - 5 commits - configure hw/usb-wacom.c hw/vmmouse.c qemu-options.hx ui/spice-core.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Fri Oct 8 03:40:19 PDT 2010


 configure       |    2 +-
 hw/usb-wacom.c  |   13 ++++++++++---
 hw/vmmouse.c    |   31 +++++++++++++++++++++----------
 qemu-options.hx |    4 ++--
 ui/spice-core.c |    9 ++++++---
 5 files changed, 40 insertions(+), 19 deletions(-)

New commits:
commit 727e1bc9c2566f031ecdc26e29e7138cebb4300f
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 8 12:18:24 2010 +0200

    wacom tablet: activate event handlers.
    
    Add qemu_activate_mouse_event_handler() calls to the usb wavom tablet so
    it actually receives events.  Also make sure we only remove the handler
    if we registered it before.

diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c
index fe052eb..47f26cd 100644
--- a/hw/usb-wacom.c
+++ b/hw/usb-wacom.c
@@ -160,6 +160,7 @@ static int usb_mouse_poll(USBWacomState *s, uint8_t *buf, int len)
     if (!s->mouse_grabbed) {
         s->eh_entry = qemu_add_mouse_event_handler(usb_mouse_event, s, 0,
                         "QEMU PenPartner tablet");
+        qemu_activate_mouse_event_handler(s->eh_entry);
         s->mouse_grabbed = 1;
     }
 
@@ -197,6 +198,7 @@ static int usb_wacom_poll(USBWacomState *s, uint8_t *buf, int len)
     if (!s->mouse_grabbed) {
         s->eh_entry = qemu_add_mouse_event_handler(usb_wacom_event, s, 1,
                         "QEMU PenPartner tablet");
+        qemu_activate_mouse_event_handler(s->eh_entry);
         s->mouse_grabbed = 1;
     }
 
@@ -334,8 +336,10 @@ static int usb_wacom_handle_control(USBDevice *dev, int request, int value,
         ret = 0;
         break;
     case WACOM_SET_REPORT:
-        qemu_remove_mouse_event_handler(s->eh_entry);
-        s->mouse_grabbed = 0;
+        if (s->mouse_grabbed) {
+            qemu_remove_mouse_event_handler(s->eh_entry);
+            s->mouse_grabbed = 0;
+        }
         s->mode = data[0];
         ret = 0;
         break;
@@ -397,7 +401,10 @@ static void usb_wacom_handle_destroy(USBDevice *dev)
 {
     USBWacomState *s = (USBWacomState *) dev;
 
-    qemu_remove_mouse_event_handler(s->eh_entry);
+    if (s->mouse_grabbed) {
+        qemu_remove_mouse_event_handler(s->eh_entry);
+        s->mouse_grabbed = 0;
+    }
 }
 
 static int usb_wacom_initfn(USBDevice *dev)
commit 774a5d46410bcc3a1193633beb6183f71d146d06
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Fri Oct 8 11:55:27 2010 +0200

    vmmouse: adapt to mouse handler changes.
    
    This patch updates the vmmouse handler registration and activation.
    
    Old behavior:
      vmmouse_read_id, vmmouse_request_relative and vmmouse_request_absolute
      unregister the handler and re-register it.
    
    New behavior:
      vmmouse_request_relative and vmmouse_request_absolute will unregister
      the handler in case the mode did change.  Then register and active the
      handler with current mode if needed.
    
    Note that the old code never ever *activates* the handler, so the
    vmmouse doesn't receive events.  This trips up Fedora 14 for example:
    Boot a default install without usb tablet, watch the X-Server activating
    the vmmouse then, enjoy a non-functional mouse.

diff --git a/hw/vmmouse.c b/hw/vmmouse.c
index f359304..2097119 100644
--- a/hw/vmmouse.c
+++ b/hw/vmmouse.c
@@ -100,16 +100,29 @@ static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int buttons_
     i8042_isa_mouse_fake_event(s->ps2_mouse);
 }
 
-static void vmmouse_update_handler(VMMouseState *s)
+static void vmmouse_remove_handler(VMMouseState *s)
 {
     if (s->entry) {
         qemu_remove_mouse_event_handler(s->entry);
         s->entry = NULL;
     }
-    if (s->status == 0)
+}
+
+static void vmmouse_update_handler(VMMouseState *s, int absolute)
+{
+    if (s->status != 0) {
+        return;
+    }
+    if (s->absolute != absolute) {
+        s->absolute = absolute;
+        vmmouse_remove_handler(s);
+    }
+    if (s->entry == NULL) {
         s->entry = qemu_add_mouse_event_handler(vmmouse_mouse_event,
                                                 s, s->absolute,
                                                 "vmmouse");
+        qemu_activate_mouse_event_handler(s->entry);
+    }
 }
 
 static void vmmouse_read_id(VMMouseState *s)
@@ -121,28 +134,25 @@ static void vmmouse_read_id(VMMouseState *s)
 
     s->queue[s->nb_queue++] = VMMOUSE_VERSION;
     s->status = 0;
-    vmmouse_update_handler(s);
 }
 
 static void vmmouse_request_relative(VMMouseState *s)
 {
     DPRINTF("vmmouse_request_relative()\n");
-    s->absolute = 0;
-    vmmouse_update_handler(s);
+    vmmouse_update_handler(s, 0);
 }
 
 static void vmmouse_request_absolute(VMMouseState *s)
 {
     DPRINTF("vmmouse_request_absolute()\n");
-    s->absolute = 1;
-    vmmouse_update_handler(s);
+    vmmouse_update_handler(s, 1);
 }
 
 static void vmmouse_disable(VMMouseState *s)
 {
     DPRINTF("vmmouse_disable()\n");
     s->status = 0xffff;
-    vmmouse_update_handler(s);
+    vmmouse_remove_handler(s);
 }
 
 static void vmmouse_data(VMMouseState *s, uint32_t *data, uint32_t size)
@@ -154,7 +164,7 @@ static void vmmouse_data(VMMouseState *s, uint32_t *data, uint32_t size)
     if (size == 0 || size > 6 || size > s->nb_queue) {
         printf("vmmouse: driver requested too much data %d\n", size);
         s->status = 0xffff;
-        vmmouse_update_handler(s);
+        vmmouse_remove_handler(s);
         return;
     }
 
@@ -239,7 +249,8 @@ static int vmmouse_post_load(void *opaque, int version_id)
 {
     VMMouseState *s = opaque;
 
-    vmmouse_update_handler(s);
+    vmmouse_remove_handler(s);
+    vmmouse_update_handler(s, s->absolute);
     return 0;
 }
 
commit 5b5a8da0e5d4db0ae59dcb07366879fca72116e5
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Thu Oct 7 21:23:02 2010 +0200

    spice wan compression: doc speling fix

diff --git a/qemu-options.hx b/qemu-options.hx
index eeb0a6c..9e38dfb 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -723,8 +723,8 @@ spice client is allowed to pick tls/plaintext as he pleases.
 Configure image compression (lossless).
 Default is auto_glz.
 
- at item jpeg-wan-compression=[auto|never|allways]
- at item zlib-glz-wan-compression=[auto|never|allways]
+ at item jpeg-wan-compression=[auto|never|always]
+ at item zlib-glz-wan-compression=[auto|never|always]
 Configure wan image compression (lossy for slow links).
 Default is auto.
 
commit 8bbccde156cc7527abdbf46c5462a2a1bd6bb94d
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Thu Oct 7 21:21:54 2010 +0200

    spice channel security: code style fixup

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 688a60c..813cc10 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -294,12 +294,15 @@ static int add_channel(const char *name, const char *value, void *opaque)
     int security = 0;
     int rc;
 
-    if (strcmp(name, "tls-channel") == 0)
+    if (strcmp(name, "tls-channel") == 0) {
         security = SPICE_CHANNEL_SECURITY_SSL;
-    if (strcmp(name, "plaintext-channel") == 0)
+    }
+    if (strcmp(name, "plaintext-channel") == 0) {
         security = SPICE_CHANNEL_SECURITY_NONE;
-    if (security == 0)
+    }
+    if (security == 0) {
         return 0;
+    }
     if (strcmp(value, "default") == 0) {
         rc = spice_server_set_channel_security(spice_server, NULL, security);
     } else {
commit 9d1cc8ac28cd37250879da38495abe71625b6788
Author: Stefan Weil <weil at mail.berlios.de>
Date:   Thu Oct 7 21:15:58 2010 +0200

    configure: Send error message from spice check to /dev/null
    
    pkg-config is not always available (e.g. on win32 hosts),
    but we don't want to see the 'command not found' error message.
    
    Redirect stdout and stderr to /dev/null.
    
    v2:
    
    * Removed changes which should not have been here.
    
    Cc: Gerd Hoffmann <kraxel at redhat.com>
    Signed-off-by: Stefan Weil <weil at mail.berlios.de>

diff --git a/configure b/configure
index 9e65de0..bf8876c 100755
--- a/configure
+++ b/configure
@@ -2093,7 +2093,7 @@ int main(void) { spice_server_new(); return 0; }
 EOF
   spice_cflags=$($pkgconfig --cflags spice-protocol spice-server 2>/dev/null)
   spice_libs=$($pkgconfig --libs spice-protocol spice-server 2>/dev/null)
-  if $pkgconfig --atleast-version=0.5.3 spice-server &&\
+  if $pkgconfig --atleast-version=0.5.3 spice-server >/dev/null 2>&1 && \
      compile_prog "$spice_cflags" "$spice_libs" ; then
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"


More information about the Spice-commits mailing list