int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base = (void *)buf,

        .iov_len = bytes,

    };

    int ret;



    if (bytes < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    ret = bdrv_prwv_co(bs, offset, &qiov, false, 0);

    if (ret < 0) {

        return ret;

    }



    return bytes;

}

int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base = (void *)buf,

        .iov_len = bytes,

    };

    int ret;



    if (bytes < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    ret = bdrv_prwv_co(bs, offset, &qiov, false, 0);

    if (ret < 0) {

        return ret;

    }



    return bytes;

}

int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1, void *VAR_2, int VAR_3)

{

    QEMUIOVector qiov;

    struct iovec VAR_4 = {

        .iov_base = (void *)VAR_2,

        .iov_len = VAR_3,

    };

    int VAR_5;



    if (VAR_3 < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &VAR_4, 1);

    VAR_5 = bdrv_prwv_co(VAR_0, VAR_1, &qiov, false, 0);

    if (VAR_5 < 0) {

        return VAR_5;

    }



    return VAR_3;

}

int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1, void *VAR_2, int VAR_3)
{ QEMUIOVector qiov; struct iovec VAR_4 = { .iov_base = (void *)VAR_2,
.iov_len = VAR_3,
}; int VAR_5; if (VAR_3 < 0) { return -EINVAL; } qemu_iovec_init_external(&qiov, &VAR_4, 1); VAR_5 = bdrv_prwv_co(VAR_0, VAR_1, &qiov, false, 0); if (VAR_5 < 0) { return VAR_5; } return VAR_3; }