[Top][All Lists]

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

Re: [Qemu-block] [PATCH for-4.0 1/3] block: continue until base is found

From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH for-4.0 1/3] block: continue until base is found in bdrv_freeze_backing_chain() et al
Date: Thu, 28 Mar 2019 11:04:31 +0100
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Thu 28 Mar 2019 10:45:51 AM CET, Vladimir Sementsov-Ogievskiy wrote:
>> -    for (i = bs; i != base && i->backing; i = backing_bs(i)) {
>> -        if (i->backing->frozen) {
>> +    for (i = bs; i != base; i = backing_bs(i)) {
>> +        if (i->backing && i->backing->frozen) {
> may be a bit more plain conversion would be just add assert(i == base)
> after each loop, but I'm OK with this too.

It's not necessary, because the loop can only stop when i == base
already, so that assertion is always going to be true.

If you mean that we should keep everything as it was before and simply
add that assertion then that's not enough. If base == NULL then the loop
will stop when i->backing == NULL, not when i == base.


reply via email to

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