mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
9e8cbe185d
commit
d9e0d4ecbb
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user