From 47370d5a0bc91c8183ab2fc2f2096e03ff0458fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gro=C3=9F?= Date: Thu, 2 Jun 2011 20:16:32 +0800 Subject: [PATCH] libxl: get maximum memory of running domain * src/libxl/libxl_driver.c: fix the libxlDomainGetInfo to return the maximum memory for running domain --- src/libxl/libxl_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 3491f402d6..61c3494bc4 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1639,6 +1639,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) if (!virDomainObjIsActive(vm)) { info->cpuTime = 0; info->memory = vm->def->mem.cur_balloon; + info->maxMem = vm->def->mem.max_balloon; } else { if (libxl_domain_info(&driver->ctx, &d_info, dom->id) != 0) { libxlError(VIR_ERR_INTERNAL_ERROR, @@ -1647,10 +1648,10 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) } info->cpuTime = d_info.cpu_time; info->memory = d_info.current_memkb; + info->maxMem = d_info.max_memkb; } info->state = virDomainObjGetState(vm, NULL); - info->maxMem = vm->def->mem.max_balloon; info->nrVirtCpu = vm->def->vcpus; ret = 0; -- GitLab