[Spice-commits] server/reds.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Jan 31 12:21:51 UTC 2017


 server/reds.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cbbc53bdf8826acc2320231b7d55d12b0f8f3ff1
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Jan 26 19:03:48 2017 +0000

    reds: Get state using red_char_device_get_server
    
    Avoid to use g_object_get if not necessary.
    red_char_device_get_server is more type safe and we are
    not bound to dynamic fields.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index fb58bd0..b052464 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -746,7 +746,7 @@ static RedPipeItem *vdi_port_read_one_msg_from_device(RedCharDevice *self,
     RedVDIReadBuf *dispatch_buf;
     int n;
 
-    g_object_get(dev, "spice-server", &reds, NULL);
+    reds = red_char_device_get_server(self);
     g_assert(RED_CHAR_DEVICE(reds->agent_dev) == sin->st);
     if (!reds->vdagent) {
         return NULL;
@@ -4397,7 +4397,7 @@ static void red_char_device_vdi_port_constructed(GObject *object)
 
     G_OBJECT_CLASS(red_char_device_vdi_port_parent_class)->constructed(object);
 
-    g_object_get(dev, "spice-server", &reds, NULL);
+    reds = red_char_device_get_server(RED_CHAR_DEVICE(object));
 
     agent_msg_filter_init(&dev->priv->write_filter, reds->config->agent_copypaste,
                           reds->config->agent_file_xfer,


More information about the Spice-commits mailing list