We now have
if (mem_pref_32_reserve != (uint32_t)-1 &&
mem_pref_64_reserve != (uint64_t)-1) {
error_setg(errp,
but after introducing the zero value, this is going to be too strict.
Consider all the possible combinations:
* (-1; -1): default fw behavior, check is OK
* (-1; 0): fw sticks with the default for the first component, picks
"no reservation" for the second component, check is OK
* (-1; >0): fw can treat this identically to ( 0; >0) -- see below. This
is justified because, while the first component says "use
the default", the entire situation of having such a
capability is new, so the firmware can introduce new ways
for handling it. The check passes, which is good.
* ( 0; 0): check reports error, but the firmware can handle this case
fine (no reservation for either component)
* ( 0; >0): check reports error, but the fw can handle this (no
reservation for the first component, specific reservation
for the second)
* (>0; >0): conflict, check is OK
(I'm skipping the description of the inverted orderings, such as (0;-1),
they behave similarly.)
So we need to accept 0 as "valid" for either component:
if (mem_pref_32_reserve > 0 &&
mem_pref_32_reserve < (uint32_t)-1 &&
mem_pref_64_reserve > 0 &&
mem_pref_64_reserve < (uint64_t)-1) {
error_setg(errp,