int socket_connect(SocketAddress *addr, Error **errp,

                   NonBlockingConnectHandler *callback, void *opaque)

{

    QemuOpts *opts;

    int fd;



    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (addr->kind) {

    case SOCKET_ADDRESS_KIND_INET:

        inet_addr_to_opts(opts, addr->inet);

        fd = inet_connect_opts(opts, errp, callback, opaque);

        break;



    case SOCKET_ADDRESS_KIND_UNIX:

        qemu_opt_set(opts, "path", addr->q_unix->path);

        fd = unix_connect_opts(opts, errp, callback, opaque);

        break;



    case SOCKET_ADDRESS_KIND_FD:

        fd = monitor_get_fd(cur_mon, addr->fd->str, errp);

        if (callback) {


            callback(fd, opaque);

        }

        break;



    default:

        abort();

    }

    qemu_opts_del(opts);

    return fd;

}
int socket_connect(SocketAddress *addr, Error **errp,

                   NonBlockingConnectHandler *callback, void *opaque)

{

    QemuOpts *opts;

    int fd;



    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (addr->kind) {

    case SOCKET_ADDRESS_KIND_INET:

        inet_addr_to_opts(opts, addr->inet);

        fd = inet_connect_opts(opts, errp, callback, opaque);

        break;



    case SOCKET_ADDRESS_KIND_UNIX:

        qemu_opt_set(opts, "path", addr->q_unix->path);

        fd = unix_connect_opts(opts, errp, callback, opaque);

        break;



    case SOCKET_ADDRESS_KIND_FD:

        fd = monitor_get_fd(cur_mon, addr->fd->str, errp);

        if (callback) {


            callback(fd, opaque);

        }

        break;



    default:

        abort();

    }

    qemu_opts_del(opts);

    return fd;

}
int FUNC_0(SocketAddress *VAR_0, Error **VAR_1,

                   NonBlockingConnectHandler *VAR_2, void *VAR_3)

{

    QemuOpts *opts;

    int VAR_4;



    opts = qemu_opts_create_nofail(&socket_optslist);

    switch (VAR_0->kind) {

    case SOCKET_ADDRESS_KIND_INET:

        inet_addr_to_opts(opts, VAR_0->inet);

        VAR_4 = inet_connect_opts(opts, VAR_1, VAR_2, VAR_3);

        break;



    case SOCKET_ADDRESS_KIND_UNIX:

        qemu_opt_set(opts, "path", VAR_0->q_unix->path);

        VAR_4 = unix_connect_opts(opts, VAR_1, VAR_2, VAR_3);

        break;



    case SOCKET_ADDRESS_KIND_FD:

        VAR_4 = monitor_get_fd(cur_mon, VAR_0->VAR_4->str, VAR_1);

        if (VAR_2) {


            VAR_2(VAR_4, VAR_3);

        }

        break;



    default:

        abort();

    }

    qemu_opts_del(opts);

    return VAR_4;

}
int FUNC_0(SocketAddress *VAR_0, Error **VAR_1,
NonBlockingConnectHandler *VAR_2, void *VAR_3)
{ QemuOpts *opts; int VAR_4; opts = qemu_opts_create_nofail(&socket_optslist); switch (VAR_0->kind) { case SOCKET_ADDRESS_KIND_INET:
inet_addr_to_opts(opts, VAR_0->inet); VAR_4 = inet_connect_opts(opts, VAR_1, VAR_2, VAR_3); break; case SOCKET_ADDRESS_KIND_UNIX:
qemu_opt_set(opts, "path", VAR_0->q_unix->path); VAR_4 = unix_connect_opts(opts, VAR_1, VAR_2, VAR_3); break; case SOCKET_ADDRESS_KIND_FD:
VAR_4 = monitor_get_fd(cur_mon, VAR_0->VAR_4->str, VAR_1); if (VAR_2) { VAR_2(VAR_4, VAR_3); } break; default:
abort(); } qemu_opts_del(opts); return VAR_4; }