-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
0016-libxl-setup-shadow-memory-according-to-max-hotplug-m.patch
55 lines (46 loc) · 2.11 KB
/
0016-libxl-setup-shadow-memory-according-to-max-hotplug-m.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 27a514c9604fcfa5f9397e8a700253e9d271b7c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
Date: Sat, 5 Aug 2023 22:53:39 +0200
Subject: [PATCH] libxl: setup shadow memory according to max hotplug memory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The '<maxMemory>' domain XML element is about maximum memory to be hot
plugged. Make libxl support this for calculating shadow memory amount,
which is used by Xen for internal accounting of domain memory (among
other things). If shadow memory is calculated based on initial memory,
then the domain can hotplug up to about twice that memory, but not more
(it silently doesn't get more).
The 'slots' attribute of the '<maxMemory>' element is ignored.
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
src/libxl/libxl_conf.c | 5 +++--
src/libxl/libxl_domain.c | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index fa1701d505..0fb48e7995 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -873,8 +873,9 @@ libxlMakeDomBuildInfo(virDomainDef *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);
+ libxl_get_required_shadow_memory(
+ def->mem.max_memory ? : b_info->max_memkb,
+ b_info->max_vcpus);
if (def->namespaceData) {
libxlDomainXmlNsDef *nsdata = def->namespaceData;
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index d9f5256f86..7991909bab 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -366,6 +366,7 @@ virDomainDefParserConfig libxlDomainDefParserConfig = {
.features = VIR_DOMAIN_DEF_FEATURE_USER_ALIAS |
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT |
+ VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
};
--
2.45.2