mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
vz: get disks statistics for CTs
A CT disk statistics is reported with prefix "hdd" and we should use it to extract data. Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
parent
7eda8369fc
commit
e4aa80dfde
@ -1746,7 +1746,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;
|
||||
@ -1759,7 +1762,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) \
|
||||
|
@ -4367,7 +4367,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;
|
||||
@ -4376,6 +4377,11 @@ prlsdkGetBlockStats(PRL_HANDLE sdkstats,
|
||||
char *name = NULL;
|
||||
|
||||
address = &disk->info.addr.drive;
|
||||
|
||||
if (isCt) {
|
||||
prefix = "hdd";
|
||||
idx = address->unit;
|
||||
} else {
|
||||
switch (disk->bus) {
|
||||
case VIR_DOMAIN_DISK_BUS_IDE:
|
||||
prefix = "ide";
|
||||
@ -4394,6 +4400,7 @@ prlsdkGetBlockStats(PRL_HANDLE sdkstats,
|
||||
_("Unknown disk bus: %X"), disk->bus);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define PRLSDK_GET_STAT_PARAM(VAL, TYPE, NAME) \
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user