> >> bool ram_block_discard_is_disabled(void)
> >> {
> >> -return qatomic_read(&ram_block_discard_disabled) > 0;
> >> +return qatomic_read(&ram_block_discard_disablers);
> >> }
> > return value won't be bool?
>
> The compiler does type conversion.
>
> != 0 -> true
> == 0 -> false
ah... I
>> bool ram_block_discard_is_disabled(void)
>> {
>> -return qatomic_read(&ram_block_discard_disabled) > 0;
>> +return qatomic_read(&ram_block_discard_disablers);
>> }
> return value won't be bool?
The compiler does type conversion.
!= 0 -> true
== 0 -> false
[...]
> Apart from query
> We have users in migration context that don't hold the BQL (when
> finishing migration). To prepare for further changes, use a dedicated mutex
> instead of atomic operations. Keep using qatomic_read ("READ_ONCE") for the
> functions that only extract the current state (e.g., used by
> virtio-ball
We have users in migration context that don't hold the BQL (when
finishing migration). To prepare for further changes, use a dedicated mutex
instead of atomic operations. Keep using qatomic_read ("READ_ONCE") for the
functions that only extract the current state (e.g., used by
virtio-balloon), lock