[Spice-commits] 4 commits - client/x11 common/backtrace.h server/red_worker.c server/tests

Christophe Fergau teuf at kemper.freedesktop.org
Sun Sep 4 22:44:55 PDT 2011


 client/x11/platform.cpp          |    8 +++++++-
 common/backtrace.h               |    6 ++++++
 server/red_worker.c              |    2 ++
 server/tests/test_display_base.c |    2 +-
 4 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 7e1c773325c6f18af7b135dc2ee2b799801c2f57
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Aug 10 12:11:43 2011 +0200

    fix bug #692833

diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index f3fb444..670912c 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -84,7 +84,7 @@ static GLXFBConfig **fb_config = NULL;
 static XIM x_input_method = NULL;
 static XIC x_input_context = NULL;
 
-static Window platform_win;
+static Window platform_win = 0;
 static XContext win_proc_context;
 static ProcessLoop* main_loop = NULL;
 static int focus_count = 0;
@@ -925,6 +925,9 @@ DynamicScreen::DynamicScreen(Display* display, int screen, int& next_mon_id)
     , _saved_height (get_height())
     , _out_of_sync (false)
 {
+    if (platform_win != 0)
+        return;
+
     X_DEBUG_SYNC(display);
     //FIXME: replace RootWindow() in other refs as well?
     XLockDisplay(display);
@@ -1229,6 +1232,9 @@ MultyMonScreen::MultyMonScreen(Display* display, int screen, int& next_mon_id)
         throw;
     }
 
+    if (platform_win != 0)
+        return;
+
     XLockDisplay(display);
     platform_win = XCreateSimpleWindow(display, RootWindow(display, screen), 0, 0, 1, 1, 0, 0, 0);
     XUnlockDisplay(display);
commit 6a718d9b0da0bbd0d90beefcd661039a474a4719
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Aug 8 11:24:03 2011 +0200

    add C++ guards to backtrace.h
    
    Without these, spice_backtrace() can't be used from the C++ client
    code.

diff --git a/common/backtrace.h b/common/backtrace.h
index 21b6b67..8fcbb78 100644
--- a/common/backtrace.h
+++ b/common/backtrace.h
@@ -19,10 +19,16 @@
 #ifndef BACKTRACE_H
 #define BACKTRACE_H
 
+#include <spice/macros.h>
+
+SPICE_BEGIN_DECLS
+
 #ifdef WIN32
 #define spice_backtrace()
 #else
 void spice_backtrace(void);
 #endif
 
+SPICE_END_DECLS
+
 #endif // BACKTRACE_H
commit 41174221fbafb10abfe87f4e0120be7d9666fa4b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Aug 2 12:28:59 2011 +0200

    server: init all fields on SpiceMsgDisplayStreamCreate
    
    red_display_marshall_stream_start initializes a
    SpiceMsgDisplayStreamCreate structure before marshalling it and
    sending it on the wire. However, it never fills
    SpiceMsgDisplayStreamCreate::stamp which then causes a complaint
    from valgrind. This patch sets this value to 0, it's not used
    by the client so the value shouldn't matter.

diff --git a/server/red_worker.c b/server/red_worker.c
index 43d0bae..d86da69 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -8255,6 +8255,8 @@ static void red_display_marshall_stream_start(RedChannelClient *rcc,
         stream_create.clip.rects = &clip_rects;
     }
 
+    stream_create.stamp = 0;
+
     spice_marshall_msg_display_stream_create(base_marshaller, &stream_create);
 }
 
commit a26f5714e4f68c2010333162baf6de459f812f1c
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Aug 2 12:20:41 2011 +0200

    fix valgrind warning in test_display__stream
    
    create_test_primary_surface::test_display_base.c creates a
    QXLDevSurfaceCreate structure and initialize it, but doesn't set
    the position field. Moreover, this structure has 4 bytes of padding
    to the end (as shown by pahole from dwarves), so initialize the whole
    structure to 0 before using it.

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index d69f806..a174d87 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -235,7 +235,7 @@ static uint8_t primary_surface[HEIGHT * WIDTH * 4];
 
 static void create_test_primary_surface(QXLWorker *worker)
 {
-    QXLDevSurfaceCreate surface;
+    QXLDevSurfaceCreate surface = { 0, };
 
     surface.format     = SPICE_SURFACE_FMT_32_xRGB;
     surface.width      = WIDTH;


More information about the Spice-commits mailing list