static CharDriverState *qmp_chardev_open_socket(ChardevSocket *sock,

                                                Error **errp)

{

    SocketAddress *addr = sock->addr;

    bool do_nodelay     = sock->has_nodelay ? sock->nodelay : false;

    bool is_listen      = sock->has_server  ? sock->server  : true;

    bool is_telnet      = sock->has_telnet  ? sock->telnet  : false;

    bool is_waitconnect = sock->has_wait    ? sock->wait    : false;

    int fd;



    if (is_listen) {

        fd = socket_listen(addr, errp);

    } else {

        fd = socket_connect(addr, errp, NULL, NULL);

    }

    if (error_is_set(errp)) {

        return NULL;

    }

    return qemu_chr_open_socket_fd(fd, do_nodelay, is_listen,

                                   is_telnet, is_waitconnect, errp);

}

static CharDriverState *qmp_chardev_open_socket(ChardevSocket *sock,

                                                Error **errp)

{

    SocketAddress *addr = sock->addr;

    bool do_nodelay     = sock->has_nodelay ? sock->nodelay : false;

    bool is_listen      = sock->has_server  ? sock->server  : true;

    bool is_telnet      = sock->has_telnet  ? sock->telnet  : false;

    bool is_waitconnect = sock->has_wait    ? sock->wait    : false;

    int fd;



    if (is_listen) {

        fd = socket_listen(addr, errp);

    } else {

        fd = socket_connect(addr, errp, NULL, NULL);

    }

    if (error_is_set(errp)) {

        return NULL;

    }

    return qemu_chr_open_socket_fd(fd, do_nodelay, is_listen,

                                   is_telnet, is_waitconnect, errp);

}

    if (error_is_set(errp)) {     if (error_is_set(errp)) {     if (error_is_set(errp)) {     if (error_is_set(errp)) {     if (error_is_set(errp)) {
static CharDriverState *FUNC_0(ChardevSocket *sock,

                                                Error **errp)

{

    SocketAddress *addr = sock->addr;

    bool do_nodelay     = sock->has_nodelay ? sock->nodelay : false;

    bool is_listen      = sock->has_server  ? sock->server  : true;

    bool is_telnet      = sock->has_telnet  ? sock->telnet  : false;

    bool is_waitconnect = sock->has_wait    ? sock->wait    : false;

    int VAR_0;



    if (is_listen) {

        VAR_0 = socket_listen(addr, errp);

    } else {

        VAR_0 = socket_connect(addr, errp, NULL, NULL);

    }

    if (error_is_set(errp)) {

        return NULL;

    }

    return qemu_chr_open_socket_fd(VAR_0, do_nodelay, is_listen,

                                   is_telnet, is_waitconnect, errp);

}

static CharDriverState *FUNC_0(ChardevSocket *sock,
Error **errp)
{ SocketAddress *addr = sock->addr; bool do_nodelay     = sock->has_nodelay ? sock->nodelay : false; bool is_listen      = sock->has_server  ? sock->server  : true; bool is_telnet      = sock->has_telnet  ? sock->telnet  : false; bool is_waitconnect = sock->has_wait    ? sock->wait    : false; int VAR_0; if (is_listen) { VAR_0 = socket_listen(addr, errp); } else { VAR_0 = socket_connect(addr, errp, NULL, NULL); } if (error_is_set(errp)) { return NULL; } return qemu_chr_open_socket_fd(VAR_0, do_nodelay, is_listen,
is_telnet, is_waitconnect, errp); }