[Spice-commits] 7 commits - client/application.cpp client/red_client.cpp client/red_client.h client/smartcard_channel.cpp common/backtrace.c configure.ac Makefile.am server/Makefile.am

Christophe Fergau teuf at kemper.freedesktop.org
Fri Jul 22 01:24:54 PDT 2011


 Makefile.am                  |    2 +-
 client/application.cpp       |    7 +++++--
 client/red_client.cpp        |   28 ++++++++++++++++++----------
 client/red_client.h          |    8 ++++++++
 client/smartcard_channel.cpp |    2 +-
 common/backtrace.c           |    2 +-
 configure.ac                 |    6 +++---
 server/Makefile.am           |    9 +++++----
 8 files changed, 42 insertions(+), 22 deletions(-)

New commits:
commit 29b09d1a9814150e9c8089d2112b64c4b6d34209
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 18:48:34 2011 +0200

    set version number to 0.9.0

diff --git a/configure.ac b/configure.ac
index feed8a1..486e323 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
 AC_PREREQ([2.57])
 
 m4_define([SPICE_MAJOR], 0)
-m4_define([SPICE_MINOR], 6)
-m4_define([SPICE_MICRO], 3)
+m4_define([SPICE_MINOR], 9)
+m4_define([SPICE_MICRO], 0)
 
 AC_INIT(spice, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice)
 
commit e0e8d091ffdf4abd3584c8a69985834854278138
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 18:48:28 2011 +0200

    fix make distcheck

diff --git a/client/smartcard_channel.cpp b/client/smartcard_channel.cpp
index e0e9b88..11a6be0 100644
--- a/client/smartcard_channel.cpp
+++ b/client/smartcard_channel.cpp
@@ -20,7 +20,7 @@
 
 #include <spice/enums.h>
 
-#include "client/red_client.h"
+#include "red_client.h"
 #include "mutex.h"
 
 extern "C" {
diff --git a/common/backtrace.c b/common/backtrace.c
index d606dd9..650dc1d 100644
--- a/common/backtrace.c
+++ b/common/backtrace.c
@@ -28,7 +28,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include "common/spice_common.h"
+#include "spice_common.h"
 
 #define GSTACK_PATH "/usr/bin/gstack"
 
diff --git a/server/Makefile.am b/server/Makefile.am
index d94f9fb..7af59a6 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -32,10 +32,10 @@ generated_marshallers.h: $(top_srcdir)/spice.proto
 
 lib_LTLIBRARIES = libspice-server.la
 
-libspice_server_la_LDFLAGS =			\
-	-version-number $(SPICE_LT_VERSION)	\
-	-Wl,--version-script=spice-server.syms	\
-	-no-undefined				\
+libspice_server_la_LDFLAGS =						\
+	-version-number $(SPICE_LT_VERSION)				\
+	-Wl,--version-script=$(top_srcdir)/server/spice-server.syms	\
+	-no-undefined							\
 	$(NULL)
 
 libspice_server_la_LIBADD =				\
@@ -129,6 +129,7 @@ libspice_serverinclude_HEADERS =		\
 EXTRA_DIST =					\
 	glz_encode_match_tmpl.c			\
 	glz_encode_tmpl.c			\
+	spice-server.syms			\
 	$(NULL)
 
 BUILT_SOURCES = $(spice_built_sources)
commit 4531c065bac65266a0aa5b723e83f4154e1792cb
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 18:36:35 2011 +0200

    configure.ac: fix pyparsing check
    
    2>&1 was typo'ed 2&>1 which caused an empty '1' file to be created
    when running this test.

diff --git a/configure.ac b/configure.ac
index cb0ca99..feed8a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,7 +217,7 @@ SPICE_REQUIRES+=" celt051 >= 0.5.1.1"
 
 if test ! -e client/generated_marshallers.cpp; then
 AC_MSG_CHECKING([for pyparsing python module])
-echo "import pyparsing" | python - >/dev/null 2&>1
+echo "import pyparsing" | python - >/dev/null 2>&1
 if test $? -ne 0 ; then
     AC_MSG_RESULT([not found])
     AC_MSG_ERROR([pyparsing python module is required to compile this package])
commit d89991165a7ed7b837c4605289270c198e46abe2
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 18:37:59 2011 +0200

    add SASL and smartcard to distcheck flags

diff --git a/Makefile.am b/Makefile.am
index 853ffea..f8cfe25 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,4 +12,4 @@ DISTCLEANFILES =                                \
 
 EXTRA_DIST = spice.proto spice1.proto spice_codegen.py
 
-DISTCHECK_CONFIGURE_FLAGS=--enable-opengl --enable-gui --enable-tunnel
+DISTCHECK_CONFIGURE_FLAGS=--enable-opengl --enable-gui --enable-tunnel --enable-smartcard --with-sasl
commit eb6f554094129b6a198607b2e65dfefa0c26c05b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 12:11:36 2011 +0200

    client: don't die if initial agent timeout triggers
    
    When the client connects to a spice VM, if an agent is detected,
    there will be a few messages exchanged to exchange capabilities,
    display resolutions, ... This exchange has a timeout in case
    something goes wrong. However, when it fires, the client dies.
    This commit changes this and lets the client connects to the
    guest when the timeout happens.
    rhbz #673973

diff --git a/client/red_client.cpp b/client/red_client.cpp
index 4a6d3fd..a74fd10 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -340,7 +340,9 @@ void AgentTimer::response(AbstractProcessLoop& events_loop)
 {
     Application* app = static_cast<Application*>(events_loop.get_owner());
     app->deactivate_interval_timer(this);
-    THROW_ERR(SPICEC_ERROR_CODE_AGENT_TIMEOUT, "vdagent timeout");
+
+    LOG_WARN("timeout while waiting for agent response");
+    _client->send_main_attach_channels();
 }
 
 class MainChannelLoop: public MessageHandlerImp<RedClient, SPICE_CHANNEL_MAIN> {
@@ -371,7 +373,7 @@ RedClient::RedClient(Application& application)
     , _agent_out_msg_size (0)
     , _agent_out_msg_pos (0)
     , _agent_tokens (0)
-    , _agent_timer (new AgentTimer())
+    , _agent_timer (new AgentTimer(this))
     , _agent_caps_size(0)
     , _agent_caps(NULL)
     , _migrate (*this)
diff --git a/client/red_client.h b/client/red_client.h
index 7f5b589..17391e4 100644
--- a/client/red_client.h
+++ b/client/red_client.h
@@ -114,8 +114,14 @@ public:
     }
 };
 
+class RedClient;
+
 class AgentTimer: public Timer {
+public:
     virtual void response(AbstractProcessLoop& events_loop);
+    AgentTimer(RedClient *client) : _client(client) {};
+private:
+    RedClient *_client;
 };
 
 typedef std::map< int, RedPeer::ConnectionOptions::Type> PeerConnectionOptMap;
commit fc2f7d14a27bf44866c6244c8c512fbfddbea677
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 21 17:25:22 2011 +0200

    client: only send one SPICE_MSGC_MAIN_ATTACH_CHANNELS messages
    
    492f7a9b fixed unwanted timeouts during initial client startup,
    but it also caused a bad regression when connecting to
    RHEL6+agent guests: the SPICE_MSGS_MAIN_ATTACH_CHANNELS message
    was sent multiple times, once in RedClient::handle_init, then
    once again in RedClient::on_agent_announce_capabilities (which
    can even be triggered multiple times). Sending this message multiple
    times is a big NO and causes the server to close the client connection,
    and the client to die. Add a _msg_attach_message_sent boolean to
    make sure we only send this message once.
    
    rhbz #712938

diff --git a/client/red_client.cpp b/client/red_client.cpp
index 67690e9..4a6d3fd 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -360,6 +360,7 @@ RedClient::RedClient(Application& application)
     , _auto_display_res (false)
     , _agent_reply_wait_type (VD_AGENT_END_MESSAGE)
     , _aborting (false)
+    , _msg_attach_channels_sent(false)
     , _agent_connected (false)
     , _agent_mon_config_sent (false)
     , _agent_disp_config_sent (false)
@@ -970,16 +971,12 @@ void RedClient::handle_init(RedPeer::InMessage* message)
         if (_auto_display_res) {
            send_agent_monitors_config();
         }
-        if (_auto_display_res || !_display_setting.is_empty()) {
-            _application.activate_interval_timer(*_agent_timer, AGENT_TIMEOUT);
-        } else {
-            post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
-        }
+        _application.activate_interval_timer(*_agent_timer, AGENT_TIMEOUT);
     } else {
         if (_auto_display_res || !_display_setting.is_empty()) {
             LOG_WARN("no agent running, display options have been ignored");
         }
-        post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+        send_main_attach_channels();
     }
 }
 
@@ -1026,6 +1023,15 @@ void RedClient::handle_agent_disconnected(RedPeer::InMessage* message)
     _agent_connected = false;
 }
 
+void RedClient::send_main_attach_channels(void)
+{
+    if (_msg_attach_channels_sent)
+        return;
+
+    post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+    _msg_attach_channels_sent = true;
+}
+
 void RedClient::on_agent_announce_capabilities(
     VDAgentAnnounceCapabilities* caps, uint32_t msg_size)
 {
@@ -1056,7 +1062,7 @@ void RedClient::on_agent_announce_capabilities(
         if (!_display_setting.is_empty()) {
             LOG_WARN("display options have been requested, but the agent doesn't support these options");
         }
-        post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+        send_main_attach_channels();
         _application.deactivate_interval_timer(*_agent_timer);
     }
 }
@@ -1076,7 +1082,7 @@ void RedClient::on_agent_reply(VDAgentReply* reply)
     case VD_AGENT_MONITORS_CONFIG:
     case VD_AGENT_DISPLAY_CONFIG:
         if (_agent_reply_wait_type == reply->type) {
-            post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+            send_main_attach_channels();
             _application.deactivate_interval_timer(*_agent_timer);
             _agent_reply_wait_type = VD_AGENT_END_MESSAGE;
         }
diff --git a/client/red_client.h b/client/red_client.h
index 7b04d08..7f5b589 100644
--- a/client/red_client.h
+++ b/client/red_client.h
@@ -262,6 +262,7 @@ public:
 
     void set_mm_time(uint32_t time);
     uint32_t get_mm_time();
+    void send_main_attach_channels(void);
 
 protected:
     virtual void on_connecting();
@@ -321,6 +322,7 @@ private:
     uint32_t _agent_reply_wait_type;
 
     bool _aborting;
+    bool _msg_attach_channels_sent;
 
     bool _agent_connected;
     bool _agent_mon_config_sent;
commit d81578ec0c4c5e19291fb3effa65762f5a75efc9
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Jul 19 13:48:56 2011 +0200

    client: split overlong option descriptions

diff --git a/client/application.cpp b/client/application.cpp
index d605aec..97014f8 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2282,11 +2282,14 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     parser.add(SPICE_OPT_CANVAS_TYPE, "canvas-type", "set rendering canvas", "canvas_type", true);
     parser.set_multi(SPICE_OPT_CANVAS_TYPE, ',');
 
-    parser.add(SPICE_OPT_DISPLAY_COLOR_DEPTH, "color-depth", "guest display color depth (if supported by the guest vdagent)",
+    parser.add(SPICE_OPT_DISPLAY_COLOR_DEPTH, "color-depth",
+               "guest display color depth (if supported by the guest vdagent)",
                "16/32", true);
 
     parser.add(SPICE_OPT_DISABLE_DISPLAY_EFFECTS, "disable-effects",
-               "disable guest display effects (if supported by the guest vdagent)", "wallpaper/font-smooth/animation/all", true);
+               "disable guest display effects " \
+               "(if supported by the guest vdagent)",
+               "wallpaper/font-smooth/animation/all", true);
     parser.set_multi(SPICE_OPT_DISABLE_DISPLAY_EFFECTS, ',');
 
     parser.add(SPICE_OPT_CONTROLLER, "controller", "enable external controller");


More information about the Spice-commits mailing list