Remove unnecessary condition and variable. --- src/lxc/lxc_driver.c | 3 +-- src/qemu/qemu_driver.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 24b9622..67088c8 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8ccf68b..2300c7e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18082,7 +18082,6 @@ qemuDomainGetCPUStats(virDomainPtr domain, { virDomainObjPtr vm = NULL; int ret = -1; - bool isActive; qemuDomainObjPrivatePtr priv; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -18095,8 +18094,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; -- 2.6.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list