提交 d9e0d4ec 编写于 作者: M Maxim Nestratov

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

Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
上级 9e8cbe18
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册