static int connect_to_sdog(BDRVSheepdogState *s, Error **errp)

{

    int fd;



    fd = socket_connect(s->addr, NULL, NULL, errp);



    if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) {

        int ret = socket_set_nodelay(fd);

        if (ret < 0) {

            error_report("%s", strerror(errno));

        }

    }



    if (fd >= 0) {

        qemu_set_nonblock(fd);

    } else {

        fd = -EIO;

    }



    return fd;

}

static int connect_to_sdog(BDRVSheepdogState *s, Error **errp)

{

    int fd;



    fd = socket_connect(s->addr, NULL, NULL, errp);



    if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) {

        int ret = socket_set_nodelay(fd);

        if (ret < 0) {

            error_report("%s", strerror(errno));

        }

    }



    if (fd >= 0) {

        qemu_set_nonblock(fd);

    } else {

        fd = -EIO;

    }



    return fd;

}

static int FUNC_0(BDRVSheepdogState *VAR_0, Error **VAR_1)

{

    int VAR_2;



    VAR_2 = socket_connect(VAR_0->addr, NULL, NULL, VAR_1);



    if (VAR_0->addr->type == SOCKET_ADDRESS_KIND_INET && VAR_2 >= 0) {

        int VAR_3 = socket_set_nodelay(VAR_2);

        if (VAR_3 < 0) {

            error_report("%VAR_0", strerror(errno));

        }

    }



    if (VAR_2 >= 0) {

        qemu_set_nonblock(VAR_2);

    } else {

        VAR_2 = -EIO;

    }



    return VAR_2;

}

static int FUNC_0(BDRVSheepdogState *VAR_0, Error **VAR_1)
{ int VAR_2; VAR_2 = socket_connect(VAR_0->addr, NULL, NULL, VAR_1); if (VAR_0->addr->type == SOCKET_ADDRESS_KIND_INET && VAR_2 >= 0) { int VAR_3 = socket_set_nodelay(VAR_2); if (VAR_3 < 0) { error_report("%VAR_0", strerror(errno)); } } if (VAR_2 >= 0) { qemu_set_nonblock(VAR_2); } else { VAR_2 = -EIO; } return VAR_2; }