Re: [PATCH 5/5] vz: add state group to all domain stats

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

 



12-Dec-16 10:56, Nikolay Shirokovskiy пишет:

---
  src/vz/vz_driver.c | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 01c1a96..d9bd2cd 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -3729,6 +3729,28 @@ vzDomainGetBalloonStats(virDomainObjPtr dom,
      return 0;
  }
+static int
+vzDomainGetStateStats(virDomainObjPtr dom,
+                      virDomainStatsRecordPtr record,
+                      int *maxparams)
+{
+    if (virTypedParamsAddInt(&record->params,
+                             &record->nparams,
+                             maxparams,
+                             "state.state",
+                             dom->state.state) < 0)
+        return -1;
+
+    if (virTypedParamsAddInt(&record->params,
+                             &record->nparams,
+                             maxparams,
+                             "state.reason",
+                             dom->state.reason) < 0)
+        return -1;
+
+    return 0;
+}
+
  static virDomainStatsRecordPtr
  vzDomainGetAllStats(virConnectPtr conn,
                      virDomainObjPtr dom)
@@ -3739,6 +3761,9 @@ vzDomainGetAllStats(virConnectPtr conn,
      if (VIR_ALLOC(stat) < 0)
          return NULL;
+ if (vzDomainGetStateStats(dom, stat, &maxparams) < 0)
+        goto error;
+
      if (vzDomainGetBlockStats(dom, stat, &maxparams) < 0)
          goto error;

ACK  for patches 2-5 also.

Maxim

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux