Would
int bdrv_are_busy(void)
{
BlockDriverState *bs;
QTAILQ_FOREACH(bs, &bdrv_states, list) {
if (bs->job || bdrv_in_use(bs)) {
return -EBUSY;
}
}
return 0;
}
be more acceptable ?
Benoît
Le Monday 23 Jul 2012 à 10:55:41 (+0100), Stefan Hajnoczi a écrit :
> On Fri, Jul 20, 2012 at 8:32 PM, <[email protected]> wrote:
> > From: Benoît Canet <[email protected]>
> >
> > Signed-off-by: Benoit Canet <[email protected]>
> > ---
> > migration.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/migration.c b/migration.c
> > index 8db1b43..dfce680 100644
> > --- a/migration.c
> > +++ b/migration.c
> > @@ -425,6 +425,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool
> > blk,
> > return;
> > }
> >
> > + if (bdrv_have_block_jobs()) {
> > + error_set(errp, QERR_STREAMING_BLOCKS_MIGRATION);
> > + return;
> > + }
>
> I think bdrv_have_block_jobs() is too specific and would use
> bdrv_in_use(bs) here to give basically an EBUSY-type error.
>
> Stefan