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

Re: [libvirt] [PATCH v2] parallels: implement .domainGetMaxMemory



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 parallels com>
---
  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.


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