[PATCH v2 5/5] vz: get disks statistics for CTs

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

 



A CT disk statistics is reported with prefix "hdd" and we should use
it to extract data.

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 src/vz/vz_driver.c | 10 ++++++++--
 src/vz/vz_sdk.c    |  5 +++--
 src/vz/vz_sdk.h    |  2 +-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index af9ef7f..93d8552 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1743,7 +1743,10 @@ vzDomainBlockStatsImpl(virDomainObjPtr dom,
             virReportError(VIR_ERR_INVALID_ARG, _("invalid path: %s"), path);
             return -1;
         }
-        if (prlsdkGetBlockStats(privdom->stats, dom->def->disks[idx], stats) < 0)
+        if (prlsdkGetBlockStats(privdom->stats,
+                                dom->def->disks[idx],
+                                stats,
+                                IS_CT(dom->def)) < 0)
             return -1;
     } else {
         virDomainBlockStatsStruct s;
@@ -1756,7 +1759,10 @@ vzDomainBlockStatsImpl(virDomainObjPtr dom,
 #undef PARALLELS_ZERO_STATS
 
         for (i = 0; i < dom->def->ndisks; i++) {
-            if (prlsdkGetBlockStats(privdom->stats, dom->def->disks[i], &s) < 0)
+            if (prlsdkGetBlockStats(privdom->stats,
+                                    dom->def->disks[i],
+                                    &s,
+                                    IS_CT(dom->def)) < 0)
                 return -1;
 
 #define PARALLELS_SUM_STATS(VAR, TYPE, NAME)        \
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index cc077f5..630a18f 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -4376,7 +4376,8 @@ prlsdkExtractStatsParam(PRL_HANDLE sdkstats, const char *name, long long *val)
 int
 prlsdkGetBlockStats(PRL_HANDLE sdkstats,
                     virDomainDiskDefPtr disk,
-                    virDomainBlockStatsPtr stats)
+                    virDomainBlockStatsPtr stats,
+                    bool isCt)
 {
     virDomainDeviceDriveAddressPtr address;
     int idx;
@@ -4395,7 +4396,7 @@ prlsdkGetBlockStats(PRL_HANDLE sdkstats,
         idx = address->unit;
         break;
     case VIR_DOMAIN_DISK_BUS_SCSI:
-        prefix = "scsi";
+        prefix = isCt ? "hdd" : "scsi";
         idx = address->unit;
         break;
     default:
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index ef789ab..e4e46dc 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -63,7 +63,7 @@ prlsdkDetachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPt
 int
 prlsdkUpdateDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
 int
-prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDefPtr disk, virDomainBlockStatsPtr stats);
+prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDefPtr disk, virDomainBlockStatsPtr stats, bool isCt);
 int
 prlsdkGetNetStats(PRL_HANDLE sdkstas, PRL_HANDLE sdkdom, const char *path, virDomainInterfaceStatsPtr stats);
 int
-- 
2.4.11

--
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