[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/10] block/json: Add ioctl etc.
From: |
Benoît Canet |
Subject: |
Re: [Qemu-devel] [PATCH 06/10] block/json: Add ioctl etc. |
Date: |
Wed, 5 Mar 2014 17:14:12 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
The Monday 03 Mar 2014 à 16:28:49 (+0100), Max Reitz wrote :
> Add passthrough functions for bdrv_aio_ioctl(), bdrv_is_inserted(),
> bdrv_media_changed(), bdrv_eject(), bdrv_lock_medium() and bdrv_ioctl().
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/json.c | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/block/json.c b/block/json.c
> index 7392802..ce718e8 100644
> --- a/block/json.c
> +++ b/block/json.c
> @@ -106,6 +106,14 @@ static BlockDriverAIOCB
> *json_aio_discard(BlockDriverState *bs,
> return bdrv_aio_discard(bs, sector_num, nb_sectors, cb, opaque);
> }
>
> +static BlockDriverAIOCB *json_aio_ioctl(BlockDriverState *bs,
> + unsigned long int req, void *buf,
> + BlockDriverCompletionFunc *cb,
> + void *opaque)
> +{
> + return bdrv_aio_ioctl(bs->file, req, buf, cb, opaque);
> +}
> +
> static coroutine_fn int json_co_write_zeroes(BlockDriverState *bs,
> int64_t sector_num, int
> nb_sectors,
> BdrvRequestFlags flags)
> @@ -121,6 +129,31 @@ static coroutine_fn int64_t
> json_co_get_block_status(BlockDriverState *bs,
> (sector_num << BDRV_SECTOR_BITS);
> }
>
> +static int json_is_inserted(BlockDriverState *bs)
> +{
> + return bdrv_is_inserted(bs->file);
> +}
> +
> +static int json_media_changed(BlockDriverState *bs)
> +{
> + return bdrv_media_changed(bs->file);
> +}
> +
> +static void json_eject(BlockDriverState *bs, bool eject_flag)
> +{
> + bdrv_eject(bs->file, eject_flag);
> +}
> +
> +static void json_lock_medium(BlockDriverState *bs, bool locked)
> +{
> + bdrv_lock_medium(bs->file, locked);
> +}
> +
> +static int json_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
> +{
> + return bdrv_ioctl(bs->file, req, buf);
> +}
> +
> static void json_invalidate_cache(BlockDriverState *bs)
> {
> return bdrv_invalidate_cache(bs->file);
> @@ -165,10 +198,17 @@ static BlockDriver bdrv_json = {
> .bdrv_aio_writev = json_aio_writev,
> .bdrv_aio_flush = json_aio_flush,
> .bdrv_aio_discard = json_aio_discard,
> + .bdrv_aio_ioctl = json_aio_ioctl,
>
> .bdrv_co_write_zeroes = json_co_write_zeroes,
> .bdrv_co_get_block_status = json_co_get_block_status,
>
> + .bdrv_is_inserted = json_is_inserted,
> + .bdrv_media_changed = json_media_changed,
> + .bdrv_eject = json_eject,
> + .bdrv_lock_medium = json_lock_medium,
> + .bdrv_ioctl = json_ioctl,
> +
> .bdrv_invalidate_cache = json_invalidate_cache,
>
> .has_variable_length = true,
> --
> 1.9.0
>
>
Reviewed-by: Benoit Canet <address@hidden>
- Re: [Qemu-devel] [PATCH 09/10] block/qapi: Ignore filters on top for format name, (continued)
- [Qemu-devel] [PATCH 08/10] block/raw_bsd: Add bdrv_get_specific_info(), Max Reitz, 2014/03/03
- [Qemu-devel] [PATCH 03/10] block/json: Add functions for cache control, Max Reitz, 2014/03/03
- [Qemu-devel] [PATCH 06/10] block/json: Add ioctl etc., Max Reitz, 2014/03/03
- Re: [Qemu-devel] [PATCH 06/10] block/json: Add ioctl etc.,
Benoît Canet <=
- Re: [Qemu-devel] [PATCH 00/10] block/json: Add JSON protocol driver, Eric Blake, 2014/03/05