static void vnc_display_close(VncDisplay *vs)

{

    if (!vs)

        return;

    g_free(vs->display);

    vs->display = NULL;

    if (vs->lsock != -1) {

        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);

        close(vs->lsock);

        vs->lsock = -1;

    }

#ifdef CONFIG_VNC_WS

    g_free(vs->ws_display);

    vs->ws_display = NULL;

    if (vs->lwebsock != -1) {

        qemu_set_fd_handler2(vs->lwebsock, NULL, NULL, NULL, NULL);

        close(vs->lwebsock);

        vs->lwebsock = -1;

    }

#endif /* CONFIG_VNC_WS */

    vs->auth = VNC_AUTH_INVALID;

#ifdef CONFIG_VNC_TLS

    vs->subauth = VNC_AUTH_INVALID;

    vs->tls.x509verify = 0;

#endif

}

static void vnc_display_close(VncDisplay *vs)

{

    if (!vs)

        return;

    g_free(vs->display);

    vs->display = NULL;

    if (vs->lsock != -1) {

        qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);

        close(vs->lsock);

        vs->lsock = -1;

    }

#ifdef CONFIG_VNC_WS

    g_free(vs->ws_display);

    vs->ws_display = NULL;

    if (vs->lwebsock != -1) {

        qemu_set_fd_handler2(vs->lwebsock, NULL, NULL, NULL, NULL);

        close(vs->lwebsock);

        vs->lwebsock = -1;

    }

#endif 

    vs->auth = VNC_AUTH_INVALID;

#ifdef CONFIG_VNC_TLS

    vs->subauth = VNC_AUTH_INVALID;

    vs->tls.x509verify = 0;

#endif

}

static void FUNC_0(VncDisplay *VAR_0)

{

    if (!VAR_0)

        return;

    g_free(VAR_0->display);

    VAR_0->display = NULL;

    if (VAR_0->lsock != -1) {

        qemu_set_fd_handler2(VAR_0->lsock, NULL, NULL, NULL, NULL);

        close(VAR_0->lsock);

        VAR_0->lsock = -1;

    }

#ifdef CONFIG_VNC_WS

    g_free(VAR_0->ws_display);

    VAR_0->ws_display = NULL;

    if (VAR_0->lwebsock != -1) {

        qemu_set_fd_handler2(VAR_0->lwebsock, NULL, NULL, NULL, NULL);

        close(VAR_0->lwebsock);

        VAR_0->lwebsock = -1;

    }

#endif 

    VAR_0->auth = VNC_AUTH_INVALID;

#ifdef CONFIG_VNC_TLS

    VAR_0->subauth = VNC_AUTH_INVALID;

    VAR_0->tls.x509verify = 0;

#endif

}

static void FUNC_0(VncDisplay *VAR_0)
{ if (!VAR_0)
return; g_free(VAR_0->display); VAR_0->display = NULL; if (VAR_0->lsock != -1) { qemu_set_fd_handler2(VAR_0->lsock, NULL, NULL, NULL, NULL); close(VAR_0->lsock); VAR_0->lsock = -1; } #ifdef CONFIG_VNC_WS
g_free(VAR_0->ws_display); VAR_0->ws_display = NULL; if (VAR_0->lwebsock != -1) { qemu_set_fd_handler2(VAR_0->lwebsock, NULL, NULL, NULL, NULL); close(VAR_0->lwebsock); VAR_0->lwebsock = -1; } #endif
VAR_0->auth = VNC_AUTH_INVALID; #ifdef CONFIG_VNC_TLS
VAR_0->subauth = VNC_AUTH_INVALID; VAR_0->tls.x509verify = 0; #endif
}