On Thu 20 Feb 2020 05:27:28 PM CET, Max Reitz wrote:
>> +static inline uint64_t get_l2_bitmap(BDRVQcow2State *s, uint64_t *l2_slice,
>> +                                     int idx)
>> +{
>> +    if (has_subclusters(s)) {
>> +        idx *= l2_entry_size(s) / sizeof(uint64_t);
>> +        return be64_to_cpu(l2_slice[idx + 1]);
>> +    } else {
>> +        /* For convenience only; the caller should ignore this value. */
>> +        return 0;
>
> Is there a reason you decided not to return the first subcluster as
> allocated?  (As you had proposed in v2)

Yeah, I thought that it would not make much sense to return a meaningful
value after a comment saying that the caller should ignore it.

If there was a situation in which something depends on that value then
it would be a bug in QEMU.

Berto

Reply via email to