]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "LXC: show used memory as 0 when domain is not active"
authorJim Fehlig <jfehlig@suse.com>
Mon, 10 Aug 2015 18:49:55 +0000 (12:49 -0600)
committerJim Fehlig <jfehlig@suse.com>
Fri, 28 Aug 2015 16:19:21 +0000 (10:19 -0600)
This reverts commit 1ce7c1d20cfd5afb26d2dbc88201085d52415d0e,
which introduced a significant semantic change to the
virDomainGetInfo() API. Additionally, the change was only
made to 2 of the 15 virt drivers.

Conflicts:
src/qemu/qemu_driver.c

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
(cherry picked from commit 60acb38abbee1636a9cddf8d296f700d115c8f77)

src/lxc/lxc_driver.c
src/qemu/qemu_driver.c

index 9e12ecc012a2c4d079d2f2c0e4ed833c373aaa1c..eaad95d42a768bcca577fa99f5ed4d4a58d62f1a 100644 (file)
@@ -584,7 +584,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
 
     if (!virDomainObjIsActive(vm)) {
         info->cpuTime = 0;
-        info->memory = 0;
+        info->memory = vm->def->mem.cur_balloon;
     } else {
         if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
             virReportError(VIR_ERR_OPERATION_FAILED,
index 74985de28384c5e0261b1522880e9bba1ffe70c8..10c6fe6f368530b3680a16a4cd68ebe248b8d9e4 100644 (file)
@@ -2579,7 +2579,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
             info->memory = vm->def->mem.cur_balloon;
         }
     } else {
-        info->memory = 0;
+        info->memory = vm->def->mem.cur_balloon;
     }
 
     info->nrVirtCpu = vm->def->vcpus;