On 2017-11-10 18:25, Max Reitz wrote:
> On one hand, it is a good idea for bdrv_next() to return a strong
> reference because ideally nearly every pointer should be refcounted.
> This fixes intermittent failure of iotest 194.
>
> On the other, it is absolutely necessary for bdrv_next() itself to k
On 2017-11-11 01:08, Paolo Bonzini wrote:
> 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;
>> +}
On Fri, Nov 10, 2017 at 06:25:45PM +0100, Max Reitz wrote:
> On one hand, it is a good idea for bdrv_next() to return a strong
> reference because ideally nearly every pointer should be refcounted.
> This fixes intermittent failure of iotest 194.
>
> On the other, it is absolutely necessary for bd
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;
> }
>
> /
On one hand, it is a good idea for bdrv_next() to return a strong
reference because ideally nearly every pointer should be refcounted.
This fixes intermittent failure of iotest 194.
On the other, it is absolutely necessary for bdrv_next() itself to keep
a strong reference to both the BB (in its fi