qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for-2.11] block: Make bdrv_next() keep strong


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 for-2.11] block: Make bdrv_next() keep strong references
Date: Sat, 11 Nov 2017 01:08:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 10/11/2017 18:25, Max Reitz wrote:
>          if (bs) {
> +            bdrv_ref(bs);
> +            bdrv_unref(old_bs);
>              return bs;
>          }

Maybe instead goto...

>          it->phase = BDRV_NEXT_MONITOR_OWNED;
> +    } else {
> +        old_bs = it->bs;
>      }
>  
>      /* Then return the monitor-owned BDSes without a BB attached. Ignore all
> @@ -467,18 +483,46 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it)
>          bs = it->bs;
>      } while (bs && bdrv_has_blk(bs));

... here?

Paolo

> +    if (bs) {
> +        bdrv_ref(bs);
> +    }
> +    bdrv_unref(old_bs);
> +
>      return bs;




reply via email to

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