]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: prefer new location of nested_hvm in libxl_domain_build_info
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Wed, 19 Sep 2018 00:50:32 +0000 (02:50 +0200)
committerJim Fehlig <jfehlig@suse.com>
Tue, 25 Sep 2018 03:33:10 +0000 (21:33 -0600)
If available, use b_info->nested_hvm instead of
b_info->u.hvm.nested_hvm. This will make nested HVM config available
also for PVH domains.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_conf.c
tests/libxlxml2domconfigdata/fullvirt-cpuid.json
tests/libxlxml2domconfigdata/vnuma-hvm.json

index 476bcbe91879aa4c294907d90759f2a824dd4129..e2bfa2f5c39997951a318e78bc151f0c17199367 100644 (file)
@@ -455,7 +455,18 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
                     }
                 }
             }
-            libxl_defbool_set(&b_info->u.hvm.nested_hvm, hasHwVirt);
+#ifdef LIBXL_HAVE_BUILDINFO_NESTED_HVM
+            libxl_defbool_set(&b_info->nested_hvm, hasHwVirt);
+#else
+            if (hvm) {
+                libxl_defbool_set(&b_info->u.hvm.nested_hvm, hasHwVirt);
+            } else {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                        _("unsupported nested HVM setting for %s machine on this Xen version"),
+                        def->os.machine);
+                return -1;
+            }
+#endif
         }
 
         if (def->cpu && def->cpu->mode == VIR_CPU_MODE_CUSTOM) {
index cdc8b9867d7052958bd51ec0b3c0bc1c6f44eaf6..d46b464642524a239b8746afe21bff1c60fc9745 100644 (file)
         ],
         "sched_params": {
         },
+        "nested_hvm": "False",
         "type.hvm": {
             "pae": "True",
             "apic": "True",
             "acpi": "True",
-            "nested_hvm": "False",
             "nographic": "True",
             "vnc": {
                 "enable": "False"
index 3b2fc5f40fe522d66b253598db8decd227b90018..02c10a9deb4afe3b591136f3377ffa559de0d58f 100644 (file)
         "sched_params": {
 
         },
+        "nested_hvm": "True",
         "type.hvm": {
             "pae": "True",
             "apic": "True",
             "acpi": "True",
-            "nested_hvm": "True",
             "vga": {
                 "kind": "cirrus"
             },