qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v20 03/15] block: Replace in_use with operation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v20 03/15] block: Replace in_use with operation blocker
Date: Wed, 21 May 2014 14:46:57 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, May 20, 2014 at 02:04:28PM +0800, Fam Zheng wrote:
> This drops BlockDriverState.in_use with op_blockers:
> 
>   - Call bdrv_op_block_all in place of bdrv_set_in_use(bs, 1).
> 
>   - Call bdrv_op_unblock_all in place of bdrv_set_in_use(bs, 0).
> 
>   - Check bdrv_op_is_blocked() in place of bdrv_in_use(bs).
> 
>     The specific types are used, e.g. in place of starting block backup,
>     bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP, ...).
> 
>     There is one exception in block_job_create, where
>     bdrv_op_blocker_is_empty() is used, because we don't know the operation
>     type here. This doesn't matter because in a few commits away we will drop
>     the check and move it to callers that _do_ know the type.
> 
>   - Check bdrv_op_blocker_is_empty() in place of assert(!bs->in_use).
> 
> Note: there is only bdrv_op_block_all and bdrv_op_unblock_all callers at
> this moment. So although the checks are specific to op types, this
> changes can still be seen as identical logic with previously with
> in_use. The difference is error message are improved because of blocker
> error info.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> Reviewed-by: Jeff Cody <address@hidden>
> ---
>  block-migration.c               |  7 +++++--
>  block.c                         | 24 +++++++-----------------
>  blockdev.c                      | 19 +++++++++----------
>  blockjob.c                      | 14 +++++++++-----
>  hw/block/dataplane/virtio-blk.c | 18 ++++++++++++------
>  include/block/block.h           |  2 --
>  include/block/block_int.h       |  1 -
>  include/block/blockjob.h        |  3 +++
>  8 files changed, 45 insertions(+), 43 deletions(-)

Reviewed-by: Stefan Hajnoczi <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]