[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 02/14] block: Introduce op_blockers to Block
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v13 02/14] block: Introduce op_blockers to BlockDriverState |
Date: |
Mon, 17 Feb 2014 21:30:06 +0800 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
On Thu, 02/13 13:24, Benoît Canet wrote:
> The Wednesday 29 Jan 2014 à 13:07:29 (+0800), Fam Zheng wrote :
> > +bool bdrv_op_is_blocked(BlockDriverState *bs, BlockOpType op, Error **errp)
> > +{
> > + BdrvOpBlocker *blocker;
> > + assert((int) op >= 0 && op < BLOCK_OP_TYPE_MAX);
> > + if (!QLIST_EMPTY(&bs->op_blockers[op])) {
> > + blocker = QLIST_FIRST(&bs->op_blockers[op]);
> > + if (errp) {
> > + *errp = error_copy(blocker->reason);
>
> When an operation is blocked the first reason found is returned as **errp.
>
> I think that this could lead to some randomization of the error messages
> depending on the bdrv_op_block call order.
>
This is not randomization IMO.
I think for a program that could fail with more than one reasons, it fails on
and reports the first failure. This behavior is not uncommon. Being verbose
here does not show much more help, but it's still very easy to add later when
users asks for it.
Fam