Mira found out that 41 phys-bits the limit is pretty much the same as
with 40, as such odd sizes are a bit unexpected anyway lets mask the
LSB and use that as base, that way we're good again.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
}
}
- # remove 20 bits to get MB and half that as QEMU needs some overhead
- my $bits_to_max_mem = int(1 << ($bits - 21));
+ $bits = $bits & ~1; # round down to nearest even as limit is lower with odd bit sizes
+
+ # heuristic: remove 20 bits to get MB and half that as QEMU needs some overhead
+ my $bits_to_max_mem = int(1<<($bits - 21));
return $bits_to_max_mem > 4*1024*1024 ? 4*1024*1024 : $bits_to_max_mem;
}