[Spice-commits] 12 commits - MAINTAINERS Makefile hw/char hw/core include/hw tests/Makefile ui/gtk.c ui/spice-display.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Mon Apr 7 23:35:58 PDT 2014


 MAINTAINERS                   |    3 +-
 Makefile                      |    2 -
 hw/char/serial.c              |    6 +++--
 hw/core/fw-path-provider.c    |    3 +-
 include/hw/fw-path-provider.h |    3 +-
 tests/Makefile                |    3 +-
 ui/gtk.c                      |   46 ++++++++++++++++++++++++++++++------------
 ui/spice-display.c            |    4 +++
 8 files changed, 50 insertions(+), 20 deletions(-)

New commits:
commit 55519a4b244e4822774b593e36647ecf7598286b
Merge: 9c269f6 f85e345
Author: Peter Maydell <peter.maydell at linaro.org>
Date:   Mon Apr 7 17:57:23 2014 +0100

    Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-2.0' into staging
    
    QOM/QTest infrastructure fixes
    
    * Relicensing of FWPathProvider interface
    * Clean up all targets' qtests
    
    # gpg: Signature made Mon 07 Apr 2014 17:56:13 BST using RSA key ID 3E7E013F
    # gpg: Good signature from "Andreas Färber <afaerber at suse.de>"
    # gpg:                 aka "Andreas Färber <afaerber at suse.com>"
    
    * remotes/afaerber/tags/qom-devices-for-2.0:
      tests: Update check-clean rule
      fw-path-provider: Change GPL version to 2+
    
    Signed-off-by: Peter Maydell <peter.maydell at linaro.org>

commit f85e3457cea170b5a0c48e9aa67d316f9e3cbcba
Author: Andreas Färber <afaerber at suse.de>
Date:   Mon Apr 7 18:33:22 2014 +0200

    tests: Update check-clean rule
    
    Only i386, x86_64, sparc and sparc64 qtests were cleaned up.
    Make this more generic to not miss any newly tested targets.
    
    Reported-by: Alexey Kardashevskiy <aik at ozlabs.ru>
    Suggested-by: Peter Maydell <peter.maydell at linaro.org>
    Signed-off-by: Andreas Färber <afaerber at suse.de>

diff --git a/tests/Makefile b/tests/Makefile
index 6086f68..88f7105 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -394,7 +394,8 @@ check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
 check-clean:
 	$(MAKE) -C tests/tcg clean
-	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
+	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
+	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)))
 
 clean: check-clean
 
commit 9c269f6d7bfb81cbbf501576b979831478dac5d9
Author: Michael Tokarev <mjt at tls.msk.ru>
Date:   Sat Apr 5 18:25:46 2014 +0400

    Makefile: remove bashism
    
    When installing modules (when --enable-modules is specified for
    ./configure), Makefile uses the following construct to replace all
    slashes with dashes in module name:
    
     ${s//\//-}
    
    This is a bash-specific substitution mechanism.  POSIX does not
    have it, and some operating systems (for example Debian) does not
    implement this construct in default shell (for example dash).
    
    Use more traditional way to perform the substitution: use `tr' tool.
    
    Signed-off-by: Michael Tokarev <mjt at tls.msk.ru>
    Message-id: 1396707946-21351-1-git-send-email-mjt at msgid.tls.msk.ru
    Signed-off-by: Peter Maydell <peter.maydell at linaro.org>

diff --git a/Makefile b/Makefile
index ec74039..d622799 100644
--- a/Makefile
+++ b/Makefile
@@ -376,7 +376,7 @@ endif
 ifneq ($(CONFIG_MODULES),)
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
 	for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
-		$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$${s//\//-}"; \
+		$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
 	done
 endif
 ifneq ($(HELPERS-y),)
commit dffacd4654ec8bf2898aed230852154c6ed755ed
Author: Don Slutz <dslutz at verizon.com>
Date:   Tue Mar 18 12:29:34 2014 -0400

    char/serial: Fix emptyness handling
    
    The commit 88c1ee73d3231c74ff90bcfc084a7589670ec244
    char/serial: Fix emptyness check
    
    Still causes extra NULL byte(s) to be sent.
    
    So if the fifo is empty, do not send an extra NULL byte.
    
    Reviewed-by: Peter Crosthwaite <peter.crosthwaite at xilinx.com>
    Signed-off-by: Don Slutz <dslutz at verizon.com>
    Message-id: 1395160174-16006-1-git-send-email-dslutz at verizon.com
    Signed-off-by: Peter Maydell <peter.maydell at linaro.org>

diff --git a/hw/char/serial.c b/hw/char/serial.c
index 6d3b5af..f4d167f 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -225,8 +225,10 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
 
     if (s->tsr_retry <= 0) {
         if (s->fcr & UART_FCR_FE) {
-            s->tsr = fifo8_is_empty(&s->xmit_fifo) ?
-                        0 : fifo8_pop(&s->xmit_fifo);
+            if (fifo8_is_empty(&s->xmit_fifo)) {
+                return FALSE;
+            }
+            s->tsr = fifo8_pop(&s->xmit_fifo);
             if (!s->xmit_fifo.num) {
                 s->lsr |= UART_LSR_THRE;
             }
commit 20c50a955fdf02b02f8c75533f456e3fbdf13de1
Author: Alexey Kardashevskiy <aik at ozlabs.ru>
Date:   Thu Mar 27 01:13:02 2014 +1100

    fw-path-provider: Change GPL version to 2+
    
    Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
    Acked-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Andreas Färber <afaerber at suse.de>

diff --git a/hw/core/fw-path-provider.c b/hw/core/fw-path-provider.c
index b117157..1290c3e 100644
--- a/hw/core/fw-path-provider.c
+++ b/hw/core/fw-path-provider.c
@@ -3,7 +3,8 @@
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; under version 2 of the License.
+ *  the Free Software Foundation; either version 2 of the License,
+ *  or (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/include/hw/fw-path-provider.h b/include/hw/fw-path-provider.h
index 3018349..7afaec0 100644
--- a/include/hw/fw-path-provider.h
+++ b/include/hw/fw-path-provider.h
@@ -3,7 +3,8 @@
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; under version 2 of the License.
+ *  the Free Software Foundation; either version 2 of the License,
+ *  or (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
commit bd7ce902ab2b5e4f5cd53e1e032d89789b6932a8
Merge: e20c016 dc491cf
Author: Peter Maydell <peter.maydell at linaro.org>
Date:   Mon Apr 7 12:48:34 2014 +0100

    Merge remote-tracking branch 'remotes/spice/tags/pull-spice-6' into staging
    
    spice: monitors_config: check pointer before dereferencing
    
    # gpg: Signature made Mon 07 Apr 2014 11:19:19 BST using RSA key ID D3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel at redhat.com>"
    # gpg:                 aka "Gerd Hoffmann <gerd at kraxel.org>"
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel at gmail.com>"
    
    * remotes/spice/tags/pull-spice-6:
      spice: monitors_config: check pointer before dereferencing
    
    Signed-off-by: Peter Maydell <peter.maydell at linaro.org>

commit e20c016e322e0c977ab332322c3a882c119eb1d4
Merge: 466e6e9 25eccc3
Author: Peter Maydell <peter.maydell at linaro.org>
Date:   Mon Apr 7 12:27:10 2014 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-4' into staging
    
    gtk: pointer fixes from Takashi Iwai.
    
    # gpg: Signature made Mon 07 Apr 2014 09:51:52 BST using RSA key ID D3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel at redhat.com>"
    # gpg:                 aka "Gerd Hoffmann <gerd at kraxel.org>"
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel at gmail.com>"
    
    * remotes/kraxel/tags/pull-gtk-4:
      ui: Update MAINTAINERS entry.
      gtk: Remember the last grabbed pointer position
      gtk: Fix the relative pointer tracking mode
      gtk: Use gtk generic event signal instead of motion-notify-event
    
    Signed-off-by: Peter Maydell <peter.maydell at linaro.org>

commit dc491cfc14074064ed54a872b62cce6ca1330644
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Apr 7 12:15:44 2014 +0200

    spice: monitors_config: check pointer before dereferencing
    
    Reported-by: Fabio Fantoni <fabio.fantoni at m2r.biz>
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>

diff --git a/ui/spice-display.c b/ui/spice-display.c
index e28698c..ce6b220 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -549,6 +549,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
     QemuUIInfo info;
     int rc;
 
+    if (!mc) {
+        return 1;
+    }
+
     /*
      * FIXME: multihead is tricky due to the way
      * spice has multihead implemented.
commit 25eccc37ff91254efdd123f5dafb37526a83a990
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Apr 7 10:42:03 2014 +0200

    ui: Update MAINTAINERS entry.
    
    With Amazon eating Anthonys time status "Maintained" certainly isn't
    true any more.  Update entry accordingly.
    
    Also add myself, so scripts/get_maintainer.pl will Cc: me, to reduce
    the chance ui patches fall through the cracks on our pretty loaded
    qemu-devel mailing list.
    
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>

diff --git a/MAINTAINERS b/MAINTAINERS
index 34b8c3f..c66946f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -717,7 +717,8 @@ F: hw/display/qxl*
 
 Graphics
 M: Anthony Liguori <aliguori at amazon.com>
-S: Maintained
+M: Gerd Hoffmann <kraxel at redhat.com>
+S: Odd Fixes
 F: ui/
 
 Cocoa graphics
commit ecce1929bcb0d8f4efde39df5ceb1aac42df75d4
Author: Takashi Iwai <tiwai at suse.de>
Date:   Fri Apr 4 12:41:23 2014 +0200

    gtk: Remember the last grabbed pointer position
    
    It's pretty annoying that the pointer reappears at a random place once
    after grabbing and ungrabbing the input.  Better to restore to the
    original position where the pointer was grabbed.
    
    Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
    Tested-by: Cole Robinson <crobinso at redhat.com>
    Reviewed-by: Cole Robinson <crobinso at redhat.com>
    Tested-by: Michael S. Tsirkin <mst at redhat.com>
    Signed-off-by: Takashi Iwai <tiwai at suse.de>
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>

diff --git a/ui/gtk.c b/ui/gtk.c
index 913cc3f..6668bd8 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -159,6 +159,8 @@ typedef struct GtkDisplayState
     gboolean last_set;
     int last_x;
     int last_y;
+    int grab_x_root;
+    int grab_y_root;
 
     double scale_x;
     double scale_y;
@@ -971,8 +973,8 @@ static void gd_ungrab_keyboard(GtkDisplayState *s)
 
 static void gd_grab_pointer(GtkDisplayState *s)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
+#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
     GList *devices = gdk_device_manager_list_devices(mgr,
                                                      GDK_DEVICE_TYPE_MASTER);
@@ -996,6 +998,8 @@ static void gd_grab_pointer(GtkDisplayState *s)
         tmp = tmp->next;
     }
     g_list_free(devices);
+    gdk_device_get_position(gdk_device_manager_get_client_pointer(mgr),
+                            NULL, &s->grab_x_root, &s->grab_y_root);
 #else
     gdk_pointer_grab(gtk_widget_get_window(s->drawing_area),
                      FALSE, /* All events to come to our window directly */
@@ -1007,13 +1011,15 @@ static void gd_grab_pointer(GtkDisplayState *s)
                      NULL, /* Allow cursor to move over entire desktop */
                      s->null_cursor,
                      GDK_CURRENT_TIME);
+    gdk_display_get_pointer(display, NULL,
+                            &s->grab_x_root, &s->grab_y_root, NULL);
 #endif
 }
 
 static void gd_ungrab_pointer(GtkDisplayState *s)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDisplay *display = gtk_widget_get_display(s->drawing_area);
+#if GTK_CHECK_VERSION(3, 0, 0)
     GdkDeviceManager *mgr = gdk_display_get_device_manager(display);
     GList *devices = gdk_device_manager_list_devices(mgr,
                                                      GDK_DEVICE_TYPE_MASTER);
@@ -1027,8 +1033,14 @@ static void gd_ungrab_pointer(GtkDisplayState *s)
         tmp = tmp->next;
     }
     g_list_free(devices);
+    gdk_device_warp(gdk_device_manager_get_client_pointer(mgr),
+                    gtk_widget_get_screen(s->drawing_area),
+                    s->grab_x_root, s->grab_y_root);
 #else
     gdk_pointer_ungrab(GDK_CURRENT_TIME);
+    gdk_display_warp_pointer(display,
+                             gtk_widget_get_screen(s->drawing_area),
+                             s->grab_x_root, s->grab_y_root);
 #endif
 }
 
commit e61031cdd81826c433a8bbfa3aca2bae4ffaf845
Author: Takashi Iwai <tiwai at suse.de>
Date:   Fri Apr 4 12:41:22 2014 +0200

    gtk: Fix the relative pointer tracking mode
    
    The relative pointer tracking mode was still buggy even after the
    previous fix of the motion-notify-event since the events are filtered
    out when the pointer moves outside the drawing window due to the
    boundary check for the absolute mode.
    
    This patch fixes the issue by moving the unnecessary boundary check
    into the if block of absolute mode, and keep the coordinate in the
    relative mode even if it's outside the drawing area.  But this makes
    the coordinate (last_x, last_y) possibly pointing to (-1,-1),
    introduce a new flag to indicate the last coordinate has been
    updated.
    
    Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
    Tested-by: Cole Robinson <crobinso at redhat.com>
    Reviewed-by: Cole Robinson <crobinso at redhat.com>
    Tested-by: Michael S. Tsirkin <mst at redhat.com>
    Signed-off-by: Takashi Iwai <tiwai at suse.de>
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>

diff --git a/ui/gtk.c b/ui/gtk.c
index c9f6d24..913cc3f 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -156,6 +156,7 @@ typedef struct GtkDisplayState
     DisplayChangeListener dcl;
     DisplaySurface *ds;
     int button_mask;
+    gboolean last_set;
     int last_x;
     int last_y;
 
@@ -616,25 +617,25 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     x = (motion->x - mx) / s->scale_x;
     y = (motion->y - my) / s->scale_y;
 
-    if (x < 0 || y < 0 ||
-        x >= surface_width(s->ds) ||
-        y >= surface_height(s->ds)) {
-        return TRUE;
-    }
-
     if (qemu_input_is_absolute()) {
+        if (x < 0 || y < 0 ||
+            x >= surface_width(s->ds) ||
+            y >= surface_height(s->ds)) {
+            return TRUE;
+        }
         qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_X, x,
                              surface_width(s->ds));
         qemu_input_queue_abs(s->dcl.con, INPUT_AXIS_Y, y,
                              surface_height(s->ds));
         qemu_input_event_sync();
-    } else if (s->last_x != -1 && s->last_y != -1 && gd_is_grab_active(s)) {
+    } else if (s->last_set && gd_is_grab_active(s)) {
         qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_X, x - s->last_x);
         qemu_input_queue_rel(s->dcl.con, INPUT_AXIS_Y, y - s->last_y);
         qemu_input_event_sync();
     }
     s->last_x = x;
     s->last_y = y;
+    s->last_set = TRUE;
 
     if (!qemu_input_is_absolute() && gd_is_grab_active(s)) {
         GdkScreen *screen = gtk_widget_get_screen(s->drawing_area);
@@ -669,8 +670,7 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
             GdkDisplay *display = gtk_widget_get_display(widget);
             gdk_display_warp_pointer(display, screen, x, y);
 #endif
-            s->last_x = -1;
-            s->last_y = -1;
+            s->last_set = FALSE;
             return FALSE;
         }
     }
commit 0d0e044dee0ed59628bb093a5be03528d6bde445
Author: Takashi Iwai <tiwai at suse.de>
Date:   Fri Apr 4 12:41:21 2014 +0200

    gtk: Use gtk generic event signal instead of motion-notify-event
    
    The GDK motion-notify-event isn't generated when the pointer goes out
    of the target window even if the pointer is grabbed, which essentially
    means to lose the pointer tracking in gtk-ui.
    
    Meanwhile the generic "event" signal is sent when the pointer is
    grabbed, so we can use this and pick the motion notify events manually
    there instead.
    
    Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
    Tested-by: Cole Robinson <crobinso at redhat.com>
    Reviewed-by: Cole Robinson <crobinso at redhat.com>
    Tested-by: Michael S. Tsirkin <mst at redhat.com>
    Signed-off-by: Takashi Iwai <tiwai at suse.de>
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>

diff --git a/ui/gtk.c b/ui/gtk.c
index f056e40..c9f6d24 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -765,6 +765,14 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
     return TRUE;
 }
 
+static gboolean gd_event(GtkWidget *widget, GdkEvent *event, void *opaque)
+{
+    if (event->type == GDK_MOTION_NOTIFY) {
+        return gd_motion_event(widget, &event->motion, opaque);
+    }
+    return FALSE;
+}
+
 /** Window Menu Actions **/
 
 static void gd_menu_pause(GtkMenuItem *item, void *opaque)
@@ -1267,8 +1275,8 @@ static void gd_connect_signals(GtkDisplayState *s)
     g_signal_connect(s->drawing_area, "expose-event",
                      G_CALLBACK(gd_expose_event), s);
 #endif
-    g_signal_connect(s->drawing_area, "motion-notify-event",
-                     G_CALLBACK(gd_motion_event), s);
+    g_signal_connect(s->drawing_area, "event",
+                     G_CALLBACK(gd_event), s);
     g_signal_connect(s->drawing_area, "button-press-event",
                      G_CALLBACK(gd_button_event), s);
     g_signal_connect(s->drawing_area, "button-release-event",


More information about the Spice-commits mailing list