[PATCH] qemu: Don't ignore failure when building default memory backend

Ján Tomko jtomko at redhat.com
Tue Feb 22 16:21:26 UTC 2022


On a Tuesday in 2022, Michal Privoznik wrote:
>When building the default memory backend (which has id='pc.ram')
>and no guest NUMA is configured then
>qemuBuildMemCommandLineMemoryDefaultBackend() is called. However,
>its return value is ignored which means that on invalid
>configuration (e.g. when non-existent hugepage size was
>requested) an error is reported into the logs but QEMU is started
>anyway. And while QEMU does error out its error message doesn't
>give much clue what's going on:
>
>  qemu-system-x86_64: Memory backend 'pc.ram' not found
>
>While at it, introduce a test case. While I could chose a nice
>looking value (e.g. 4MiB) that's exactly what I wanted to avoid,
>because while such value might not be possible on x84_64 it may
>be possible on other arches (e.g. ppc is notoriously known for
>supporting wide range of HP sizes). Let's stick with obviously
>wrong value of 5MiB.
>
>Reported-by: Charles Polisher <chas at chasmo.org>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_command.c                       |  5 ++--
> .../hugepages-default-5M.x86_64-latest.err    |  1 +
> .../qemuxml2argvdata/hugepages-default-5M.xml | 27 +++++++++++++++++++
> tests/qemuxml2argvtest.c                      |  1 +
> 4 files changed, 32 insertions(+), 2 deletions(-)
> create mode 100644 tests/qemuxml2argvdata/hugepages-default-5M.x86_64-latest.err
> create mode 100644 tests/qemuxml2argvdata/hugepages-default-5M.xml
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220222/97741d2f/attachment-0001.sig>


More information about the libvir-list mailing list