Re: [PATCH v2] parallels: implement .domainGetMaxMemory

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

 



On 04/23/2015 04:21 PM, Dmitry Guryanov wrote:
Since we haven't implemented balloon parameters tuning
we can just return amount of memory in this function.

Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
---
  src/parallels/parallels_driver.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

Changes in v2:
     use parallelsDomObjFromDomain function

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 07f1311..c791b5b 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -1098,6 +1098,20 @@ static int parallelsDomainAttachDevice(virDomainPtr dom, const char *xml)
                                              VIR_DOMAIN_AFFECT_CONFIG | VIR_DOMAIN_AFFECT_LIVE);
  }
+static unsigned long long
+parallelsDomainGetMaxMemory(virDomainPtr domain)
+{
+    virDomainObjPtr dom = NULL;
+    int ret = -1;
+
+    if (!(dom = parallelsDomObjFromDomain(domain)))
+        return -1;
+
+    ret = dom->def->mem.max_balloon;
+    virObjectUnlock(dom);
+    return ret;
+}
+
  static virHypervisorDriver parallelsDriver = {
      .name = "Parallels",
      .connectOpen = parallelsConnectOpen,            /* 0.10.0 */
@@ -1144,6 +1158,7 @@ static virHypervisorDriver parallelsDriver = {
      .domainHasManagedSaveImage = parallelsDomainHasManagedSaveImage, /* 1.2.13 */
      .domainManagedSave = parallelsDomainManagedSave, /* 1.2.14 */
      .domainManagedSaveRemove = parallelsDomainManagedSaveRemove, /* 1.2.14 */
+    .domainGetMaxMemory = parallelsDomainGetMaxMemory, /* 1.2.15 */
  };
static virConnectDriver parallelsConnectDriver = {
ACked and pushed.

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