[PATCH] libxl: enable Xen's e820_host setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hotplugging PCI devices to Xen PV guests is only possible if the
libxl_domain_build_info struct has the e820_host field enabled when the
guest is created. By default it is disabled but libxl will automatically
enable e820_host if the config contains one or more PCI devices, in which
case hotplugging additional PCI devices later works.

According to xl.cfg(5) man page it is safe to unconditionally enable the
PV-only e820_host setting. Furthermore xen.git commits 414979ba85 and
f92337d949, which introduce the setting with a default of disabled, claim
the setting can be enabled or even removed "once the auto-ballooning of
guests with PCI devices works". Those commits are from May 2011 so I
think it is safe to say the issues have been resolved in the meantime.
Regardless, we should avoid exposing a Xen setting in libvirt that could
be removed later.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---

See related thread on the ML

https://www.redhat.com/archives/libvir-list/2020-April/msg00376.html


 src/libxl/libxl_conf.c                        | 5 +++++
 tests/libxlxml2domconfigdata/basic-pv.json    | 3 ++-
 tests/libxlxml2domconfigdata/multiple-ip.json | 3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index be5fc505fe..f6280157fb 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -288,6 +288,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
 #endif
     } else {
         libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PV);
+        /*
+         * e820_host is a PV-only setting and according to xl.cfg(5) it
+         * should be safe to unconditionally enable it.
+         */
+        libxl_defbool_set(&b_info->u.pv.e820_host, true);
     }
 
     b_info->max_vcpus = virDomainDefGetVcpusMax(def);
diff --git a/tests/libxlxml2domconfigdata/basic-pv.json b/tests/libxlxml2domconfigdata/basic-pv.json
index b71c3b0f49..2cb95feff8 100644
--- a/tests/libxlxml2domconfigdata/basic-pv.json
+++ b/tests/libxlxml2domconfigdata/basic-pv.json
@@ -19,7 +19,8 @@
 
         },
         "type.pv": {
-            "bootloader": "pygrub"
+            "bootloader": "pygrub",
+            "e820_host": "True"
         },
         "arch_arm": {
 
diff --git a/tests/libxlxml2domconfigdata/multiple-ip.json b/tests/libxlxml2domconfigdata/multiple-ip.json
index 2db98b82f6..01bb169cdc 100644
--- a/tests/libxlxml2domconfigdata/multiple-ip.json
+++ b/tests/libxlxml2domconfigdata/multiple-ip.json
@@ -19,7 +19,8 @@
 
         },
         "type.pv": {
-            "bootloader": "pygrub"
+            "bootloader": "pygrub",
+            "e820_host": "True"
         },
         "arch_arm": {
 
-- 
2.26.0






[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux