[Spice-commits] 3 commits - server/char-device.h server/reds.c server/smartcard.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Wed Jun 1 15:25:32 UTC 2016


 server/char-device.h |    2 --
 server/reds.c        |    8 ++------
 server/smartcard.c   |    2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 795d274e2ba3c56a5da539b0dea3210fe8b69be0
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed Jun 1 13:39:52 2016 +0100

    smartcard: Avoid crash on remove_interface call
    
    SpiceCharDeviceInstance is not a GObject, the GObject is char_device->st
    as the above line is stating.
    The crash never happen as Qemu never calls spice_server_remove_interface
    for smartcards.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/smartcard.c b/server/smartcard.c
index 7a34080..872aa1d 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -274,7 +274,7 @@ void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device)
 {
     g_return_if_fail(RED_IS_CHAR_DEVICE_SMARTCARD(char_device->st));
 
-    g_object_unref(char_device);
+    g_object_unref(char_device->st);
 }
 
 RedCharDevice *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device)
commit 80f2d7731d0dd3a28d77092f2a27940881c37941
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue May 31 10:42:05 2016 +0100

    Simplify setting char device instance
    
    Setting "sin" property is equivalent to call
    red_char_device_reset_dev_instance so there is no need for a if/else
    as the code is doing mostly (beside setting agent_attached) the
    same thing
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 60e6092..f8cfdfb 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3098,12 +3098,8 @@ static RedCharDevice *attach_to_red_agent(RedsState *reds, SpiceCharDeviceInstan
     RedCharDeviceVDIPort *dev = reds->agent_dev;
     SpiceCharDeviceInterface *sif;
 
-    if (dev->priv->agent_attached) {
-        red_char_device_reset_dev_instance(RED_CHAR_DEVICE(dev), sin);
-    } else {
-        dev->priv->agent_attached = TRUE;
-        g_object_set(G_OBJECT(dev), "sin", sin, NULL);
-    }
+    dev->priv->agent_attached = TRUE;
+    red_char_device_reset_dev_instance(RED_CHAR_DEVICE(dev), sin);
 
     reds->vdagent = sin;
     reds_update_mouse_mode(reds);
commit 6fbefcc3c332f8624047a2aed6ad3e69bd071516
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue May 31 10:40:23 2016 +0100

    Remove obsolete comment
    
    AGENT_CONNECT with token count is implemented by agent_connected_tokens
    message.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/char-device.h b/server/char-device.h
index 2dd848f..1ada763 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -182,8 +182,6 @@ int red_char_device_restore(RedCharDevice *dev,
  *  instead we just reset it.
  *  In addition, there is a misshandling of AGENT_TOKENS message in spice-gtk: it
  *  overrides the amount of tokens, instead of adding the given amount.
- *
- *  todo: change AGENT_CONNECT msg to contain tokens count.
  */
 void red_char_device_reset(RedCharDevice *dev);
 


More information about the Spice-commits mailing list