This revives Philippe Mathieu-Daudé's patch from 2021. The original
posting and discussion are available at:

https://lore.kernel.org/r/[email protected]

When host memory allocation fails, QEMU reports the affected memory
region and host error, but not the size of the failed allocation. This
makes accidental requests harder to spot. In particular, a bare value
passed to '-m' is interpreted as MiB, so a user expecting bytes can
unintentionally request tens of TiB.

The patch adds the human-readable RAMBlock size to the existing error.
This does not try to explain host-specific overcommit, cgroup, or NUMA
policy. It provides the most useful portable fact available at the
failure site and makes both user mistakes and support reports easier
to diagnose.

Changes in v2:
- Rebase onto current master
- Update the source path from softmmu/physmem.c to system/physmem.c
- Fix a typo in the commit message
- Collect Peter Xu's Reviewed-by and Bin Meng's Tested-by

Philippe Mathieu-Daudé (1):
  system/physmem: Improve guest memory allocation failure error message

 system/physmem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---
base-commit: eea8fe61b8be8f3016e522e6af24924a0266ca95
branch: virt

-- 
2.53.0


Reply via email to