static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,

                      int nb_sectors, bool is_write, BdrvRequestFlags flags)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base = (void *)buf,

        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,

    };



    if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    return bdrv_prwv_co(bs, sector_num << BDRV_SECTOR_BITS,

                        &qiov, is_write, flags);

}

static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,

                      int nb_sectors, bool is_write, BdrvRequestFlags flags)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base = (void *)buf,

        .iov_len = nb_sectors * BDRV_SECTOR_SIZE,

    };



    if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    return bdrv_prwv_co(bs, sector_num << BDRV_SECTOR_BITS,

                        &qiov, is_write, flags);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1, uint8_t *VAR_2,

                      int VAR_3, bool VAR_4, BdrvRequestFlags VAR_5)

{

    QEMUIOVector qiov;

    struct iovec VAR_6 = {

        .iov_base = (void *)VAR_2,

        .iov_len = VAR_3 * BDRV_SECTOR_SIZE,

    };



    if (VAR_3 < 0 || VAR_3 > BDRV_REQUEST_MAX_SECTORS) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &VAR_6, 1);

    return bdrv_prwv_co(VAR_0, VAR_1 << BDRV_SECTOR_BITS,

                        &qiov, VAR_4, VAR_5);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1, uint8_t *VAR_2,
int VAR_3, bool VAR_4, BdrvRequestFlags VAR_5)
{ QEMUIOVector qiov; struct iovec VAR_6 = { .iov_base = (void *)VAR_2,
.iov_len = VAR_3 * BDRV_SECTOR_SIZE,
}; if (VAR_3 < 0 || VAR_3 > BDRV_REQUEST_MAX_SECTORS) { return -EINVAL; } qemu_iovec_init_external(&qiov, &VAR_6, 1); return bdrv_prwv_co(VAR_0, VAR_1 << BDRV_SECTOR_BITS,
&qiov, VAR_4, VAR_5); }