]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Added missing memory reporting into python bindings
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 3 Feb 2012 14:53:06 +0000 (15:53 +0100)
committerEric Blake <eblake@redhat.com>
Fri, 3 Feb 2012 17:48:32 +0000 (10:48 -0700)
Two types of memory stats were not reported by python bindings. This
patch fixes both of them.

python/libvirt-override.c

index 68e0b5503d59cc7aade82061d543992f2d137a8b..33a841de14171ae274ad5be02856a0e77d2f4003 100644 (file)
@@ -259,6 +259,12 @@ libvirt_virDomainMemoryStats(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
         else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_AVAILABLE)
             PyDict_SetItem(info, libvirt_constcharPtrWrap("available"),
                            PyLong_FromUnsignedLongLong(stats[i].val));
+        else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON)
+            PyDict_SetItem(info, libvirt_constcharPtrWrap("actual"),
+                           PyLong_FromUnsignedLongLong(stats[i].val));
+        else if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS)
+            PyDict_SetItem(info, libvirt_constcharPtrWrap("rss"),
+                           PyLong_FromUnsignedLongLong(stats[i].val));
     }
     return info;
 }