[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 44/45] block: New change_media_cb() parameter
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 44/45] block: New change_media_cb() parameter load |
Date: |
Fri, 02 Sep 2011 15:26:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
Am 03.08.2011 15:08, schrieb Markus Armbruster:
> To let device models distinguish between eject and load.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> block.c | 12 ++++++------
> block.h | 3 ++-
> hw/fdc.c | 2 +-
> hw/ide/core.c | 2 +-
> hw/scsi-disk.c | 2 +-
> hw/sd.c | 2 +-
> 6 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/block.c b/block.c
> index b0e54ef..1bd67dd 100644
> --- a/block.c
> +++ b/block.c
> @@ -44,7 +44,7 @@
> #include <windows.h>
> #endif
>
> -static void bdrv_dev_change_media_cb(BlockDriverState *bs);
> +static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load);
> static BlockDriverAIOCB *bdrv_aio_readv_em(BlockDriverState *bs,
> int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
> BlockDriverCompletionFunc *cb, void *opaque);
> @@ -661,7 +661,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
> int flags,
> }
>
> if (!bdrv_key_required(bs)) {
> - bdrv_dev_change_media_cb(bs);
> + bdrv_dev_change_media_cb(bs, true);
> }
>
> return 0;
> @@ -697,7 +697,7 @@ void bdrv_close(BlockDriverState *bs)
> bdrv_close(bs->file);
> }
>
> - bdrv_dev_change_media_cb(bs);
> + bdrv_dev_change_media_cb(bs, false);
> }
> }
>
> @@ -780,10 +780,10 @@ void bdrv_set_dev_ops(BlockDriverState *bs, const
> BlockDevOps *ops,
> }
> }
>
> -static void bdrv_dev_change_media_cb(BlockDriverState *bs)
> +static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load)
> {
> if (bs->dev_ops && bs->dev_ops->change_media_cb) {
> - bs->dev_ops->change_media_cb(bs->dev_opaque);
> + bs->dev_ops->change_media_cb(bs->dev_opaque, load);
> }
> }
>
> @@ -1634,7 +1634,7 @@ int bdrv_set_key(BlockDriverState *bs, const char *key)
> } else if (!bs->valid_key) {
> bs->valid_key = 1;
> /* call the change callback now, we skipped it on open */
> - bdrv_dev_change_media_cb(bs);
> + bdrv_dev_change_media_cb(bs, 1);
s/1/true/
Kevin
- Re: [Qemu-devel] [PATCH v2 44/45] block: New change_media_cb() parameter load,
Kevin Wolf <=