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@xxxxxxxxxx> --- server/reds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/reds.c b/server/reds.c index 54f412f..ea3be81 100644 --- a/server/reds.c +++ b/server/reds.c @@ -781,7 +781,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; @@ -4432,7 +4432,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, -- 2.9.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel