Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/vz/vz_driver.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index b1b6d14..cf4b9e8 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -600,6 +600,7 @@ static int
vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
{
virDomainObjPtr dom;
+ vzDomObjPtr privdom;
int ret = -1;
if (!(dom = vzDomObjFromDomainRef(domain)))
@@ -611,13 +612,12 @@ vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
info->nrVirtCpu = virDomainDefGetVcpus(dom->def);
info->cpuTime = 0;
- if (virDomainObjIsActive(dom)) {
+ privdom = dom->privateData;
+
+ if (PRL_INVALID_HANDLE != privdom->stats && virDomainObjIsActive(dom)) {
unsigned long long vtime;
- vzDomObjPtr privdom;
size_t i;
- privdom = dom->privateData;
-
for (i = 0; i < virDomainDefGetVcpus(dom->def); ++i) {
if (prlsdkGetVcpuStats(privdom->stats, i, &vtime) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
--
1.8.3.1