qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 1/2] snapshot: create helper to test that bl


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH RFC 1/2] snapshot: create helper to test that block drivers supports snapshots
Date: Wed, 4 Nov 2015 13:50:59 +0000
User-agent: Mutt/1.5.23 (2015-06-09)

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

[Prev in Thread] Current Thread [Next in Thread]