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

Alon Levy alon at kemper.freedesktop.org
Tue Mar 8 11:50:21 PST 2011

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

New commits:
commit 5315888a706e9eea30046139cb1054ae63e1cc0e
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 7845ebe..508c8ff 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1095,16 +1095,17 @@ static void reds_agent_remove()
     SpiceCharDeviceInstance *sin = vdagent;
     SpiceCharDeviceInterface *sif;
+    if (!reds->agent_state.connected) {
+        return;
+    }
+    reds->agent_state.connected = 0;
     vdagent = NULL;
     if (!reds->peer || !sin) {
-    ASSERT(reds->agent_state.connected)
     sif = SPICE_CONTAINEROF(sin->base.sif, SpiceCharDeviceInterface, base);
-    reds->agent_state.connected = 0;
     if (sif->state) {
         sif->state(sin, reds->agent_state.connected);
@@ -1112,7 +1113,6 @@ static void reds_agent_remove()
     if (reds->mig_target) {
commit e1ec222e8bdf4b02f511666656ce1d6bd60d0988
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 ea88dc5..9257eb2 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