[PATCH 2/2] Revert "Remove use of opaque from vdi_port_read_one_msg_from_device"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reverts commit 0f947b425cc2219f3c5a8705f4214c2deb607a5b.
This patch causes bug as sin->st can be NULL in some cases.
opaque is always referring to RedsState.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/reds.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 67c262a..ab35aa7 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -830,14 +830,12 @@ static void vdi_port_read_buf_free(RedVDIReadBuf *buf)
 static RedPipeItem *vdi_port_read_one_msg_from_device(SpiceCharDeviceInstance *sin,
                                                       void *opaque)
 {
-    RedsState *reds;
-    RedCharDeviceVDIPort *dev = RED_CHAR_DEVICE_VDIPORT(sin->st);
+    RedsState *reds = opaque;
+    RedCharDeviceVDIPort *dev = reds->agent_dev;
     SpiceCharDeviceInterface *sif;
     RedVDIReadBuf *dispatch_buf;
     int n;
 
-    g_object_get(dev, "spice-server", &reds, NULL);
-    g_assert(RED_CHAR_DEVICE(reds->agent_dev) == sin->st);
     if (!reds->vdagent) {
         return NULL;
     }
-- 
2.5.5

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]