[libvirt] [PATCH] libxl: round memory values to next 1MiB increment

Peter Krempa pkrempa at redhat.com
Thu Feb 22 06:53:29 UTC 2018


On Wed, Feb 21, 2018 at 19:08:41 -0700, Jim Fehlig wrote:
> libxl requires the memory sizes to be rounded to 1MiB increments.
> Attempting to start a domain that violates this requirement will
> fail with the marginally helpful error
> 
> 2018-02-22 01:55:32.921+0000: xc: panic: xc_dom_boot.c:141: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
> 2018-02-22 01:55:32.921+0000: libxl: libxl_dom.c:671:libxl__build_dom: xc_dom_boot_mem_init failed: No such file or directory
> 
> Round the maximum and current memory values to the next 1MiB
> increment when generating the libxl_domain_config object.
> 
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> ---
> 
> The memory values could also be adjusted in the post parse callback,
> which might be better since the virDomainDef object would then reflect
> the actual values given to libxl. In general, I often find myself

We do this in the qemu driver which has also rounding requirements and
adjust the live domain XML after it's copied when starting. Thus the
persistent definition is as provided by the user and the live XML
reflects the actual state.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180222/4c4f190e/attachment-0001.sig>


More information about the libvir-list mailing list