mirror of https://gitee.com/openkylin/libvirt.git
(qemu|lxc)DomainGetCPUStats: Clean up
Remove unnecessary condition and variable.
This commit is contained in:
parent
68ee703bfe
commit
51f07d8f0f
|
@ -5704,8 +5704,7 @@ lxcDomainGetCPUStats(virDomainPtr dom,
|
|||
ret = virCgroupGetPercpuStats(priv->cgroup, params,
|
||||
nparams, start_cpu, ncpus, 0);
|
||||
cleanup:
|
||||
if (vm)
|
||||
virObjectUnlock(vm);
|
||||
virObjectUnlock(vm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -18081,7 +18081,6 @@ qemuDomainGetCPUStats(virDomainPtr domain,
|
|||
{
|
||||
virDomainObjPtr vm = NULL;
|
||||
int ret = -1;
|
||||
bool isActive;
|
||||
qemuDomainObjPrivatePtr priv;
|
||||
|
||||
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
|
||||
|
@ -18094,8 +18093,7 @@ qemuDomainGetCPUStats(virDomainPtr domain,
|
|||
if (virDomainGetCPUStatsEnsureACL(domain->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
isActive = virDomainObjIsActive(vm);
|
||||
if (!isActive) {
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("domain is not running"));
|
||||
goto cleanup;
|
||||
|
|
Loading…
Reference in New Issue