From f863ac809388c8429ef7fb3f0c25311b36385bd4 Mon Sep 17 00:00:00 2001 From: Dmitry Guryanov Date: Thu, 23 Apr 2015 16:21:00 +0300 Subject: [PATCH] parallels: implement .domainGetMaxMemory Since we haven't implemented balloon parameters tuning we can just return amount of memory in this function. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 07f13110ec..c791b5b49e 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 = { -- GitLab