From 486bcc95d116b0d47f4a2a1e2b47e19f85b5345e339167b48d4a0ef6242ca07f Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 23 Feb 2018 22:58:19 +0000 Subject: [PATCH] Accepting request 579670 from home:jfehlig:branches:Virtualization - 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 --- ef71caea-libxl-memalign.patch | 33 ++++++++++++++++++++++++++++++++ libvirt-suse-netcontrol.patch | 4 ++-- libvirt.changes | 7 +++++++ libvirt.spec | 2 ++ libxl-set-cach-mode.patch | 4 ++-- libxl-support-block-script.patch | 8 ++++---- lxc-wait-after-eth-del.patch | 4 ++-- 7 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 ef71caea-libxl-memalign.patch diff --git a/ef71caea-libxl-memalign.patch b/ef71caea-libxl-memalign.patch new file mode 100644 index 0000000..9706b2e --- /dev/null +++ b/ef71caea-libxl-memalign.patch @@ -0,0 +1,33 @@ +commit ef71caeaa81ab75daf441fe702d267c9b722bafb +Author: Jim Fehlig +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 + +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) { diff --git a/libvirt-suse-netcontrol.patch b/libvirt-suse-netcontrol.patch index b556834..f561593 100644 --- a/libvirt-suse-netcontrol.patch +++ b/libvirt-suse-netcontrol.patch @@ -30,7 +30,7 @@ Index: libvirt-4.0.0/src/Makefile.am =================================================================== --- libvirt-4.0.0.orig/src/Makefile.am +++ libvirt-4.0.0/src/Makefile.am -@@ -1038,6 +1038,10 @@ if WITH_NETCF +@@ -1039,6 +1039,10 @@ if WITH_NETCF INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_netcf.c endif WITH_NETCF @@ -41,7 +41,7 @@ Index: libvirt-4.0.0/src/Makefile.am if WITH_UDEV INTERFACE_DRIVER_SOURCES += \ interface/interface_backend_udev.c -@@ -1658,6 +1662,10 @@ if WITH_NETCF +@@ -1659,6 +1663,10 @@ if WITH_NETCF libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS) libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS) endif WITH_NETCF diff --git a/libvirt.changes b/libvirt.changes index 7c68beb..faa6e5c 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 23 22:09:04 UTC 2018 - jfehlig@suse.com + +- libxl: round memory values to next 1MiB increment + ef71caea-libxl-memalign.patch + bsc#1082041 + ------------------------------------------------------------------- Wed Feb 21 23:32:55 UTC 2018 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 1eb6105..fe2afe8 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -326,6 +326,7 @@ Patch5: 6b3d716e-keycodemap-py3.patch Patch6: 759b4d1b-virlog-determine-the-hostname-on-startup-CVE-2018-67.patch Patch7: c2dc6698-fix-deadlock-obtaining-hostname.patch Patch8: c391e07e-libxl-clock-settings.patch +Patch9: ef71caea-libxl-memalign.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch @@ -926,6 +927,7 @@ popd %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %patch100 -p1 %patch101 -p1 %patch150 -p1 diff --git a/libxl-set-cach-mode.patch b/libxl-set-cach-mode.patch index b415644..9355b1f 100644 --- a/libxl-set-cach-mode.patch +++ b/libxl-set-cach-mode.patch @@ -7,7 +7,7 @@ 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 -@@ -765,6 +765,30 @@ libxlDiskSetDiscard(libxl_device_disk *x +@@ -769,6 +769,30 @@ libxlDiskSetDiscard(libxl_device_disk *x #endif } @@ -38,7 +38,7 @@ Index: libvirt-4.0.0/src/libxl/libxl_conf.c static char * libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, const char *username, -@@ -1013,6 +1037,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk +@@ -1017,6 +1041,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0; if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0) return -1; diff --git a/libxl-support-block-script.patch b/libxl-support-block-script.patch index 4203453..1216939 100644 --- a/libxl-support-block-script.patch +++ b/libxl-support-block-script.patch @@ -11,7 +11,7 @@ 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 -@@ -765,6 +765,25 @@ libxlDiskSetDiscard(libxl_device_disk *x +@@ -769,6 +769,25 @@ libxlDiskSetDiscard(libxl_device_disk *x #endif } @@ -37,7 +37,7 @@ Index: libvirt-4.0.0/src/libxl/libxl_conf.c static void libxlDiskSetCacheMode(libxl_device_disk *x_disk, int cachemode) { -@@ -910,6 +929,7 @@ libxlMakeNetworkDiskSrc(virStorageSource +@@ -914,6 +933,7 @@ libxlMakeNetworkDiskSrc(virStorageSource int libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) { @@ -45,7 +45,7 @@ Index: libvirt-4.0.0/src/libxl/libxl_conf.c const char *driver = virDomainDiskGetDriver(l_disk); int format = virDomainDiskGetFormat(l_disk); int actual_type = virStorageSourceGetActualType(l_disk->src); -@@ -925,7 +945,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk +@@ -929,7 +949,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk if (libxlMakeNetworkDiskSrc(l_disk->src, &x_disk->pdev_path) < 0) return -1; } else { @@ -54,7 +54,7 @@ Index: libvirt-4.0.0/src/libxl/libxl_conf.c return -1; } -@@ -1038,6 +1058,9 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk +@@ -1042,6 +1062,9 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0) return -1; libxlDiskSetCacheMode(x_disk, l_disk->cachemode); diff --git a/lxc-wait-after-eth-del.patch b/lxc-wait-after-eth-del.patch index df3b7bd..8d7832b 100644 --- a/lxc-wait-after-eth-del.patch +++ b/lxc-wait-after-eth-del.patch @@ -45,7 +45,7 @@ Index: libvirt-4.0.0/src/lxc/lxc_driver.c #include "virstring.h" #include "viraccessapicheck.h" #include "viraccessapichecklxc.h" -@@ -4006,6 +4007,7 @@ lxcDomainAttachDeviceNetLive(virConnectP +@@ -4007,6 +4008,7 @@ lxcDomainAttachDeviceNetLive(virConnectP case VIR_DOMAIN_NET_TYPE_NETWORK: case VIR_DOMAIN_NET_TYPE_ETHERNET: ignore_value(virNetDevVethDelete(veth)); @@ -53,7 +53,7 @@ Index: libvirt-4.0.0/src/lxc/lxc_driver.c break; case VIR_DOMAIN_NET_TYPE_DIRECT: -@@ -4440,6 +4442,7 @@ lxcDomainDetachDeviceNetLive(virDomainOb +@@ -4441,6 +4443,7 @@ lxcDomainDetachDeviceNetLive(virDomainOb virDomainAuditNet(vm, detach, NULL, "detach", false); goto cleanup; }