static void qmp_chardev_open_udp(Chardev *chr,

                                 ChardevBackend *backend,

                                 bool *be_opened,

                                 Error **errp)

{

    ChardevUdp *udp = backend->u.udp.data;

    QIOChannelSocket *sioc = qio_channel_socket_new();

    char *name;

    UdpChardev *s = UDP_CHARDEV(chr);



    if (qio_channel_socket_dgram_sync(sioc,

                                      udp->local, udp->remote,

                                      errp) < 0) {

        object_unref(OBJECT(sioc));

        return;

    }



    name = g_strdup_printf("chardev-udp-%s", chr->label);

    qio_channel_set_name(QIO_CHANNEL(sioc), name);

    g_free(name);



    s->ioc = QIO_CHANNEL(sioc);

    /* be isn't opened until we get a connection */

    *be_opened = false;

}

static void qmp_chardev_open_udp(Chardev *chr,

                                 ChardevBackend *backend,

                                 bool *be_opened,

                                 Error **errp)

{

    ChardevUdp *udp = backend->u.udp.data;

    QIOChannelSocket *sioc = qio_channel_socket_new();

    char *name;

    UdpChardev *s = UDP_CHARDEV(chr);



    if (qio_channel_socket_dgram_sync(sioc,

                                      udp->local, udp->remote,

                                      errp) < 0) {

        object_unref(OBJECT(sioc));

        return;

    }



    name = g_strdup_printf("chardev-udp-%s", chr->label);

    qio_channel_set_name(QIO_CHANNEL(sioc), name);

    g_free(name);



    s->ioc = QIO_CHANNEL(sioc);

    

    *be_opened = false;

}

static void FUNC_0(Chardev *VAR_0,

                                 ChardevBackend *VAR_1,

                                 bool *VAR_2,

                                 Error **VAR_3)

{

    ChardevUdp *udp = VAR_1->u.udp.data;

    QIOChannelSocket *sioc = qio_channel_socket_new();

    char *VAR_4;

    UdpChardev *s = UDP_CHARDEV(VAR_0);



    if (qio_channel_socket_dgram_sync(sioc,

                                      udp->local, udp->remote,

                                      VAR_3) < 0) {

        object_unref(OBJECT(sioc));

        return;

    }



    VAR_4 = g_strdup_printf("chardev-udp-%s", VAR_0->label);

    qio_channel_set_name(QIO_CHANNEL(sioc), VAR_4);

    g_free(VAR_4);



    s->ioc = QIO_CHANNEL(sioc);

    

    *VAR_2 = false;

}

static void FUNC_0(Chardev *VAR_0,
ChardevBackend *VAR_1,
bool *VAR_2,
Error **VAR_3)
{ ChardevUdp *udp = VAR_1->u.udp.data; QIOChannelSocket *sioc = qio_channel_socket_new(); char *VAR_4; UdpChardev *s = UDP_CHARDEV(VAR_0); if (qio_channel_socket_dgram_sync(sioc,
udp->local, udp->remote,
VAR_3) < 0) { object_unref(OBJECT(sioc)); return; } VAR_4 = g_strdup_printf("chardev-udp-%s", VAR_0->label); qio_channel_set_name(QIO_CHANNEL(sioc), VAR_4); g_free(VAR_4); s->ioc = QIO_CHANNEL(sioc); *VAR_2 = false; }