[PATCH 2/3] conf: Fix up balloon size after removing a memory device from def

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

 



To avoid having the ballooned memory size larger than the actual
physical memory size, truncate the ballooned size if it overflows.
---
 src/conf/domain_conf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d397bca..3a1782e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12986,6 +12986,11 @@ virDomainMemoryRemove(virDomainDefPtr def,
 {
     virDomainMemoryDefPtr ret = def->mems[idx];
     VIR_DELETE_ELEMENT(def->mems, idx, def->nmems);
+
+    /* fix up balloon size */
+    if (def->mem.cur_balloon > virDomainDefGetMemoryActual(def))
+        def->mem.cur_balloon = virDomainDefGetMemoryActual(def);
+
     return ret;
 }

-- 
2.3.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]