static int nbd_co_request(BlockDriverState *bs,

                          NBDRequest *request,

                          QEMUIOVector *qiov)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    int ret;



    assert(!qiov || 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,

                                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;



    assert(!qiov || 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,

                                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;



    assert(!VAR_2 || 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,

                                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; assert(!VAR_2 || 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,
VAR_1->type == NBD_CMD_READ ? VAR_2 : NULL); }