Il 22/11/2013 06:24, Fam Zheng ha scritto:
> +void bdrv_op_block(BlockDriverState *bs, BlockOpType op, Error *reason)
> +{
> +    BdrvOpBlocker *blocker;
> +    assert(op >=0 && op < BLOCK_OP_TYPE_MAX);
> +
> +    blocker = g_malloc0(sizeof(BdrvOpBlocker));
> +    blocker->reason = reason;
> +    QLIST_INSERT_HEAD(&bs->op_blockers[op], blocker, list);
> +}
> +
> +void bdrv_op_unblock(BlockDriverState *bs, BlockOpType op, Error *reason)

What about making BlockOpType a bitmask, and having bdrv_op_{,un}block
take multiple ORed BlockOpTypes?

bdrv_op_{,un}block_all then are not necessary, you only need a
BLOCK_OPERATION_ALL value.

Paolo

Reply via email to