[PATCH 3/3] hyperv: Map Limit to max_memory and VirtualQuantity to cur_balloon

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

 



Hyper-V uses its own specific memory management so no mapping is going to
be perfect. However, it is more correct to map Limit to max_memory (it
really is the upper limit of what the VM may potentially use) and keep
cur_balloon equal to total_memory.

The typical value returned from Hyper-V in Limit is 1 TiB, which is not
really going to work if interpreted as "startup memory" to be ballooned
away later.

Signed-off-by: Ladi Prosek <lprosek@xxxxxxxxxx>
---
 src/hyperv/hyperv_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 998780b80..4565af3ed 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -920,8 +920,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
         def->description = virBufferContentAndReset(&buf);
     }
 
-    virDomainDefSetMemoryTotal(def, memorySettingData->data.common->Limit * 1024); /* megabyte to kilobyte */
-    def->mem.cur_balloon = memorySettingData->data.common->VirtualQuantity * 1024; /* megabyte to kilobyte */
+    /* mebibytes to kibibytes */
+    def->mem.max_memory = memorySettingData->data.common->Limit * 1024;
+    def->mem.cur_balloon = memorySettingData->data.common->VirtualQuantity * 1024;
+    virDomainDefSetMemoryTotal(def, memorySettingData->data.common->VirtualQuantity * 1024);
 
     if (virDomainDefSetVcpusMax(def,
                                 processorSettingData->data.common->VirtualQuantity,
-- 
2.13.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]
  Powered by Linux