[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDri
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState |
Date: |
Fri, 22 Nov 2013 17:20:52 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Nov 22, 2013 at 01:24:49PM +0800, Fam Zheng wrote:
> +bool bdrv_op_is_blocked(BlockDriverState *bs, BlockOpType op, Error **errp)
> +{
> + BdrvOpBlocker *blocker;
> + assert(op >=0 && op < BLOCK_OP_TYPE_MAX);
> + if (!QLIST_EMPTY(&bs->op_blockers[op])) {
> + blocker = QLIST_FIRST(&bs->op_blockers[op]);
> + *errp = error_copy(blocker->reason);
> + return true;
> + }
> + return false;
> +}
It's worth following the convention that Error **errp may be NULL:
if (errp) {
*errp = error_copy(blocker->reason);
}
The bool return value might be enough for some callers who don't need
the full Error.
- [Qemu-devel] [PATCH v4 0/7] Drop in_use from BlockDriverState and enable point-in-time snapshot exporting over NBD, Fam Zheng, 2013/11/22
- [Qemu-devel] [PATCH v4 1/7] qapi: Add BlockOperationType enum, Fam Zheng, 2013/11/22
- [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Fam Zheng, 2013/11/22
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Kevin Wolf, 2013/11/25
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Kevin Wolf, 2013/11/25
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Paolo Bonzini, 2013/11/25
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Fam Zheng, 2013/11/25
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Paolo Bonzini, 2013/11/26
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Fam Zheng, 2013/11/26
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Paolo Bonzini, 2013/11/26
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Fam Zheng, 2013/11/26
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Paolo Bonzini, 2013/11/26
- Re: [Qemu-devel] [PATCH v4 2/7] block: Introduce op_blockers to BlockDriverState, Fam Zheng, 2013/11/26