[libvirt] [PATCH v3 0/4] vz: add statistics

Add vz statistics for network, cpu and memory. CHANGES from v1. subject prefix changed from 'parallels' to 'vz' CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk. 2. cleanup patch for net device lookups is added as suggested. 3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me. src/vz/vz_driver.c | 43 +++++++++- src/vz/vz_sdk.c | 248 +++++++++++++++++++++++++++++++++++++++++---------- src/vz/vz_sdk.h | 6 ++

From: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Populate counters SDK currenly supports: rx_bytes rx_packets tx_bytes tx_packets Comments. Use vzDomObjFromDomainRef/virDomainObjEndAPI pair to get domain object as we use prlsdkGetStatsParam that can release domain object lock and thus we need a reference in case domain is deleated meanwhile. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- src/vz/vz_driver.c | 17 ++++++++++ src/vz/vz_sdk.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/vz/vz_sdk.h | 2 + 3 files changed, 109 insertions(+), 1 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index d9ddd4f..5c503c6 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -1337,6 +1337,22 @@ vzDomainBlockStatsFlags(virDomainPtr domain, return ret; } +static int +vzDomainInterfaceStats(virDomainPtr domain, + const char *path, + virDomainInterfaceStatsPtr stats) +{ + virDomainObjPtr dom = NULL; + int ret; + + if (!(dom = vzDomObjFromDomainRef(domain))) + return -1; + + ret = prlsdkGetNetStats(dom, path, stats); + virDomainObjEndAPI(&dom); + + return ret; +} static virHypervisorDriver vzDriver = { .name = "vz", @@ -1389,6 +1405,7 @@ static virHypervisorDriver vzDriver = { .domainGetMaxMemory = vzDomainGetMaxMemory, /* 1.2.15 */ .domainBlockStats = vzDomainBlockStats, /* 1.3.0 */ .domainBlockStatsFlags = vzDomainBlockStatsFlags, /* 1.3.0 */ + .domainInterfaceStats = vzDomainInterfaceStats, /* 1.3.0 */ }; static virConnectDriver vzConnectDriver = { diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 388ea19..6401096 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3697,7 +3697,7 @@ prlsdkExtractStatsParam(PRL_HANDLE sdkstats, const char *name, long long *val) #define PARALLELS_STATISTICS_TIMEOUT (60 * 1000) -static int +int prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) { vzDomObjPtr privdom = dom->privateData; @@ -3793,3 +3793,92 @@ prlsdkGetBlockStats(virDomainObjPtr dom, virDomainDiskDefPtr disk, virDomainBloc VIR_FREE(name); return ret; } + +static PRL_HANDLE +prlsdkFindNetByPath(virDomainObjPtr dom, const char *path) +{ + PRL_UINT32 count = 0; + vzDomObjPtr privdom = dom->privateData; + PRL_UINT32 buflen = 0; + PRL_RESULT pret; + size_t i; + char *name = NULL; + PRL_HANDLE net = PRL_INVALID_HANDLE; + + pret = PrlVmCfg_GetNetAdaptersCount(privdom->sdkdom, &count); + prlsdkCheckRetGoto(pret, error); + + for (i = 0; i < count; ++i) { + pret = PrlVmCfg_GetNetAdapter(privdom->sdkdom, i, &net); + prlsdkCheckRetGoto(pret, error); + + pret = PrlVmDevNet_GetHostInterfaceName(net, NULL, &buflen); + prlsdkCheckRetGoto(pret, error); + + if (VIR_ALLOC_N(name, buflen) < 0) + goto error; + + pret = PrlVmDevNet_GetHostInterfaceName(net, name, &buflen); + prlsdkCheckRetGoto(pret, error); + + if (STREQ(name, path)) + break; + + VIR_FREE(name); + PrlHandle_Free(net); + net = PRL_INVALID_HANDLE; + } + + if (net == PRL_INVALID_HANDLE) + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path, '%s' is not a known interface"), path); + return net; + + error: + VIR_FREE(name); + PrlHandle_Free(net); + return PRL_INVALID_HANDLE; +} + +int +prlsdkGetNetStats(virDomainObjPtr dom, const char *path, + virDomainInterfaceStatsPtr stats) +{ + int ret = -1; + PRL_UINT32 net_index = -1; + char *name = NULL; + PRL_RESULT pret; + PRL_HANDLE net = PRL_INVALID_HANDLE; + + net = prlsdkFindNetByPath(dom, path); + if (net == PRL_INVALID_HANDLE) + goto cleanup; + + pret = PrlVmDev_GetIndex(net, &net_index); + prlsdkCheckRetGoto(pret, cleanup); + +#define PRLSDK_GET_NET_COUNTER(VAL, NAME) \ + if (virAsprintf(&name, "net.nic%d.%s", net_index, NAME) < 0) \ + goto cleanup; \ + if (prlsdkGetStatsParam(dom, name, &stats->VAL) < 0) \ + goto cleanup; \ + VIR_FREE(name); + + PRLSDK_GET_NET_COUNTER(rx_bytes, "bytes_in") + PRLSDK_GET_NET_COUNTER(rx_packets, "pkts_in") + PRLSDK_GET_NET_COUNTER(tx_bytes, "bytes_out") + PRLSDK_GET_NET_COUNTER(tx_packets, "pkts_out") + stats->rx_errs = -1; + stats->rx_drop = -1; + stats->tx_errs = -1; + stats->tx_drop = -1; + +#undef PRLSDK_GET_NET_COUNTER + ret = 0; + + cleanup: + VIR_FREE(name); + PrlHandle_Free(net); + + return ret; +} diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h index 80ff69a..53fe21f 100644 --- a/src/vz/vz_sdk.h +++ b/src/vz/vz_sdk.h @@ -70,3 +70,5 @@ int prlsdkAttachNet(virDomainObjPtr dom, vzConnPtr privconn, virDomainNetDefPtr net); int prlsdkDetachNet(virDomainObjPtr dom, vzConnPtr privconn, virDomainNetDefPtr net); +int +prlsdkGetNetStats(virDomainObjPtr dom, const char *path, virDomainInterfaceStatsPtr stats); -- 1.7.1

Make net device lookup by mac return sdk handle instead of quite ephemeral enumeration index. After this change there is no need anymore in special function of removing device by enumeration index. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- src/vz/vz_sdk.c | 77 ++++++++++++++++++++---------------------------------- 1 files changed, 29 insertions(+), 48 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 6401096..26f000f 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -2945,10 +2945,9 @@ int prlsdkAttachNet(virDomainObjPtr dom, return ret; } -static int -prlsdkGetNetIndex(PRL_HANDLE sdkdom, virDomainNetDefPtr net) +static PRL_HANDLE +prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac) { - int idx = -1; PRL_RESULT pret; PRL_UINT32 adaptersCount; PRL_UINT32 i; @@ -2957,12 +2956,12 @@ prlsdkGetNetIndex(PRL_HANDLE sdkdom, virDomainNetDefPtr net) char adapterMac[PRL_MAC_STRING_BUFNAME]; char expectedMac[PRL_MAC_STRING_BUFNAME]; - prlsdkFormatMac(&net->mac, expectedMac); + prlsdkFormatMac(mac, expectedMac); + pret = PrlVmCfg_GetNetAdaptersCount(sdkdom, &adaptersCount); prlsdkCheckRetGoto(pret, cleanup); for (i = 0; i < adaptersCount; ++i) { - pret = PrlVmCfg_GetNetAdapter(sdkdom, i, &adapter); prlsdkCheckRetGoto(pret, cleanup); @@ -2971,74 +2970,56 @@ prlsdkGetNetIndex(PRL_HANDLE sdkdom, virDomainNetDefPtr net) pret = PrlVmDevNet_GetMacAddress(adapter, adapterMac, &len); prlsdkCheckRetGoto(pret, cleanup); - if (memcmp(adapterMac, expectedMac, PRL_MAC_STRING_BUFNAME)) { - - PrlHandle_Free(adapter); - adapter = PRL_INVALID_HANDLE; - continue; - } + if (memcmp(adapterMac, expectedMac, PRL_MAC_STRING_BUFNAME) == 0) + return adapter; - idx = i; - break; + PrlHandle_Free(adapter); + adapter = PRL_INVALID_HANDLE; } cleanup: PrlHandle_Free(adapter); - return idx; -} - -static int prlsdkDelNetAdapter(PRL_HANDLE sdkdom, int idx) -{ - int ret = -1; - PRL_RESULT pret; - PRL_HANDLE sdknet = PRL_INVALID_HANDLE; - - pret = PrlVmCfg_GetNetAdapter(sdkdom, idx, &sdknet); - prlsdkCheckRetGoto(pret, cleanup); - - pret = PrlVmDev_Remove(sdknet); - prlsdkCheckRetGoto(pret, cleanup); - - ret = 0; - - cleanup: - PrlHandle_Free(sdknet); - return ret; + return adapter; } int prlsdkDetachNet(virDomainObjPtr dom, vzConnPtr privconn, virDomainNetDefPtr net) { - int ret = -1, idx = -1; + int ret = -1; vzDomObjPtr privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; + PRL_HANDLE sdknet = PRL_INVALID_HANDLE; + PRL_RESULT pret; if (!IS_CT(dom->def)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("network device cannot be detached")); - return ret; + goto cleanup; } job = PrlVm_BeginEdit(privdom->sdkdom); if (PRL_FAILED(waitJob(job))) - return ret; + goto cleanup; - idx = prlsdkGetNetIndex(privdom->sdkdom, net); - if (idx < 0) - return ret; + sdknet = prlsdkFindNetByMAC(privdom->sdkdom, &net->mac); + if (sdknet == PRL_INVALID_HANDLE) + goto cleanup; - ret = prlsdkDelNet(privconn, net); - if (ret != 0) - return ret; + if (prlsdkDelNet(privconn, net) < 0) + goto cleanup; - ret = prlsdkDelNetAdapter(privdom->sdkdom, idx); - if (ret == 0) { - job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE); - if (PRL_FAILED(waitJob(job))) - return -1; - } + pret = PrlVmDev_Remove(sdknet); + prlsdkCheckRetGoto(pret, cleanup); + job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE); + if (PRL_FAILED(waitJob(job))) + goto cleanup; + + ret = 0; + + cleanup: + PrlHandle_Free(sdknet); return ret; } -- 1.7.1

From: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Comments. Replace vzDomObjFromDomain/virObjectUnlock pair to vzDomObjFromDomainRef/virDomainObjEndAPI as we use prlsdkGetStatsParam. See previous statistics comments. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- src/vz/vz_driver.c | 6 ++++-- src/vz/vz_sdk.c | 19 +++++++++++++++++++ src/vz/vz_sdk.h | 2 ++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 5c503c6..d11ce18 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -826,7 +826,7 @@ vzDomainGetVcpus(virDomainPtr domain, int v, maxcpu, hostcpus; int ret = -1; - if (!(privdom = vzDomObjFromDomain(domain))) + if (!(privdom = vzDomObjFromDomainRef(domain))) goto cleanup; if (!virDomainObjIsActive(privdom)) { @@ -849,6 +849,8 @@ vzDomainGetVcpus(virDomainPtr domain, for (i = 0; i < maxinfo; i++) { info[i].number = i; info[i].state = VIR_VCPU_RUNNING; + if (prlsdkGetVcpuStats(privdom, i, &info[i].cpuTime) < 0) + goto cleanup; } } if (cpumaps != NULL) { @@ -871,7 +873,7 @@ vzDomainGetVcpus(virDomainPtr domain, cleanup: if (privdom) - virObjectUnlock(privdom); + virDomainObjEndAPI(&privdom); return ret; } diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 26f000f..aeeada3 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3863,3 +3863,22 @@ prlsdkGetNetStats(virDomainObjPtr dom, const char *path, return ret; } + +int +prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *vtime) +{ + char *name = NULL; + long long ptime = 0; + int ret = -1; + + if (virAsprintf(&name, "guest.vcpu%u.time", (unsigned int)idx) < 0) + goto cleanup; + if (prlsdkGetStatsParam(dom, name, &ptime) < 0) + goto cleanup; + *vtime = ptime == -1 ? 0 : ptime; + ret = 0; + + cleanup: + VIR_FREE(name); + return ret; +} diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h index 53fe21f..ca38c59 100644 --- a/src/vz/vz_sdk.h +++ b/src/vz/vz_sdk.h @@ -72,3 +72,5 @@ int prlsdkDetachNet(virDomainObjPtr dom, vzConnPtr privconn, virDomainNetDefPtr net); int prlsdkGetNetStats(virDomainObjPtr dom, const char *path, virDomainInterfaceStatsPtr stats); +int +prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *time); -- 1.7.1

From: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Implemented counters: VIR_DOMAIN_MEMORY_STAT_SWAP_IN VIR_DOMAIN_MEMORY_STAT_SWAP_OUT VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT VIR_DOMAIN_MEMORY_STAT_AVAILABLE VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON VIR_DOMAIN_MEMORY_STAT_UNUSED Comments. 1. Use vzDomObjFromDomainRef/virDomainObjEndAPI pair to get domain object as we use prlsdkGetStatsParam. See previous statistics comments. 2. Balloon statistics is not applicable to containers. Fault statistics for containers not provided in PCS6 yet. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> --- src/vz/vz_driver.c | 20 +++++++++++++++++ src/vz/vz_sdk.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/vz/vz_sdk.h | 2 + 3 files changed, 83 insertions(+), 0 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index d11ce18..488df83 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -1356,6 +1356,25 @@ vzDomainInterfaceStats(virDomainPtr domain, return ret; } +static int +vzDomainMemoryStats(virDomainPtr domain, + virDomainMemoryStatPtr stats, + unsigned int nr_stats, + unsigned int flags) +{ + virDomainObjPtr dom = NULL; + int ret = -1; + + virCheckFlags(0, -1); + if (!(dom = vzDomObjFromDomainRef(domain))) + return -1; + + ret = prlsdkGetMemoryStats(dom, stats, nr_stats); + virDomainObjEndAPI(&dom); + + return ret; +} + static virHypervisorDriver vzDriver = { .name = "vz", .connectOpen = vzConnectOpen, /* 0.10.0 */ @@ -1408,6 +1427,7 @@ static virHypervisorDriver vzDriver = { .domainBlockStats = vzDomainBlockStats, /* 1.3.0 */ .domainBlockStatsFlags = vzDomainBlockStatsFlags, /* 1.3.0 */ .domainInterfaceStats = vzDomainInterfaceStats, /* 1.3.0 */ + .domainMemoryStats = vzDomainMemoryStats, /* 1.3.0 */ }; static virConnectDriver vzConnectDriver = { diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index aeeada3..fff9608 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3882,3 +3882,64 @@ prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *vtime) VIR_FREE(name); return ret; } + +int +prlsdkGetMemoryStats(virDomainObjPtr dom, + virDomainMemoryStatPtr stats, + unsigned int nr_stats) +{ + int ret = -1; + long long v = 0, t = 0, u = 0; + size_t i = 0; + +#define PRLSDK_GET_COUNTER(NAME, VALUE) \ + if (prlsdkGetStatsParam(dom, NAME, &VALUE) < 0) \ + goto cleanup; \ + +#define PRLSDK_MEMORY_STAT_SET(TAG, VALUE) \ + if (i < nr_stats) { \ + stats[i].tag = (TAG); \ + stats[i].val = (VALUE); \ + i++; \ + } + + i = 0; + + // count to kb + PRLSDK_GET_COUNTER("guest.ram.swap_in", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_SWAP_IN, v << 12) + + PRLSDK_GET_COUNTER("guest.ram.swap_out", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_SWAP_OUT, v << 12) + + PRLSDK_GET_COUNTER("guest.ram.minor_fault", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT, v) + + PRLSDK_GET_COUNTER("guest.ram.major_fault", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT, v) + + PRLSDK_GET_COUNTER("guest.ram.total", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_AVAILABLE, v << 10) + + PRLSDK_GET_COUNTER("guest.ram.balloon_actual", v) + if (v != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON, v << 10) + + PRLSDK_GET_COUNTER("guest.ram.usage", u) + PRLSDK_GET_COUNTER("guest.ram.total", t) + if (u != -1 && t != -1) + PRLSDK_MEMORY_STAT_SET(VIR_DOMAIN_MEMORY_STAT_UNUSED, (t - u) << 10) + +#undef PRLSDK_GET_COUNTER +#undef PRLSDK_MEMORY_STAT_SET + + ret = i; + cleanup: + + return ret; +} diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h index ca38c59..ebe4591 100644 --- a/src/vz/vz_sdk.h +++ b/src/vz/vz_sdk.h @@ -74,3 +74,5 @@ int prlsdkGetNetStats(virDomainObjPtr dom, const char *path, virDomainInterfaceStatsPtr stats); int prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *time); +int +prlsdkGetMemoryStats(virDomainObjPtr dom, virDomainMemoryStatPtr stats, unsigned int nr_stats); -- 1.7.1

On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me.
ACKed and pushed the whole series.
src/vz/vz_driver.c | 43 +++++++++- src/vz/vz_sdk.c | 248 +++++++++++++++++++++++++++++++++++++++++---------- src/vz/vz_sdk.h | 6 ++
-- Dmitry Guryanov

On Fri, Jun 26, 2015 at 16:51:59 +0300, Dmitry Guryanov wrote:
On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me.
ACKed and pushed the whole series.
Broke the build: vz/vz_sdk.c:3681:1: error: no previous prototype for 'prlsdkGetStatsParam' [-Werror=missing-prototypes] prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) ^ CC security/libvirt_security_manager_la-security_dac.lo CC security/libvirt_security_manager_la-security_manager.lo cc1: all warnings being treated as errors Please make sure you run all check before pushing! Peter

On 06/26/2015 04:59 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 16:51:59 +0300, Dmitry Guryanov wrote:
On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me. ACKed and pushed the whole series. Broke the build:
vz/vz_sdk.c:3681:1: error: no previous prototype for 'prlsdkGetStatsParam' [-Werror=missing-prototypes] prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) ^ CC security/libvirt_security_manager_la-security_dac.lo CC security/libvirt_security_manager_la-security_manager.lo cc1: all warnings being treated as errors
Please make sure you run all check before pushing!
Sorry, I need to run checks with a new compiler :(
Peter
-- Dmitry Guryanov

On Fri, Jun 26, 2015 at 17:01:25 +0300, Dmitry Guryanov wrote:
On 06/26/2015 04:59 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 16:51:59 +0300, Dmitry Guryanov wrote:
On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me. ACKed and pushed the whole series. Broke the build:
vz/vz_sdk.c:3681:1: error: no previous prototype for 'prlsdkGetStatsParam' [-Werror=missing-prototypes] prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) ^ CC security/libvirt_security_manager_la-security_dac.lo CC security/libvirt_security_manager_la-security_manager.lo cc1: all warnings being treated as errors
Please make sure you run all check before pushing!
Sorry, I need to run checks with a new compiler :(
I've pushed a fix already. Peter

On 06/26/2015 05:04 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 17:01:25 +0300, Dmitry Guryanov wrote:
On 06/26/2015 04:59 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 16:51:59 +0300, Dmitry Guryanov wrote:
On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me. ACKed and pushed the whole series. Broke the build:
vz/vz_sdk.c:3681:1: error: no previous prototype for 'prlsdkGetStatsParam' [-Werror=missing-prototypes] prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) ^ CC security/libvirt_security_manager_la-security_dac.lo CC security/libvirt_security_manager_la-security_manager.lo cc1: all warnings being treated as errors
Please make sure you run all check before pushing! Sorry, I need to run checks with a new compiler :( I've pushed a fix already. Thanks!
Peter
-- Dmitry Guryanov

On 06/26/2015 05:04 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 17:01:25 +0300, Dmitry Guryanov wrote:
On 06/26/2015 04:59 PM, Peter Krempa wrote:
On Fri, Jun 26, 2015 at 16:51:59 +0300, Dmitry Guryanov wrote:
On 06/26/2015 02:24 PM, Nikolay Shirokovskiy wrote:
Add vz statistics for network, cpu and memory.
CHANGES from v1. subject prefix changed from 'parallels' to 'vz'
CHANGES from v2. 1. Concering all patches - most of implementation details are moved to vz_sdk.c. Reason is that first this makes other subsystems statistics to be on par with block device statistics. Second, this way we eliminate small helper functions which arise only because we can't use sdk harness. (like prlsdkGetAdapterIndex in previous versions). Third this way we keep all sdk details in vz_sdk.
2. cleanup patch for net device lookups is added as suggested.
3. memory stats patch stays with macros. First I wanted to use just one big macro with conversion argument but then i hit the VIR_DOMAIN_MEMORY_STAT_UNUSED counter which buries this idea. Finally this variant still seems the best for me. ACKed and pushed the whole series. Broke the build:
vz/vz_sdk.c:3681:1: error: no previous prototype for 'prlsdkGetStatsParam' [-Werror=missing-prototypes] prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val) ^ CC security/libvirt_security_manager_la-security_dac.lo CC security/libvirt_security_manager_la-security_manager.lo cc1: all warnings being treated as errors
Please make sure you run all check before pushing! Sorry, I need to run checks with a new compiler :( I've pushed a fix already.
I moved repo to host with the newest fedora and added pre-push hook, which will run check and syntax-check, so there will be no such problems anymore.
Peter
-- Dmitry Guryanov
participants (3)
-
Dmitry Guryanov
-
Nikolay Shirokovskiy
-
Peter Krempa