vnc: add magic cookie to VncState

Set magic cookie on initialization.  Clear on cleanup.  Sprinkle a bunch
of assert()s checking the cookie, to verify the pointer is valid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180507102254.12107-1-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2018-05-07 12:22:54 +02:00
parent 4f4cb8282d
commit f31f9c1080
3 changed files with 16 additions and 1 deletions

View file

@ -255,8 +255,11 @@ typedef enum {
VNC_STATE_UPDATE_FORCE,
} VncStateUpdate;
#define VNC_MAGIC ((uint64_t)0x05b3f069b3d204bb)
struct VncState
{
uint64_t magic;
QIOChannelSocket *sioc; /* The underlying socket */
QIOChannel *ioc; /* The channel currently used for I/O */
guint ioc_tag;