static int nbd_co_request(BlockDriverState *bs,

                          NBDRequest *request,

                          QEMUIOVector *qiov)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    int ret;



    if (qiov) {

        assert(request->type == NBD_CMD_WRITE || request->type == NBD_CMD_READ);

        assert(request->len == iov_size(qiov->iov, qiov->niov));

    } else {

        assert(request->type != NBD_CMD_WRITE && request->type != NBD_CMD_READ);

    }

    ret = nbd_co_send_request(bs, request,

                              request->type == NBD_CMD_WRITE ? qiov : NULL);

    if (ret < 0) {

        return ret;

    }



    return nbd_co_receive_reply(client, request->handle,

                                request->type == NBD_CMD_READ ? qiov : NULL);

}

static int nbd_co_request(BlockDriverState *bs,

                          NBDRequest *request,

                          QEMUIOVector *qiov)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    int ret;



    if (qiov) {

        assert(request->type == NBD_CMD_WRITE || request->type == NBD_CMD_READ);

        assert(request->len == iov_size(qiov->iov, qiov->niov));

    } else {

        assert(request->type != NBD_CMD_WRITE && request->type != NBD_CMD_READ);

    }

    ret = nbd_co_send_request(bs, request,

                              request->type == NBD_CMD_WRITE ? qiov : NULL);

    if (ret < 0) {

        return ret;

    }



    return nbd_co_receive_reply(client, request->handle,

                                request->type == NBD_CMD_READ ? qiov : NULL);

}

    } else { static int nbd_co_request(BlockDriverState *bs,                           NBDRequest *request,                           QEMUIOVector *qiov)     NBDClientSession *client = nbd_get_client_session(bs);     if (qiov) {         assert(request->type == NBD_CMD_WRITE || request->type == NBD_CMD_READ);         assert(request->len == iov_size(qiov->iov, qiov->niov));         assert(request->type != NBD_CMD_WRITE && request->type != NBD_CMD_READ);     ret = nbd_co_send_request(bs, request,                               request->type == NBD_CMD_WRITE ? qiov : NULL);     return nbd_co_receive_reply(client, request->handle,                                 request->type == NBD_CMD_READ ? qiov : NULL);
static int FUNC_0(BlockDriverState *VAR_0,

                          NBDRequest *VAR_1,

                          QEMUIOVector *VAR_2)

{

    NBDClientSession *client = nbd_get_client_session(VAR_0);

    int VAR_3;



    if (VAR_2) {

        assert(VAR_1->type == NBD_CMD_WRITE || VAR_1->type == NBD_CMD_READ);

        assert(VAR_1->len == iov_size(VAR_2->iov, VAR_2->niov));

    } else {

        assert(VAR_1->type != NBD_CMD_WRITE && VAR_1->type != NBD_CMD_READ);

    }

    VAR_3 = nbd_co_send_request(VAR_0, VAR_1,

                              VAR_1->type == NBD_CMD_WRITE ? VAR_2 : NULL);

    if (VAR_3 < 0) {

        return VAR_3;

    }



    return nbd_co_receive_reply(client, VAR_1->handle,

                                VAR_1->type == NBD_CMD_READ ? VAR_2 : NULL);

}

static int FUNC_0(BlockDriverState *VAR_0,
NBDRequest *VAR_1,
QEMUIOVector *VAR_2)
{ NBDClientSession *client = nbd_get_client_session(VAR_0); int VAR_3; if (VAR_2) { assert(VAR_1->type == NBD_CMD_WRITE || VAR_1->type == NBD_CMD_READ); assert(VAR_1->len == iov_size(VAR_2->iov, VAR_2->niov)); } else { assert(VAR_1->type != NBD_CMD_WRITE && VAR_1->type != NBD_CMD_READ); } VAR_3 = nbd_co_send_request(VAR_0, VAR_1,
VAR_1->type == NBD_CMD_WRITE ? VAR_2 : NULL); if (VAR_3 < 0) { return VAR_3; } return nbd_co_receive_reply(client, VAR_1->handle,
VAR_1->type == NBD_CMD_READ ? VAR_2 : NULL); }