486bcc95d1
- libxl: round memory values to next 1MiB increment ef71caea-libxl-memalign.patch bsc#1082041 OBS-URL: https://build.opensuse.org/request/show/579670 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=672
34 lines
1.5 KiB
Diff
34 lines
1.5 KiB
Diff
commit ef71caeaa81ab75daf441fe702d267c9b722bafb
|
|
Author: Jim Fehlig <jfehlig@suse.com>
|
|
Date: Wed Feb 21 18:48:38 2018 -0700
|
|
|
|
libxl: round memory values to next 1MiB increment
|
|
|
|
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@suse.com>
|
|
|
|
Index: libvirt-4.0.0/src/libxl/libxl_conf.c
|
|
===================================================================
|
|
--- libvirt-4.0.0.orig/src/libxl/libxl_conf.c
|
|
+++ libvirt-4.0.0/src/libxl/libxl_conf.c
|
|
@@ -367,6 +367,10 @@ libxlMakeDomBuildInfo(virDomainDefPtr de
|
|
}
|
|
|
|
b_info->sched_params.weight = 1000;
|
|
+ /* Xen requires the memory sizes to be rounded to 1MiB increments */
|
|
+ virDomainDefSetMemoryTotal(def,
|
|
+ VIR_ROUND_UP(virDomainDefGetMemoryInitial(def), 1024));
|
|
+ def->mem.cur_balloon = VIR_ROUND_UP(def->mem.cur_balloon, 1024);
|
|
b_info->max_memkb = virDomainDefGetMemoryInitial(def);
|
|
b_info->target_memkb = def->mem.cur_balloon;
|
|
if (hvm) {
|