On Wed, Nov 04, 2015 at 01:07:44PM +0100, Juan Quintela wrote:
> > +{
> > +    BlockDriverState *bs;
> > +
> > +    while ((bs = bdrv_next(bs))) {
> > +        bool ok;
> > +        AioContext *ctx = bdrv_get_aio_context(bs);
> > +
> > +        if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
> > +            continue;
> > +        }
> > +
> > +        aio_context_acquire(ctx);
> 
> I think that you should get the lock before the bdrv_is_inserted, but
> who am I to know for sure O:-)

Yes, please acquire the AioContext before bdrv_is_inserted(bs).

Reply via email to