Am 18.09.2012 16:27, schrieb Paolo Bonzini:
> Il 18/09/2012 13:40, Kevin Wolf ha scritto:
>> +again:
>> +    QLIST_FOREACH(m, &s->cluster_allocs, next_in_flight) {
>> +        if (m->sleeping) {
>> +            qemu_coroutine_enter(m->co, NULL);
>> +            /* next_in_flight link could have become invalid */
>> +            goto again;
>> +        }
>> +    }
>> +
>>      qemu_co_rwlock_wrlock(&s->l2meta_flush);
>>  }
>>  
>>  static inline coroutine_fn void resume_l2meta(BDRVQcowState *s)
>>  {
>> +    s->in_l2meta_flush = false;
>>      qemu_co_rwlock_unlock(&s->l2meta_flush);
>>  }
>>  
>>  static bool qcow2_drain(BlockDriverState *bs)
>>  {
>>      BDRVQcowState *s = bs->opaque;
>> +    QCowL2Meta *m;
>> +
>> +    QLIST_FOREACH(m, &s->cluster_allocs, next_in_flight) {
>> +        if (m->sleeping) {
>> +            qemu_coroutine_enter(m->co, NULL);
>> +        }
>> +    }
>>  
> 
> Why are the goto and in_l2meta_flush not needed here?  If they are,
> perhaps stop_l2meta can just use qcow2_drain?

I think you're right, thanks.

Kevin

Reply via email to