vz: don't fail query domain info in case we don't have valid stats handle

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
Maxim Nestratov 2016-06-07 19:34:50 +03:00
parent 9e8cbe185d
commit d9e0d4ecbb

View File

@ -600,6 +600,7 @@ static int
vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
{
virDomainObjPtr dom;
vzDomObjPtr privdom;
int ret = -1;
if (!(dom = vzDomObjFromDomainRef(domain)))
@ -611,12 +612,11 @@ vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
info->nrVirtCpu = virDomainDefGetVcpus(dom->def);
info->cpuTime = 0;
if (virDomainObjIsActive(dom)) {
unsigned long long vtime;
vzDomObjPtr privdom;
size_t i;
privdom = dom->privateData;
privdom = dom->privateData;
if (PRL_INVALID_HANDLE != privdom->stats && virDomainObjIsActive(dom)) {
unsigned long long vtime;
size_t i;
for (i = 0; i < virDomainDefGetVcpus(dom->def); ++i) {
if (prlsdkGetVcpuStats(privdom->stats, i, &vtime) < 0) {