[PATCH 13/20] Remove use of opaque from vdi_port_read_one_msg_from_device

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

 



From: Christophe Fergeau <cfergeau@xxxxxxxxxx>

We can get 'reds' from the RedCharDevice accessible from the
SpiceCharDeviceInstance passed as an argument.
---
 server/reds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 7e5626a..3c95864 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -786,12 +786,14 @@ static void vdi_port_read_buf_free(VDIReadBuf *buf)
 static PipeItem *vdi_port_read_one_msg_from_device(SpiceCharDeviceInstance *sin,
                                                    void *opaque)
 {
-    RedsState *reds = opaque;
-    RedCharDeviceVDIPort *dev = reds->agent_dev;
+    RedsState *reds;
+    RedCharDeviceVDIPort *dev = RED_CHAR_DEVICE_VDIPORT(sin->st);
     SpiceCharDeviceInterface *sif;
     VDIReadBuf *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.4.11

_______________________________________________
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]