---
src/openvz/openvz_driver.c | 69 ++++++++++++++++------------------------------
1 file changed, 23 insertions(+), 46 deletions(-)
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 87df2a7..2f410c3 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -288,8 +288,7 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
}
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return hostname;
error:
@@ -319,8 +318,7 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn,
dom->id = vm->def->id;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return dom;
}
@@ -358,8 +356,7 @@ static char *openvzDomainGetOSType(virDomainPtr dom)
ignore_value(VIR_STRDUP(ret, vm->def->os.type));
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -385,8 +382,7 @@ static virDomainPtr openvzDomainLookupByUUID(virConnectPtr conn,
dom->id = vm->def->id;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return dom;
}
@@ -411,8 +407,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn,
dom->id = vm->def->id;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return dom;
}
@@ -454,8 +449,7 @@ static int openvzDomainGetInfo(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -485,8 +479,7 @@ openvzDomainGetState(virDomainPtr dom,
ret = openvzGetVEStatus(vm, state, reason);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -507,8 +500,7 @@ static int openvzDomainIsActive(virDomainPtr dom)
ret = virDomainObjIsActive(obj);
cleanup:
- if (obj)
- virObjectUnlock(obj);
+ virObjectUnlock(obj);
return ret;
}
@@ -529,8 +521,7 @@ static int openvzDomainIsPersistent(virDomainPtr dom)
ret = obj->persistent;
cleanup:
- if (obj)
- virObjectUnlock(obj);
+ virObjectUnlock(obj);
return ret;
}
@@ -559,8 +550,7 @@ static char *openvzDomainGetXMLDesc(virDomainPtr dom, unsigned int
flags) {
ret = virDomainDefFormat(vm->def, flags);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -618,8 +608,7 @@ static int openvzDomainSuspend(virDomainPtr dom)
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -657,8 +646,7 @@ static int openvzDomainResume(virDomainPtr dom)
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -703,8 +691,7 @@ openvzDomainShutdownFlags(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -764,8 +751,7 @@ static int openvzDomainReboot(virDomainPtr dom,
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -1037,8 +1023,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
cleanup:
virDomainDefFree(vmdef);
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
openvzDriverUnlock(driver);
return dom;
}
@@ -1125,8 +1110,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
cleanup:
virDomainDefFree(vmdef);
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
openvzDriverUnlock(driver);
return dom;
}
@@ -1173,8 +1157,7 @@ openvzDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -1222,8 +1205,7 @@ openvzDomainUndefineFlags(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
openvzDriverUnlock(driver);
return ret;
}
@@ -1260,8 +1242,7 @@ openvzDomainSetAutostart(virDomainPtr dom, int autostart)
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -1297,8 +1278,7 @@ openvzDomainGetAutostart(virDomainPtr dom, int *autostart)
cleanup:
VIR_FREE(value);
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -1393,8 +1373,7 @@ static int openvzDomainSetVcpusFlags(virDomainPtr dom, unsigned int
nvcpus,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -2006,8 +1985,7 @@ openvzDomainInterfaceStats(virDomainPtr dom,
_("invalid path, '%s' is not a known
interface"), path);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
@@ -2112,8 +2090,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
cleanup:
openvzDriverUnlock(driver);
virDomainDeviceDefFree(dev);
- if (vm)
- virObjectUnlock(vm);
+ virObjectUnlock(vm);
return ret;
}
--
1.9.0