int bdrv_pwrite(BlockDriverState *bs, int64_t offset,

                const void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base   = (void *) buf,

        .iov_len    = bytes,

    };



    if (bytes < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    return bdrv_pwritev(bs, offset, &qiov);

}

int bdrv_pwrite(BlockDriverState *bs, int64_t offset,

                const void *buf, int bytes)

{

    QEMUIOVector qiov;

    struct iovec iov = {

        .iov_base   = (void *) buf,

        .iov_len    = bytes,

    };



    if (bytes < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &iov, 1);

    return bdrv_pwritev(bs, offset, &qiov);

}

int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,

                const void *VAR_2, int VAR_3)

{

    QEMUIOVector qiov;

    struct iovec VAR_4 = {

        .iov_base   = (void *) VAR_2,

        .iov_len    = VAR_3,

    };



    if (VAR_3 < 0) {

        return -EINVAL;

    }



    qemu_iovec_init_external(&qiov, &VAR_4, 1);

    return bdrv_pwritev(VAR_0, VAR_1, &qiov);

}

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