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

[libvirt] [PATCH 04/10] libxl: set shadow memory for any guest type, not only HVM



Otherwise starting PVH guest will result in "arch_setup_bootlate:
mapping shared_info failed (pfn=..., rc=-1, errno: 12): Internal error".

After this change the behavior is the same as in `xl`.

Signed-off-by: Marek Marczykowski-Górecki <marmarek invisiblethingslab com>
---
 src/libxl/libxl_conf.c                        | 10 +++++-----
 tests/libxlxml2domconfigdata/basic-pv.json    |  1 +
 tests/libxlxml2domconfigdata/multiple-ip.json |  1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 998029d..476bcbe 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -634,11 +634,6 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
             return -1;
         }
 #endif
-
-        /* Allow libxl to calculate shadow memory requirements */
-        b_info->shadow_memkb =
-            libxl_get_required_shadow_memory(b_info->max_memkb,
-                                             b_info->max_vcpus);
     } else {
         /*
          * For compatibility with the legacy xen toolstack, default to pygrub
@@ -692,6 +687,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
         }
     }
 
+    /* Allow libxl to calculate shadow memory requirements */
+    b_info->shadow_memkb =
+        libxl_get_required_shadow_memory(b_info->max_memkb,
+                                         b_info->max_vcpus);
+
     return 0;
 }
 
diff --git a/tests/libxlxml2domconfigdata/basic-pv.json b/tests/libxlxml2domconfigdata/basic-pv.json
index 0f846da..b71c3b0 100644
--- a/tests/libxlxml2domconfigdata/basic-pv.json
+++ b/tests/libxlxml2domconfigdata/basic-pv.json
@@ -14,6 +14,7 @@
         ],
         "max_memkb": 524288,
         "target_memkb": 524288,
+        "shadow_memkb": 8192,
         "sched_params": {
 
         },
diff --git a/tests/libxlxml2domconfigdata/multiple-ip.json b/tests/libxlxml2domconfigdata/multiple-ip.json
index 80dca82..2db98b8 100644
--- a/tests/libxlxml2domconfigdata/multiple-ip.json
+++ b/tests/libxlxml2domconfigdata/multiple-ip.json
@@ -14,6 +14,7 @@
         ],
         "max_memkb": 524288,
         "target_memkb": 524288,
+        "shadow_memkb": 8192,
         "sched_params": {
 
         },
-- 
git-series 0.9.1


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