[Spice-commits] 2 commits - client/application.cpp server/reds.c

Alon Levy alon at kemper.freedesktop.org
Tue Mar 8 11:19:07 PST 2011

 client/application.cpp |    5 ++++-
 server/reds.c          |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 61d8e54766e006418d9a3720a0256ac294ecb413
Author: Alon Levy <alevy at redhat.com>
Date:   Fri Mar 4 13:15:26 2011 +0200

    server/reds: allow call to reds_agent_remove even if it is gone
    The current assert(reds->agent_state.connected) tiggers if when
    the agent disconnected there was still data waiting to be sent (for
    instance if there is a bug in the client handling clipboard and it
    is killed while a large clipboard transfer is in progress). So first
    call to reds_agent_remove happens from spice_server_char_device_remove_interface,
    and then it is called again (triggering the assert) from free_item_data
    from read_from_vdi_port because of the channel destruction.
    Other option would be to not call it from one of the paths - but that
    is suboptimal:
     * if there is no data in the pipe, the second call never happens.
     * the second call has to be there anyway, because it may fail during
      parsing data from the agent.
    This patch fixes a segfault on this assert when a client starts passing
    from guest agent to client a large clipboard and dies in the middle. There
    is still another assert happening occasionally at marshaller which I don't
    have a fix for (but it doesn't seem to be related).

diff --git a/server/reds.c b/server/reds.c
index 750b785..c1873ef 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -699,7 +699,9 @@ static void reds_agent_remove()
     SpiceCharDeviceInstance *sin = vdagent;
     SpiceCharDeviceInterface *sif;
-    ASSERT(reds->agent_state.connected)
+    if (!reds->agent_state.connected) {
+        return;
+    }
     reds->agent_state.connected = 0;
     vdagent = NULL;
commit 1af83642c14864b5cbbf6d2d7d92b9929789302d
Author: Alon Levy <alevy at redhat.com>
Date:   Fri Mar 4 09:36:49 2011 +0200

    client/smartcard: handle the --smartcard-db option

diff --git a/client/application.cpp b/client/application.cpp
index 3333b0c..4cb5c2d 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2271,7 +2271,7 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     parser.add(SPICE_OPT_SMARTCARD_CERT, "smartcard-cert", "Use virtual reader+card with given cert(s)",
         "smartcard-cert", true);
     parser.set_multi(SPICE_OPT_SMARTCARD_CERT, ',');
-    parser.add(SPICE_OPT_SMARTCARD_DB, "smartcard-db", "Use given db for smartcard certs");
+    parser.add(SPICE_OPT_SMARTCARD_DB, "smartcard-db", "Use given db for smartcard certs", "smartcard-db", true);
     for (int i = SPICE_CHANNEL_MAIN; i < SPICE_END_CHANNEL; i++) {
@@ -2395,6 +2395,9 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
                     _smartcard_options->certs.end(), std::string(val));
             } while ((val=parser.next_argument()));
+            _smartcard_options->dbname = val;
+            break;
         case CmdLineParser::OPTION_HELP:

More information about the Spice-commits mailing list