--- src/access/viraccessdriverpolkit.c | 4 +- src/access/viraccessmanager.c | 2 +- src/bhyve/bhyve_command.c | 4 +- src/bhyve/bhyve_driver.c | 26 ++++----- src/bhyve/bhyve_process.c | 4 +- src/datatypes.c | 20 +++---- src/driver.c | 2 +- src/fdstream.c | 16 +++--- src/hyperv/hyperv_driver.c | 44 +++++++-------- src/hyperv/hyperv_util.c | 2 +- src/hyperv/hyperv_wmi.c | 4 +- src/interface/interface_backend_netcf.c | 28 ++++----- src/interface/interface_backend_udev.c | 26 ++++----- src/libvirt-lxc.c | 6 +- src/libvirt-qemu.c | 10 ++-- src/node_device/node_device_driver.c | 18 +++--- src/node_device/node_device_hal.c | 4 +- src/node_device/node_device_linux_sysfs.c | 2 +- src/node_device/node_device_udev.c | 46 +++++++-------- src/nodeinfo.c | 36 ++++++------ src/openvz/openvz_conf.c | 26 ++++----- src/openvz/openvz_driver.c | 74 ++++++++++++------------ src/openvz/openvz_util.c | 2 +- src/phyp/phyp_driver.c | 94 +++++++++++++++---------------- src/secret/secret_driver.c | 34 +++++------ src/security/security_apparmor.c | 26 ++++----- src/security/security_dac.c | 10 ++-- src/security/security_manager.c | 2 +- src/security/security_selinux.c | 32 +++++------ src/security/virt-aa-helper.c | 24 ++++---- src/uml/uml_conf.c | 4 +- src/uml/uml_driver.c | 74 ++++++++++++------------ src/vmware/vmware_conf.c | 14 ++--- src/vmware/vmware_driver.c | 38 ++++++------- src/vmx/vmx.c | 36 ++++++------ src/xenapi/xenapi_driver.c | 12 ++-- src/xenapi/xenapi_utils.c | 8 +-- src/xenxs/xen_sxpr.c | 22 ++++---- src/xenxs/xen_xm.c | 12 ++-- 39 files changed, 424 insertions(+), 424 deletions(-) diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c index 70db860..8ffb828 100644 --- a/src/access/viraccessdriverpolkit.c +++ b/src/access/viraccessdriverpolkit.c @@ -125,7 +125,7 @@ virAccessDriverPolkitFormatProcess(const char *actionid) goto cleanup; #endif -cleanup: + cleanup: virObjectUnref(identity); return ret; } @@ -181,7 +181,7 @@ virAccessDriverPolkitCheck(virAccessManagerPtr manager ATTRIBUTE_UNUSED, goto cleanup; } -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(actionid); VIR_FREE(process); diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index c042ccf..bcf552b 100644 --- a/src/access/viraccessmanager.c +++ b/src/access/viraccessmanager.c @@ -170,7 +170,7 @@ virAccessManagerPtr virAccessManagerNewStack(const char **names) return manager; -error: + error: virObjectUnref(manager); return NULL; } diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index b9bc0a6..a15d345 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -99,7 +99,7 @@ virBhyveTapGetRealDeviceName(char *name) virReportSystemError(errno, "%s", _("Unable to iterate over TAP devices")); -cleanup: + cleanup: VIR_FREE(devpath); VIR_FORCE_CLOSE(fd); closedir(dirp); @@ -282,7 +282,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver ATTRIBUTE_UNUSED, return cmd; -error: + error: virCommandFree(cmd); return NULL; } diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index a524d35..f54dff0 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -94,7 +94,7 @@ bhyveBuildCapabilities(void) return caps; -error: + error: virObjectUnref(caps); return NULL; } @@ -231,7 +231,7 @@ bhyveDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) info->nrVirtCpu = vm->def->vcpus; ret = 0; -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -256,7 +256,7 @@ bhyveDomainGetState(virDomainPtr domain, *state = virDomainObjGetState(vm, reason); ret = 0; -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -275,7 +275,7 @@ bhyveDomainIsActive(virDomainPtr domain) ret = virDomainObjIsActive(obj); -cleanup: + cleanup: virObjectUnlock(obj); return ret; } @@ -294,7 +294,7 @@ bhyveDomainIsPersistent(virDomainPtr domain) ret = obj->persistent; -cleanup: + cleanup: virObjectUnlock(obj); return ret; } @@ -313,7 +313,7 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) ret = virDomainDefFormat(vm->def, flags); -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -349,7 +349,7 @@ bhyveDomainDefineXML(virConnectPtr conn, const char *xml) if (virDomainSaveConfig(BHYVE_CONFIG_DIR, vm->def) < 0) goto cleanup; -cleanup: + cleanup: virDomainDefFree(def); virObjectUnlock(vm); @@ -389,7 +389,7 @@ bhyveDomainUndefine(virDomainPtr domain) ret = 0; -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -500,7 +500,7 @@ bhyveDomainLookupByUUID(virConnectPtr conn, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virObjectUnlock(vm); return dom; } @@ -527,7 +527,7 @@ static virDomainPtr bhyveDomainLookupByName(virConnectPtr conn, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virObjectUnlock(vm); return dom; } @@ -562,7 +562,7 @@ bhyveDomainCreateWithFlags(virDomainPtr dom, VIR_DOMAIN_RUNNING_BOOTED, start_flags); -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -594,7 +594,7 @@ bhyveDomainDestroy(virDomainPtr dom) ret = virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED); -cleanup: + cleanup: virObjectUnlock(vm); return ret; } @@ -710,7 +710,7 @@ bhyveStateInitialize(bool priveleged ATTRIBUTE_UNUSED, return 0; -cleanup: + cleanup: bhyveStateCleanup(); return -1; } diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 423185a..b37855e 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -158,7 +158,7 @@ virBhyveProcessStart(virConnectPtr conn, ret = 0; -cleanup: + cleanup: if (ret < 0) { virCommandPtr destroy_cmd; if ((destroy_cmd = virBhyveProcessBuildDestroyCmd(driver, vm)) != NULL) { @@ -232,7 +232,7 @@ virBhyveProcessStop(bhyveConnPtr driver, vm->pid = -1; vm->def->id = -1; -cleanup: + cleanup: virCommandFree(cmd); return ret; } diff --git a/src/datatypes.c b/src/datatypes.c index cdc8c6c..87e3550 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -121,7 +121,7 @@ virGetConnect(void) return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -227,7 +227,7 @@ virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -290,7 +290,7 @@ virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -356,7 +356,7 @@ virGetInterface(virConnectPtr conn, const char *name, const char *mac) return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -425,7 +425,7 @@ virGetStoragePool(virConnectPtr conn, const char *name, return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -503,7 +503,7 @@ virGetStorageVol(virConnectPtr conn, const char *pool, const char *name, return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -566,7 +566,7 @@ virGetNodeDevice(virConnectPtr conn, const char *name) ret->conn = virObjectRef(conn); return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -630,7 +630,7 @@ virGetSecret(virConnectPtr conn, const unsigned char *uuid, return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -740,7 +740,7 @@ virGetNWFilter(virConnectPtr conn, const char *name, return ret; -error: + error: virObjectUnref(ret); return NULL; } @@ -800,7 +800,7 @@ virGetDomainSnapshot(virDomainPtr domain, const char *name) return ret; -error: + error: virObjectUnref(ret); return NULL; } diff --git a/src/driver.c b/src/driver.c index fdba2dc..6b79b5e 100644 --- a/src/driver.c +++ b/src/driver.c @@ -103,7 +103,7 @@ virDriverLoadModule(const char *name) VIR_FREE(regfunc); return handle; -cleanup: + cleanup: VIR_FREE(modfile); VIR_FREE(regfunc); if (handle) diff --git a/src/fdstream.c b/src/fdstream.c index d0435c7..a244bb0 100644 --- a/src/fdstream.c +++ b/src/fdstream.c @@ -121,7 +121,7 @@ static int virFDStreamRemoveCallback(virStreamPtr stream) ret = 0; -cleanup: + cleanup: virMutexUnlock(&fdst->lock); return ret; } @@ -149,7 +149,7 @@ static int virFDStreamUpdateCallback(virStreamPtr stream, int events) ret = 0; -cleanup: + cleanup: virMutexUnlock(&fdst->lock); return ret; } @@ -246,7 +246,7 @@ virFDStreamAddCallback(virStreamPtr st, ret = 0; -cleanup: + cleanup: virMutexUnlock(&fdst->lock); return ret; } @@ -396,7 +396,7 @@ static int virFDStreamWrite(virStreamPtr st, const char *bytes, size_t nbytes) nbytes = fdst->length - fdst->offset; } -retry: + retry: ret = write(fdst->fd, bytes, nbytes); if (ret < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { @@ -446,7 +446,7 @@ static int virFDStreamRead(virStreamPtr st, char *bytes, size_t nbytes) nbytes = fdst->length - fdst->offset; } -retry: + retry: ret = read(fdst->fd, bytes, nbytes); if (ret < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { @@ -565,7 +565,7 @@ int virFDStreamConnectUNIX(virStreamPtr st, goto error; return 0; -error: + error: VIR_FORCE_CLOSE(fd); return -1; } @@ -678,7 +678,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, return 0; -error: + error: virCommandFree(cmd); VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(childfd); @@ -752,7 +752,7 @@ int virFDStreamOpenPTY(virStreamPtr st, return 0; -cleanup: + cleanup: virFDStreamClose(st); return -1; } diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 7a80885..aed9307 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -196,7 +196,7 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags priv = NULL; result = VIR_DRV_OPEN_SUCCESS; - cleanup: + cleanup: hypervFreePrivate(&priv); VIR_FREE(username); VIR_FREE(password); @@ -252,7 +252,7 @@ hypervConnectGetHostname(virConnectPtr conn) ignore_value(VIR_STRDUP(hostname, computerSystem->data->DNSHostName)); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return hostname; @@ -349,7 +349,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) result = 0; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); hypervFreeObject(priv, (hypervObject *)processorList); @@ -394,7 +394,7 @@ hypervConnectListDomains(virConnectPtr conn, int *ids, int maxids) success = true; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystemList); return success ? count : -1; @@ -430,7 +430,7 @@ hypervConnectNumOfDomains(virConnectPtr conn) success = true; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystemList); return success ? count : -1; @@ -462,7 +462,7 @@ hypervDomainLookupByID(virConnectPtr conn, int id) hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return domain; @@ -498,7 +498,7 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return domain; @@ -531,7 +531,7 @@ hypervDomainLookupByName(virConnectPtr conn, const char *name) hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return domain; @@ -560,7 +560,7 @@ hypervDomainSuspend(virDomainPtr domain) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_PAUSED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -589,7 +589,7 @@ hypervDomainResume(virDomainPtr domain) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_ENABLED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -621,7 +621,7 @@ hypervDomainDestroyFlags(virDomainPtr domain, unsigned int flags) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_DISABLED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -743,7 +743,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) result = 0; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); hypervFreeObject(priv, (hypervObject *)virtualSystemSettingData); hypervFreeObject(priv, (hypervObject *)processorSettingData); @@ -776,7 +776,7 @@ hypervDomainGetState(virDomainPtr domain, int *state, int *reason, result = 0; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -909,7 +909,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) xml = virDomainDefFormat(def, flags); - cleanup: + cleanup: virDomainDefFree(def); hypervFreeObject(priv, (hypervObject *)computerSystem); hypervFreeObject(priv, (hypervObject *)virtualSystemSettingData); @@ -961,7 +961,7 @@ hypervConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxn success = true; - cleanup: + cleanup: if (!success) { for (i = 0; i < count; ++i) { VIR_FREE(names[i]); @@ -1005,7 +1005,7 @@ hypervConnectNumOfDefinedDomains(virConnectPtr conn) success = true; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystemList); return success ? count : -1; @@ -1035,7 +1035,7 @@ hypervDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_ENABLED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -1109,7 +1109,7 @@ hypervDomainIsActive(virDomainPtr domain) result = hypervIsMsvmComputerSystemActive(computerSystem, NULL) ? 1 : 0; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -1158,7 +1158,7 @@ hypervDomainManagedSave(virDomainPtr domain, unsigned int flags) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_SUSPENDED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -1182,7 +1182,7 @@ hypervDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) result = computerSystem->data->EnabledState == MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0; - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -1213,7 +1213,7 @@ hypervDomainManagedSaveRemove(virDomainPtr domain, unsigned int flags) result = hypervInvokeMsvmComputerSystemRequestStateChange (domain, MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_DISABLED); - cleanup: + cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); return result; @@ -1336,7 +1336,7 @@ hypervConnectListAllDomains(virConnectPtr conn, doms = NULL; ret = count; -cleanup: + cleanup: if (doms) { for (i = 0; i < count; ++i) { virDomainFree(doms[i]); diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c index 3b8f491..ebf9eac 100644 --- a/src/hyperv/hyperv_util.c +++ b/src/hyperv/hyperv_util.c @@ -77,7 +77,7 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri) result = 0; - cleanup: + cleanup: if (result < 0) { hypervFreeParsedUri(parsedUri); } diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index bf472b6..6e6f629 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -236,7 +236,7 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char *root, result = 0; - cleanup: + cleanup: if (options != NULL) { wsmc_options_destroy(options); } @@ -517,7 +517,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain, result = 0; - cleanup: + cleanup: if (options != NULL) { wsmc_options_destroy(options); } diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index 666b5d4..4d55653 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -141,7 +141,7 @@ netcfStateReload(void) } ret = 0; -cleanup: + cleanup: virObjectUnlock(driverState); return ret; @@ -170,7 +170,7 @@ netcfGetMinimalDefForDevice(struct netcf_if *iface) return def; -cleanup: + cleanup: virInterfaceDefFree(def); return NULL; } @@ -261,7 +261,7 @@ netcfInterfaceObjIsActive(struct netcf_if *iface, *active = flags & NETCF_IFACE_ACTIVE; ret = 0; -cleanup: + cleanup: virObjectUnref(driverState); return ret; } @@ -377,7 +377,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn, ret = want; -cleanup: + cleanup: if (names && count > 0) for (i = 0; i < count; i++) VIR_FREE(names[i]); @@ -474,7 +474,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr conn, ret = want; -cleanup: + cleanup: if (allnames && count > 0) for (i = 0; i < count; i++) VIR_FREE(allnames[i]); @@ -683,7 +683,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn, ret = niface_objs; -cleanup: + cleanup: ncf_if_free(iface); if (names && count > 0) @@ -737,7 +737,7 @@ static virInterfacePtr netcfInterfaceLookupByName(virConnectPtr conn, ret = virGetInterface(conn, ncf_if_name(iface), ncf_if_mac_string(iface)); -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); @@ -786,7 +786,7 @@ static virInterfacePtr netcfInterfaceLookupByMACString(virConnectPtr conn, ret = virGetInterface(conn, ncf_if_name(iface), ncf_if_mac_string(iface)); -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); @@ -842,7 +842,7 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr ifinfo, goto cleanup; } -cleanup: + cleanup: ncf_if_free(iface); VIR_FREE(xmlstr); virInterfaceDefFree(ifacedef); @@ -892,7 +892,7 @@ static virInterfacePtr netcfInterfaceDefineXML(virConnectPtr conn, ret = virGetInterface(conn, ncf_if_name(iface), ncf_if_mac_string(iface)); -cleanup: + cleanup: ncf_if_free(iface); VIR_FREE(xmlstr); virInterfaceDefFree(ifacedef); @@ -933,7 +933,7 @@ static int netcfInterfaceUndefine(virInterfacePtr ifinfo) goto cleanup; } -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); @@ -986,7 +986,7 @@ static int netcfInterfaceCreate(virInterfacePtr ifinfo, goto cleanup; } -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); @@ -1039,7 +1039,7 @@ static int netcfInterfaceDestroy(virInterfacePtr ifinfo, goto cleanup; } -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); @@ -1073,7 +1073,7 @@ static int netcfInterfaceIsActive(virInterfacePtr ifinfo) ret = active ? 1 : 0; -cleanup: + cleanup: ncf_if_free(iface); virInterfaceDefFree(def); virObjectUnlock(driver); diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index 37f42bb..4fb8eab 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -85,7 +85,7 @@ udevGetMinimalDefForDevice(struct udev_device *dev) return def; -cleanup: + cleanup: virInterfaceDefFree(def); return NULL; } @@ -154,7 +154,7 @@ udevInterfaceOpen(virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; -cleanup: + cleanup: VIR_FREE(driverState); return VIR_DRV_OPEN_ERROR; @@ -220,7 +220,7 @@ udevNumOfInterfacesByStatus(virConnectPtr conn, virUdevStatus status, virInterfaceDefFree(def); } -cleanup: + cleanup: if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); @@ -288,7 +288,7 @@ udevListInterfacesByStatus(virConnectPtr conn, return count; -error: + error: if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); @@ -462,7 +462,7 @@ udevConnectListAllInterfaces(virConnectPtr conn, return count; -cleanup: + cleanup: if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); @@ -505,7 +505,7 @@ udevInterfaceLookupByName(virConnectPtr conn, const char *name) ret = virGetInterface(conn, def->name, def->mac); udev_device_unref(dev); -cleanup: + cleanup: udev_unref(udev); virInterfaceDefFree(def); @@ -568,7 +568,7 @@ udevInterfaceLookupByMACString(virConnectPtr conn, const char *macstr) ret = virGetInterface(conn, def->name, def->mac); udev_device_unref(dev); -cleanup: + cleanup: if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); @@ -842,7 +842,7 @@ udevGetIfaceDefBond(struct udev *udev, return 0; -error: + error: for (i = 0; slave_count != -1 && i < slave_count; i++) { VIR_FREE(slave_list[i]); } @@ -949,7 +949,7 @@ udevGetIfaceDefBridge(struct udev *udev, return 0; -error: + error: for (i = 0; member_count != -1 && i < member_count; i++) { VIR_FREE(member_list[i]); } @@ -986,7 +986,7 @@ udevGetIfaceDefVlan(struct udev *udev ATTRIBUTE_UNUSED, return 0; -error: + error: VIR_FREE(ifacedef->data.vlan.tag); VIR_FREE(ifacedef->data.vlan.devname); @@ -1094,7 +1094,7 @@ udevGetIfaceDef(struct udev *udev, const char *name) return ifacedef; -error: + error: udev_device_unref(dev); virInterfaceDefFree(ifacedef); @@ -1128,7 +1128,7 @@ udevInterfaceGetXMLDesc(virInterfacePtr ifinfo, virInterfaceDefFree(ifacedef); -cleanup: + cleanup: /* decrement our udev ptr */ udev_unref(udev); @@ -1164,7 +1164,7 @@ udevInterfaceIsActive(virInterfacePtr ifinfo) udev_device_unref(dev); -cleanup: + cleanup: udev_unref(udev); virInterfaceDefFree(def); diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c index f31b556..58892df 100644 --- a/src/libvirt-lxc.c +++ b/src/libvirt-lxc.c @@ -89,7 +89,7 @@ virDomainLxcOpenNamespace(virDomainPtr domain, virReportUnsupportedError(); -error: + error: virDispatchError(conn); return -1; } @@ -156,7 +156,7 @@ virDomainLxcEnterNamespace(virDomainPtr domain, return 0; -error: + error: virDispatchError(domain->conn); return -1; } @@ -266,7 +266,7 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model, return 0; -error: + error: virDispatchError(NULL); return -1; } diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c index 37afdfe..fed08fc 100644 --- a/src/libvirt-qemu.c +++ b/src/libvirt-qemu.c @@ -92,7 +92,7 @@ virDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd, virReportUnsupportedError(); -error: + error: virDispatchError(conn); return -1; } @@ -159,7 +159,7 @@ virDomainQemuAttach(virConnectPtr conn, virReportUnsupportedError(); -error: + error: virDispatchError(conn); return NULL; } @@ -213,7 +213,7 @@ virDomainQemuAgentCommand(virDomainPtr domain, virReportUnsupportedError(); -error: + error: virDispatchError(conn); return NULL; } @@ -299,7 +299,7 @@ virConnectDomainQemuMonitorEventRegister(virConnectPtr conn, } virReportUnsupportedError(); -error: + error: virDispatchError(conn); return -1; } @@ -337,7 +337,7 @@ virConnectDomainQemuMonitorEventDeregister(virConnectPtr conn, } virReportUnsupportedError(); -error: + error: virDispatchError(conn); return -1; } diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 638f074..1f3a083 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -97,7 +97,7 @@ static int update_driver_name(virNodeDeviceObjPtr dev) goto cleanup; ret = 0; -cleanup: + cleanup: VIR_FREE(driver_link); VIR_FREE(devpath); return ret; @@ -232,7 +232,7 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name) ret = virGetNodeDevice(conn, name); -cleanup: + cleanup: if (obj) virNodeDeviceObjUnlock(obj); return ret; @@ -284,7 +284,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, virNodeDeviceObjUnlock(obj); } -out: + out: nodeDeviceUnlock(driver); return dev; } @@ -319,7 +319,7 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev, ret = virNodeDeviceDefFormat(obj->def); -cleanup: + cleanup: if (obj) virNodeDeviceObjUnlock(obj); return ret; @@ -355,7 +355,7 @@ nodeDeviceGetParent(virNodeDevicePtr dev) "%s", _("no parent for this device")); } -cleanup: + cleanup: if (obj) virNodeDeviceObjUnlock(obj); return ret; @@ -389,7 +389,7 @@ nodeDeviceNumOfCaps(virNodeDevicePtr dev) ++ncaps; ret = ncaps; -cleanup: + cleanup: if (obj) virNodeDeviceObjUnlock(obj); return ret; @@ -425,7 +425,7 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) } ret = ncaps; -cleanup: + cleanup: if (obj) virNodeDeviceObjUnlock(obj); if (ret == -1) { @@ -555,7 +555,7 @@ nodeDeviceCreateXML(virConnectPtr conn, virReportError(VIR_ERR_NO_NODE_DEVICE, NULL); } -cleanup: + cleanup: nodeDeviceUnlock(driver); virNodeDeviceDefFree(def); VIR_FREE(wwnn); @@ -617,7 +617,7 @@ nodeDeviceDestroy(virNodeDevicePtr dev) } ret = 0; -out: + out: if (obj) virNodeDeviceObjUnlock(obj); VIR_FREE(parent_name); diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 1ca315b..5dbc3eb 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -259,7 +259,7 @@ gather_scsi_host_cap(LibHalContext *ctx, const char *udi, goto out; } -out: + out: return retval; } @@ -527,7 +527,7 @@ dev_create(const char *udi) failure: VIR_DEBUG("FAILED TO ADD dev %s", name); -cleanup: + cleanup: VIR_FREE(privData); virNodeDeviceDefFree(def); nodeDeviceUnlock(driverState); diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index 9233be5..6d9726f 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -115,7 +115,7 @@ detect_scsi_host_caps(union _virNodeDevCapData *d) } ret = 0; -cleanup: + cleanup: if (ret < 0) { /* Clear the two flags in case of producing confusing XML output */ d->scsi_host.flags &= ~(VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST | diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index ddd54e0..cf7803e 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -140,7 +140,7 @@ static int udevGetDeviceProperty(struct udev_device *udev_device, property_key, *property_value, udev_device_get_sysname(udev_device)); -out: + out: return ret; } @@ -227,7 +227,7 @@ static int udevGetDeviceSysfsAttr(struct udev_device *udev_device, attr_name, *attr_value, udev_device_get_sysname(udev_device)); -out: + out: return ret; } @@ -414,7 +414,7 @@ static int udevTranslatePCIIds(unsigned int vendor, ret = 0; -out: + out: return ret; } @@ -524,7 +524,7 @@ static int udevProcessPCI(struct udev_device *device, ret = 0; -out: + out: return ret; } @@ -581,7 +581,7 @@ static int udevProcessUSBDevice(struct udev_device *device, ret = 0; -out: + out: return ret; } @@ -626,7 +626,7 @@ static int udevProcessUSBInterface(struct udev_device *device, ret = 0; -out: + out: return ret; } @@ -669,7 +669,7 @@ static int udevProcessNetworkInterface(struct udev_device *device, ret = 0; -out: + out: return ret; } @@ -704,7 +704,7 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED, ret = 0; -out: + out: return ret; } @@ -727,7 +727,7 @@ static int udevProcessSCSITarget(struct udev_device *device ATTRIBUTE_UNUSED, ret = 0; -out: + out: return ret; } @@ -845,7 +845,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED, ret = 0; -out: + out: if (ret != 0) { VIR_ERROR(_("Failed to process SCSI device with sysfs path '%s'"), def->sysfs_path); @@ -876,7 +876,7 @@ static int udevProcessDisk(struct udev_device *device, data->storage.size = data->storage.num_blocks * data->storage.logical_block_size; -out: + out: return ret; } @@ -924,7 +924,7 @@ static int udevProcessRemoveableMedia(struct udev_device *device, def->caps->data.storage.logical_block_size; } -out: + out: return ret; } @@ -948,7 +948,7 @@ static int udevProcessCDROM(struct udev_device *device, has_media = tmp_int; ret = udevProcessRemoveableMedia(device, def, has_media); -out: + out: return ret; } @@ -996,7 +996,7 @@ static int udevProcessSD(struct udev_device *device, data->storage.size = data->storage.num_blocks * data->storage.logical_block_size; -out: + out: return ret; } @@ -1137,7 +1137,7 @@ static int udevProcessStorage(struct udev_device *device, goto out; } -out: + out: VIR_DEBUG("Storage ret=%d", ret); return ret; } @@ -1337,7 +1337,7 @@ static int udevSetParent(struct udev_device *device, ret = 0; -out: + out: return ret; } @@ -1388,7 +1388,7 @@ static int udevAddOneDevice(struct udev_device *device) ret = 0; -out: + out: if (ret != 0) { VIR_DEBUG("Discarding device %d %p %s", ret, def, def ? NULLSTR(def->sysfs_path) : ""); @@ -1444,7 +1444,7 @@ static int udevEnumerateDevices(struct udev *udev) udevProcessDeviceListEntry(udev, list_entry); } -out: + out: udev_enumerate_unref(udev_enumerate); return ret; } @@ -1534,7 +1534,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED, goto out; } -out: + out: udev_device_unref(device); nodeDeviceUnlock(driverState); return; @@ -1608,7 +1608,7 @@ udevGetDMIData(union _virNodeDevCapData *data) goto out; } -out: + out: VIR_FREE(tmp); if (device != NULL) { udev_device_unref(device); @@ -1647,7 +1647,7 @@ static int udevSetupSystemDev(void) ret = 0; -out: + out: if (ret == -1) { virNodeDeviceDefFree(def); } @@ -1758,10 +1758,10 @@ static int nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED, goto out_unlock; } -out_unlock: + out_unlock: nodeDeviceUnlock(driverState); -out: + out: if (ret == -1) { nodeStateCleanup(); } diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 5a6e4fa..53ba716 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -196,7 +196,7 @@ freebsdNodeGetCPUStats(int cpuNum, ret = 0; -cleanup: + cleanup: VIR_FREE(cpu_times); return ret; @@ -329,7 +329,7 @@ virNodeGetCpuValue(const char *dir, unsigned int cpu, const char *file, goto cleanup; } -cleanup: + cleanup: VIR_FORCE_FCLOSE(pathfp); VIR_FREE(path); @@ -378,7 +378,7 @@ virNodeCountThreadSiblings(const char *dir, unsigned int cpu) i++; } -cleanup: + cleanup: VIR_FORCE_FCLOSE(pathfp); VIR_FREE(path); @@ -553,7 +553,7 @@ virNodeParseNode(const char *node, ret = processors; -cleanup: + cleanup: /* don't shadow a more serious error */ if (cpudir && closedir(cpudir) < 0 && ret >= 0) { virReportSystemError(errno, _("problem closing %s"), node); @@ -711,7 +711,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, if (nodeinfo->cpus && nodeinfo->nodes) goto done; -fallback: + fallback: VIR_FREE(sysfs_cpudir); if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_dir) < 0) @@ -727,7 +727,7 @@ fallback: nodeinfo->cores = cores; nodeinfo->threads = threads; -done: + done: /* There should always be at least one cpu, socket, node, and thread. */ if (nodeinfo->cpus == 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no CPUs found")); @@ -763,7 +763,7 @@ done: ret = 0; -cleanup: + cleanup: /* don't shadow a more serious error */ if (nodedir && closedir(nodedir) < 0 && ret >= 0) { virReportSystemError(errno, _("problem closing %s"), sysfs_nodedir); @@ -861,7 +861,7 @@ linuxNodeGetCPUStats(FILE *procstat, _("Invalid cpuNum in %s"), __FUNCTION__); -cleanup: + cleanup: return ret; } @@ -967,7 +967,7 @@ linuxNodeGetMemoryStats(FILE *meminfo, ret = 0; -cleanup: + cleanup: return ret; } @@ -995,7 +995,7 @@ linuxParseCPUmax(const char *path) } while (*tmp++ != '\n'); ret++; -cleanup: + cleanup: VIR_FREE(str); return ret; } @@ -1020,7 +1020,7 @@ linuxParseCPUmap(int max_cpuid, const char *path) VIR_FREE(str); return map; -error: + error: VIR_FREE(str); virBitmapFree(map); return NULL; @@ -1044,7 +1044,7 @@ virNodeGetSiblingsList(const char *dir, int cpu_id) if (virBitmapParse(buf, 0, &ret, virNumaGetMaxCPUs()) < 0) goto cleanup; -cleanup: + cleanup: VIR_FREE(buf); VIR_FREE(path); return ret; @@ -1077,7 +1077,7 @@ int nodeGetInfo(virNodeInfoPtr nodeinfo) /* Convert to KB. */ nodeinfo->memory = physmem_total() / 1024; -cleanup: + cleanup: VIR_FORCE_FCLOSE(cpuinfo); return ret; } @@ -1319,7 +1319,7 @@ nodeSetMemoryParameterValue(virTypedParameterPtr param) } ret = 0; -cleanup: + cleanup: VIR_FREE(path); VIR_FREE(strval); return ret; @@ -1442,7 +1442,7 @@ nodeGetMemoryParameterValue(const char *field, } ret = 0; -cleanup: + cleanup: VIR_FREE(path); VIR_FREE(buf); return ret; @@ -1617,7 +1617,7 @@ nodeGetCPUMap(unsigned char **cpumap, *online = virBitmapCountBits(cpus); ret = maxpresent; -cleanup: + cleanup: if (ret < 0 && cpumap) VIR_FREE(*cpumap); virBitmapFree(cpus); @@ -1819,7 +1819,7 @@ nodeCapsInitNUMA(virCapsPtr caps) ret = 0; -cleanup: + cleanup: if (topology_failed || ret < 0) virCapabilitiesClearHostNUMACellCPUTopology(cpus, ncpus); @@ -1867,7 +1867,7 @@ nodeGetCellsFreeMemory(unsigned long long *freeMems, } ret = numCells; -cleanup: + cleanup: return ret; } diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 20c9a6f..85dd100 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -105,7 +105,7 @@ openvzExtractVersionInfo(const char *cmdstr, int *retversion) ret = 0; -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(help); @@ -160,7 +160,7 @@ openvzParseBarrierLimit(const char* value, } } ret = 0; -error: + error: VIR_FREE(str); return ret; } @@ -197,7 +197,7 @@ virCapsPtr openvzCapsInit(void) return caps; -no_memory: + no_memory: virObjectUnref(caps); return NULL; } @@ -336,7 +336,7 @@ openvzReadNetworkConf(virDomainDefPtr def, return 0; -error: + error: VIR_FREE(temp); virDomainNetDefFree(net); return -1; @@ -454,9 +454,9 @@ openvzReadFSConf(virDomainDefPtr def, VIR_FREE(temp); return 0; -no_memory: + no_memory: virReportOOMError(); -error: + error: VIR_FREE(temp); virDomainFSDefFree(fs); return -1; @@ -526,7 +526,7 @@ openvzReadMemConf(virDomainDefPtr def, int veid) } ret = 0; -error: + error: VIR_FREE(temp); return ret; } @@ -729,7 +729,7 @@ openvzWriteConfigParam(const char * conf_file, const char *param, const char *va return 0; -error: + error: VIR_FREE(line); VIR_FORCE_FCLOSE(fp); VIR_FORCE_CLOSE(temp_fd); @@ -862,7 +862,7 @@ openvz_copyfile(char* from_path, char* to_path) return 0; -error: + error: VIR_FREE(line); VIR_FORCE_FCLOSE(fp); VIR_FORCE_CLOSE(copy_fd); @@ -901,7 +901,7 @@ openvzCopyDefaultConfig(int vpsid) goto cleanup; ret = 0; -cleanup: + cleanup: VIR_FREE(confdir); VIR_FREE(default_conf_file); VIR_FREE(configfile_value); @@ -945,7 +945,7 @@ openvzLocateConfDir(void) i++; } -cleanup: + cleanup: return ret; } @@ -1016,7 +1016,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len) } } retval = 0; -cleanup: + cleanup: VIR_FREE(line); VIR_FORCE_FCLOSE(fp); VIR_FREE(conf_file); @@ -1059,7 +1059,7 @@ openvzSetDefinedUUID(int vpsid, unsigned char *uuid) } ret = 0; -cleanup: + cleanup: VIR_FORCE_FCLOSE(fp); VIR_FREE(conf_file); return ret; diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 526ddbd..87df2a7 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -206,7 +206,7 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) ret = 0; -cleanup: + cleanup: VIR_FREE(confdir); virCommandFree(cmd); @@ -251,7 +251,7 @@ openvzSetDiskQuota(virDomainDefPtr vmdef, } ret = 0; -cleanup: + cleanup: virCommandFree(cmd); return ret; @@ -287,12 +287,12 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags) goto error; } -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return hostname; -error: + error: VIR_FREE(hostname); goto cleanup; } @@ -318,7 +318,7 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -357,7 +357,7 @@ static char *openvzDomainGetOSType(virDomainPtr dom) ignore_value(VIR_STRDUP(ret, vm->def->os.type)); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -384,7 +384,7 @@ static virDomainPtr openvzDomainLookupByUUID(virConnectPtr conn, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -410,7 +410,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -453,7 +453,7 @@ static int openvzDomainGetInfo(virDomainPtr dom, info->nrVirtCpu = vm->def->vcpus; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -484,7 +484,7 @@ openvzDomainGetState(virDomainPtr dom, ret = openvzGetVEStatus(vm, state, reason); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -506,7 +506,7 @@ static int openvzDomainIsActive(virDomainPtr dom) } ret = virDomainObjIsActive(obj); -cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -528,7 +528,7 @@ static int openvzDomainIsPersistent(virDomainPtr dom) } ret = obj->persistent; -cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -558,7 +558,7 @@ static char *openvzDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { ret = virDomainDefFormat(vm->def, flags); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -617,7 +617,7 @@ static int openvzDomainSuspend(virDomainPtr dom) ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -656,7 +656,7 @@ static int openvzDomainResume(virDomainPtr dom) ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -702,7 +702,7 @@ openvzDomainShutdownFlags(virDomainPtr dom, dom->id = -1; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -763,7 +763,7 @@ static int openvzDomainReboot(virDomainPtr dom, virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -954,7 +954,7 @@ openvzDomainSetNetworkConfig(virConnectPtr conn, return 0; -exit: + exit: virBufferFreeAndReset(&buf); return -1; } @@ -1035,7 +1035,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml) if (dom) dom->id = -1; -cleanup: + cleanup: virDomainDefFree(vmdef); if (vm) virObjectUnlock(vm); @@ -1123,7 +1123,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virDomainDefFree(vmdef); if (vm) virObjectUnlock(vm); @@ -1172,7 +1172,7 @@ openvzDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED); ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1221,7 +1221,7 @@ openvzDomainUndefineFlags(virDomainPtr dom, ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); openvzDriverUnlock(driver); @@ -1259,7 +1259,7 @@ openvzDomainSetAutostart(virDomainPtr dom, int autostart) } ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1294,7 +1294,7 @@ openvzDomainGetAutostart(virDomainPtr dom, int *autostart) *autostart = 1; ret = 0; -cleanup: + cleanup: VIR_FREE(value); if (vm) @@ -1392,7 +1392,7 @@ static int openvzDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1479,7 +1479,7 @@ static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; -cleanup: + cleanup: openvzFreeDriver(driver); return VIR_DRV_OPEN_ERROR; }; @@ -1565,7 +1565,7 @@ static int openvzConnectListDomains(virConnectPtr conn ATTRIBUTE_UNUSED, } rc = got; -cleanup: + cleanup: VIR_FORCE_CLOSE(outfd); virCommandFree(cmd); return rc; @@ -1623,7 +1623,7 @@ static int openvzConnectListDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED, } rc = got; -out: + out: VIR_FORCE_CLOSE(outfd); virCommandFree(cmd); if (rc < 0) { @@ -1644,7 +1644,7 @@ static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid) int err = 0; /* read statistic from /proc/vz/vestat. -sample: + sample: Version: 2.2 VEID user nice system uptime idle other.. 33 78 0 1330 59454597 142650441835148 other.. @@ -1715,7 +1715,7 @@ openvzDomainSetMemoryInternal(virDomainObjPtr vm, return 0; -cleanup: + cleanup: return -1; } @@ -1753,7 +1753,7 @@ openvzDomainGetBarrierLimit(virDomainPtr domain, } ret = 0; -cleanup: + cleanup: VIR_FREE(output); virCommandFree(cmd); return ret; @@ -1785,7 +1785,7 @@ openvzDomainSetBarrierLimit(virDomainPtr domain, goto cleanup; ret = 0; -cleanup: + cleanup: virCommandFree(cmd); return ret; } @@ -1857,7 +1857,7 @@ openvzDomainGetMemoryParameters(virDomainPtr domain, *nparams = OPENVZ_NB_MEM_PARAM; result = 0; -cleanup: + cleanup: return result; } @@ -1915,7 +1915,7 @@ openvzDomainSetMemoryParameters(virDomainPtr domain, } } result = 0; -cleanup: + cleanup: return result; } @@ -1956,7 +1956,7 @@ openvzGetVEStatus(virDomainObjPtr vm, int *status, int *reason) ret = 0; -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(outbuf); return ret; @@ -2005,7 +2005,7 @@ openvzDomainInterfaceStats(virDomainPtr dom, virReportError(VIR_ERR_INVALID_ARG, _("invalid path, '%s' is not a known interface"), path); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -2109,7 +2109,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, ret = 0; -cleanup: + cleanup: openvzDriverUnlock(driver); virDomainDeviceDefFree(dev); if (vm) diff --git a/src/openvz/openvz_util.c b/src/openvz/openvz_util.c index 3113751..4214335 100644 --- a/src/openvz/openvz_util.c +++ b/src/openvz/openvz_util.c @@ -79,7 +79,7 @@ openvzVEGetStringParam(virDomainPtr domain, const char* param) if (len && output[len - 1] == '\n') output[len - 1] = '\0'; -cleanup: + cleanup: virCommandFree(cmd); return output; } diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 47a317e..d0b0166 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -193,7 +193,7 @@ phypExec(LIBSSH2_SESSION *session, const char *cmd, int *exit_status, } return virBufferContentAndReset(&tex_ret); -err: + err: (*exit_status) = SSH_CMD_ERR; virBufferFreeAndReset(&tex_ret); VIR_FREE(buffer); @@ -317,7 +317,7 @@ phypCapsInit(void) return caps; -no_memory: + no_memory: virObjectUnref(caps); return NULL; } @@ -415,7 +415,7 @@ phypConnectListDomainsGeneric(virConnectPtr conn, int *ids, int nids, line++; /* skip \n */ } -cleanup: + cleanup: VIR_FREE(ret); return got; } @@ -454,7 +454,7 @@ phypUUIDTable_WriteFile(virConnectPtr conn) } return 0; -err: + err: VIR_FORCE_CLOSE(fd); return -1; } @@ -530,7 +530,7 @@ phypUUIDTable_Push(virConnectPtr conn) ret = 0; -cleanup: + cleanup: if (channel) { libssh2_channel_send_eof(channel); libssh2_channel_wait_eof(channel); @@ -564,7 +564,7 @@ phypUUIDTable_RemLpar(virConnectPtr conn, int id) return 0; -err: + err: return -1; } @@ -592,7 +592,7 @@ phypUUIDTable_AddLpar(virConnectPtr conn, unsigned char *uuid, int id) return 0; -err: + err: VIR_FREE(item); return -1; } @@ -639,7 +639,7 @@ phypUUIDTable_ReadFile(virConnectPtr conn) VIR_FORCE_CLOSE(fd); return 0; -err: + err: VIR_FORCE_CLOSE(fd); return -1; } @@ -731,7 +731,7 @@ phypUUIDTable_Pull(virConnectPtr conn) ret = 0; -cleanup: + cleanup: if (channel) { libssh2_channel_send_eof(channel); libssh2_channel_wait_eof(channel); @@ -808,7 +808,7 @@ phypUUIDTable_Init(virConnectPtr conn) ret = 0; -cleanup: + cleanup: if (ret < 0 && table_created) { for (i = 0; i < uuid_table->nlpars; i++) { VIR_FREE(uuid_table->lpars[i]); @@ -964,7 +964,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth, freeaddrinfo(ai); goto err; -connected: + connected: (*internal_socket) = sock; @@ -997,7 +997,7 @@ connected: NULL)) == LIBSSH2_ERROR_EAGAIN); -keyboard_interactive: + keyboard_interactive: if (rc == LIBSSH2_ERROR_SOCKET_NONE || rc == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED || rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) { @@ -1035,10 +1035,10 @@ keyboard_interactive: goto err; } -disconnect: + disconnect: libssh2_session_disconnect(session, "Disconnecting..."); libssh2_session_free(session); -err: + err: VIR_FORCE_CLOSE(sock); VIR_FREE(userhome); VIR_FREE(pubkey); @@ -1047,7 +1047,7 @@ err: VIR_FREE(password); return NULL; -exit: + exit: VIR_FREE(userhome); VIR_FREE(pubkey); VIR_FREE(pvtkey); @@ -1152,7 +1152,7 @@ phypConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; -failure: + failure: VIR_FREE(managed_system); if (phyp_driver != NULL) { @@ -1457,7 +1457,7 @@ phypGetBackingDevice(virConnectPtr conn, const char *managed_system, if (char_ptr) *char_ptr = '\0'; -cleanup: + cleanup: VIR_FREE(ret); return backing_device; @@ -1602,7 +1602,7 @@ phypCreateServerSCSIAdapter(virConnectPtr conn) result = 0; -cleanup: + cleanup: VIR_FREE(profile); VIR_FREE(vios_name); VIR_FREE(ret); @@ -1785,7 +1785,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml) result = 0; -cleanup: + cleanup: VIR_FREE(ret); virDomainDeviceDefFree(dev); virDomainDefFree(def); @@ -1915,7 +1915,7 @@ phypBuildVolume(virConnectPtr conn, const char *lvname, const char *spname, key = phypStorageVolGetKey(conn, lvname); -cleanup: + cleanup: VIR_FREE(ret); return key; @@ -2027,7 +2027,7 @@ phypStorageVolCreateXML(virStoragePoolPtr pool, return vol; -err: + err: VIR_FREE(key); virStorageVolDefFree(voldef); virStoragePoolDefFree(spdef); @@ -2103,7 +2103,7 @@ phypStorageVolLookupByPath(virConnectPtr conn, const char *volname) vol = virGetStorageVol(conn, ret, volname, key, NULL, NULL); -cleanup: + cleanup: VIR_FREE(ret); VIR_FREE(key); @@ -2145,7 +2145,7 @@ phypGetStoragePoolUUID(virConnectPtr conn, unsigned char *uuid, result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -2225,7 +2225,7 @@ phypStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) VIR_FREE(voldef.key); -cleanup: + cleanup: virObjectUnref(sp); return xml; } @@ -2278,7 +2278,7 @@ phypStorageVolGetPath(virStorageVolPtr vol) if (virAsprintf(&path, "/%s/%s/%s", pv, ret, vol->name) < 0) goto cleanup; -cleanup: + cleanup: VIR_FREE(ret); VIR_FREE(path); @@ -2339,7 +2339,7 @@ phypStoragePoolListVolumes(virStoragePoolPtr pool, char **const volumes, success = true; -cleanup: + cleanup: if (!success) { for (i = 0; i < got; i++) VIR_FREE(volumes[i]); @@ -2409,7 +2409,7 @@ phypStoragePoolDestroy(virStoragePoolPtr pool) result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -2455,7 +2455,7 @@ phypBuildStoragePool(virConnectPtr conn, virStoragePoolDefPtr def) result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -2538,7 +2538,7 @@ phypConnectListStoragePools(virConnectPtr conn, char **const pools, int npools) success = true; -cleanup: + cleanup: if (!success) { for (i = 0; i < got; i++) VIR_FREE(pools[i]); @@ -2593,7 +2593,7 @@ phypStoragePoolLookupByUUID(virConnectPtr conn, } } -err: + err: VIR_FREE(local_uuid); VIR_FREE(pools); return NULL; @@ -2634,7 +2634,7 @@ phypStoragePoolCreateXML(virConnectPtr conn, return sp; -err: + err: virStoragePoolDefFree(def); virObjectUnref(sp); return NULL; @@ -2681,7 +2681,7 @@ phypStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags) return virStoragePoolDefFormat(&def); -err: + err: return NULL; } @@ -2744,7 +2744,7 @@ phypInterfaceDestroy(virInterfacePtr iface, rv = 0; -cleanup: + cleanup: VIR_FREE(ret); return rv; } @@ -2854,7 +2854,7 @@ phypInterfaceDefineXML(virConnectPtr conn, const char *xml, result = virGetInterface(conn, name, mac); -cleanup: + cleanup: VIR_FREE(ret); virInterfaceDefFree(def); return result; @@ -2918,7 +2918,7 @@ phypInterfaceLookupByName(virConnectPtr conn, const char *name) result = virGetInterface(conn, name, ret); -cleanup: + cleanup: VIR_FREE(ret); return result; } @@ -2993,7 +2993,7 @@ phypConnectListInterfaces(virConnectPtr conn, char **const names, int nnames) } } -cleanup: + cleanup: if (!success) { for (i = 0; i < got; i++) VIR_FREE(names[i]); @@ -3054,7 +3054,7 @@ phypGetLparState(virConnectPtr conn, unsigned int lpar_id) else if (STREQ(ret, "Shutting Down")) state = VIR_DOMAIN_SHUTDOWN; -cleanup: + cleanup: VIR_FREE(ret); return state; } @@ -3091,7 +3091,7 @@ phypDiskType(virConnectPtr conn, char *backing_device) else if (STREQ(ret, "FBPOOL")) disk_type = VIR_DOMAIN_DISK_TYPE_FILE; -cleanup: + cleanup: VIR_FREE(ret); return disk_type; } @@ -3160,7 +3160,7 @@ phypConnectListDefinedDomains(virConnectPtr conn, char **const names, int nnames success = true; -cleanup: + cleanup: if (!success) { for (i = 0; i < got; i++) VIR_FREE(names[i]); @@ -3218,7 +3218,7 @@ phypDomainLookupByID(virConnectPtr conn, int lpar_id) if (dom) dom->id = lpar_id; -cleanup: + cleanup: VIR_FREE(lpar_name); return dom; @@ -3273,7 +3273,7 @@ phypDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) return virDomainDefFormat(&def, flags); -err: + err: return NULL; } @@ -3302,7 +3302,7 @@ phypDomainResume(virDomainPtr dom) result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -3337,7 +3337,7 @@ phypDomainReboot(virDomainPtr dom, unsigned int flags) result = 0; - cleanup: + cleanup: VIR_FREE(ret); return result; @@ -3368,7 +3368,7 @@ phypDomainShutdown(virDomainPtr dom) result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -3443,7 +3443,7 @@ phypDomainDestroyFlags(virDomainPtr dom, dom->id = -1; result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -3517,7 +3517,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def) result = 0; -cleanup: + cleanup: VIR_FREE(ret); return result; @@ -3572,7 +3572,7 @@ phypDomainCreateXML(virConnectPtr conn, return dom; -err: + err: virDomainDefFree(def); virObjectUnref(dom); return NULL; diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 4123e6e..a7dfdf0 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -207,7 +207,7 @@ replaceFile(const char *filename, void *data, size_t size) VIR_FREE(tmp_path); ret = 0; -cleanup: + cleanup: VIR_FORCE_CLOSE(fd); if (tmp_path != NULL) { unlink(tmp_path); @@ -276,7 +276,7 @@ secretSaveDef(virSecretDriverStatePtr driver, ret = 0; -cleanup: + cleanup: VIR_FREE(xml); VIR_FREE(filename); return ret; @@ -310,7 +310,7 @@ secretSaveValue(virSecretDriverStatePtr driver, ret = 0; -cleanup: + cleanup: VIR_FREE(base64); VIR_FREE(filename); return ret; @@ -338,7 +338,7 @@ secretDeleteSaved(virSecretDriverStatePtr driver, (void)unlink(value_filename); -cleanup: + cleanup: VIR_FREE(value_filename); VIR_FREE(xml_filename); return ret; @@ -416,7 +416,7 @@ secretLoadValue(virSecretDriverStatePtr driver, ret = 0; -cleanup: + cleanup: if (value != NULL) { memset(value, 0, value_size); VIR_FREE(value); @@ -460,7 +460,7 @@ secretLoad(virSecretDriverStatePtr driver, ret = secret; secret = NULL; -cleanup: + cleanup: secretFree(secret); virSecretDefFree(def); VIR_FREE(xml_filename); @@ -515,7 +515,7 @@ loadSecrets(virSecretDriverStatePtr driver, ret = 0; -cleanup: + cleanup: if (dir != NULL) closedir(dir); return ret; @@ -598,7 +598,7 @@ secretConnectListSecrets(virConnectPtr conn, char **uuids, int maxuuids) secretDriverUnlock(driver); return i; -cleanup: + cleanup: secretDriverUnlock(driver); for (i = 0; i < maxuuids; i++) @@ -738,7 +738,7 @@ secretLookupByUUID(virConnectPtr conn, const unsigned char *uuid) secret->def->usage_type, secretUsageIDForDef(secret->def)); -cleanup: + cleanup: secretDriverUnlock(driver); return ret; } @@ -768,7 +768,7 @@ secretLookupByUsage(virConnectPtr conn, int usageType, const char *usageID) secret->def->usage_type, secretUsageIDForDef(secret->def)); -cleanup: + cleanup: secretDriverUnlock(driver); return ret; } @@ -869,7 +869,7 @@ secretDefineXML(virConnectPtr conn, const char *xml, secretUsageIDForDef(secret->def)); goto cleanup; -restore_backup: + restore_backup: if (backup) { /* Error - restore previous state and free new attributes */ secret->def = backup; @@ -882,7 +882,7 @@ restore_backup: secretFree(secret); } -cleanup: + cleanup: virSecretDefFree(new_attrs); secretDriverUnlock(driver); @@ -914,7 +914,7 @@ secretGetXMLDesc(virSecretPtr obj, unsigned int flags) ret = virSecretDefFormat(secret->def); -cleanup: + cleanup: secretDriverUnlock(driver); return ret; @@ -969,13 +969,13 @@ secretSetValue(virSecretPtr obj, const unsigned char *value, ret = 0; goto cleanup; -restore_backup: + restore_backup: /* Error - restore previous state and free new value */ secret->value = old_value; secret->value_size = old_value_size; memset(new_value, 0, value_size); -cleanup: + cleanup: secretDriverUnlock(driver); VIR_FREE(new_value); @@ -1027,7 +1027,7 @@ secretGetValue(virSecretPtr obj, size_t *value_size, unsigned int flags, memcpy(ret, secret->value, secret->value_size); *value_size = secret->value_size; -cleanup: + cleanup: secretDriverUnlock(driver); return ret; @@ -1071,7 +1071,7 @@ secretUndefine(virSecretPtr obj) ret = 0; -cleanup: + cleanup: secretDriverUnlock(driver); return ret; diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index 6dca476..e969a69 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -106,7 +106,7 @@ profile_status(const char *str, const int check_enforcing) } VIR_FREE(content); - cleanup: + cleanup: VIR_FREE(tmp); VIR_FREE(etmp); @@ -153,7 +153,7 @@ profile_status_file(const char *str) else rc = 1; - failed: + failed: VIR_FREE(tmp); VIR_FREE(profile); VIR_FREE(content); @@ -199,7 +199,7 @@ load_profile(virSecurityManagerPtr mgr, virCommandSetInputBuffer(cmd, xml); rc = virCommandRun(cmd, NULL); -cleanup: + cleanup: VIR_FREE(xml); virCommandFree(cmd); @@ -259,7 +259,7 @@ use_apparmor(void) rc = profile_status(libvirt_daemon, 1); -cleanup: + cleanup: VIR_FREE(libvirt_daemon); return rc; } @@ -299,7 +299,7 @@ reload_profile(virSecurityManagerPtr mgr, } rc = 0; - cleanup: + cleanup: VIR_FREE(profile_name); return rc; @@ -369,7 +369,7 @@ AppArmorSecurityManagerProbe(const char *virtDriver ATTRIBUTE_UNUSED) } rc = SECURITY_DRIVER_ENABLE; - cleanup: + cleanup: VIR_FREE(template); return rc; @@ -461,12 +461,12 @@ AppArmorGenSecurityLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, rc = 0; goto cleanup; - err: + err: VIR_FREE(secdef->label); VIR_FREE(secdef->imagelabel); VIR_FREE(secdef->model); - cleanup: + cleanup: VIR_FREE(profile_name); return rc; @@ -521,7 +521,7 @@ AppArmorGetSecurityProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, } rc = 0; - cleanup: + cleanup: VIR_FREE(profile_name); return rc; @@ -608,7 +608,7 @@ AppArmorSetSecurityProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, } rc = 0; - cleanup: + cleanup: VIR_FREE(profile_name); return rc; @@ -654,7 +654,7 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, virCommandSetAppArmorProfile(cmd, profile_name); rc = 0; - cleanup: + cleanup: VIR_FREE(profile_name); VIR_FREE(cmd_str); return rc; @@ -741,7 +741,7 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, } rc = 0; - cleanup: + cleanup: VIR_FREE(profile_name); return rc; @@ -871,7 +871,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, break; } -done: + done: VIR_FREE(ptr); return ret; } diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 0bd36b7..b418ada 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -317,7 +317,7 @@ virSecurityDACRestoreSecurityFileLabel(const char *path) /* XXX record previous ownership */ rc = virSecurityDACSetOwnership(newpath, 0, 0); -err: + err: VIR_FREE(newpath); return rc; } @@ -559,7 +559,7 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr, break; } -done: + done: return ret; } @@ -677,7 +677,7 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr, break; } -done: + done: return ret; } @@ -724,7 +724,7 @@ virSecurityDACSetChardevLabel(virSecurityManagerPtr mgr, break; } -done: + done: VIR_FREE(in); VIR_FREE(out); return ret; @@ -763,7 +763,7 @@ virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, break; } -done: + done: VIR_FREE(in); VIR_FREE(out); return ret; diff --git a/src/security/security_manager.c b/src/security/security_manager.c index 795807a..a308dfc 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -534,7 +534,7 @@ int virSecurityManagerGenLabel(virSecurityManagerPtr mgr, ret = 0; -cleanup: + cleanup: virObjectUnlock(mgr); if (generated) virSecurityLabelDefFree(seclabel); diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index b5aec64..f9d1122 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -276,7 +276,7 @@ virSecuritySELinuxMCSGetProcessRange(char **sens, ret = 0; -cleanup: + cleanup: if (ret < 0) VIR_FREE(*sens); freecon(ourSecContext); @@ -316,7 +316,7 @@ virSecuritySELinuxContextAddRange(security_context_t src, ignore_value(VIR_STRDUP(ret, str)); -cleanup: + cleanup: if (srccon) context_free(srccon); if (dstcon) context_free(dstcon); return ret; @@ -387,7 +387,7 @@ virSecuritySELinuxGenNewContext(const char *basecontext, if (VIR_STRDUP(ret, str) < 0) goto cleanup; VIR_DEBUG("Generated context '%s'", ret); -cleanup: + cleanup: freecon(ourSecContext); context_free(ourContext); context_free(context); @@ -454,7 +454,7 @@ virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr) virConfFree(selinux_conf); return 0; -error: + error: # if HAVE_SELINUX_LABEL_H selabel_close(data->label_handle); data->label_handle = NULL; @@ -542,7 +542,7 @@ virSecuritySELinuxQEMUInitialize(virSecurityManagerPtr mgr) return 0; -error: + error: #if HAVE_SELINUX_LABEL_H selabel_close(data->label_handle); data->label_handle = NULL; @@ -702,7 +702,7 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr, rc = 0; -cleanup: + cleanup: if (rc != 0) { if (seclabel->type == VIR_DOMAIN_SECLABEL_DYNAMIC) VIR_FREE(seclabel->label); @@ -775,7 +775,7 @@ virSecuritySELinuxReserveSecurityLabel(virSecurityManagerPtr mgr, return 0; -error: + error: context_free(ctx); return -1; } @@ -1042,7 +1042,7 @@ virSecuritySELinuxRestoreSecurityFileLabel(virSecurityManagerPtr mgr, rc = virSecuritySELinuxSetFilecon(newpath, fcon); } -err: + err: freecon(fcon); VIR_FREE(newpath); return rc; @@ -1382,7 +1382,7 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def, break; } -done: + done: return ret; } @@ -1575,7 +1575,7 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virSecurityManagerPtr mgr, break; } -done: + done: return ret; } @@ -1720,7 +1720,7 @@ virSecuritySELinuxSetSecurityChardevLabel(virDomainDefPtr def, break; } -done: + done: VIR_FREE(in); VIR_FREE(out); return ret; @@ -1784,7 +1784,7 @@ virSecuritySELinuxRestoreSecurityChardevLabel(virSecurityManagerPtr mgr, break; } -done: + done: VIR_FREE(in); VIR_FREE(out); return ret; @@ -2122,7 +2122,7 @@ virSecuritySELinuxSetSecurityDaemonSocketLabel(virSecurityManagerPtr mgr ATTRIBU } rc = 0; -done: + done: if (security_getenforce() != 1) rc = 0; @@ -2165,7 +2165,7 @@ virSecuritySELinuxSetSecuritySocketLabel(virSecurityManagerPtr mgr ATTRIBUTE_UNU rc = 0; -done: + done: if (security_getenforce() != 1) rc = 0; @@ -2389,7 +2389,7 @@ virSecuritySELinuxSetTapFDLabel(virSecurityManagerPtr mgr, rc = virSecuritySELinuxFSetFilecon(fd, str); } -cleanup: + cleanup: freecon(fcon); VIR_FREE(str); return rc; @@ -2427,7 +2427,7 @@ virSecuritySELinuxGenImageLabel(virSecurityManagerPtr mgr, } } -cleanup: + cleanup: context_free(ctx); VIR_FREE(mcs); return label; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index ddfcb0a..ed8b4f2 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -246,7 +246,7 @@ parserCommand(const char *profile_name, const char cmd) result = 0; -cleanup: + cleanup: VIR_FREE(profile); return result; @@ -315,7 +315,7 @@ update_include_file(const char *include_file, const char *included_files, } rc = 0; - cleanup: + cleanup: VIR_FREE(pcontent); VIR_FREE(existing); @@ -448,15 +448,15 @@ create_profile(const char *profile, const char *profile_name, } rc = 0; - clean_all: + clean_all: VIR_FREE(pcontent); - clean_replace: + clean_replace: VIR_FREE(replace_name); VIR_FREE(replace_files); VIR_FREE(replace_driver); - clean_tcontent: + clean_tcontent: VIR_FREE(tcontent); - end: + end: VIR_FREE(template); return rc; } @@ -656,7 +656,7 @@ verify_xpath_context(xmlXPathContextPtr ctxt) rc = 0; - error: + error: return rc; } @@ -704,7 +704,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr) rc = 0; - cleanup: + cleanup: xmlFreeDoc(xml); xmlXPathFreeContext(ctxt); @@ -766,7 +766,7 @@ get_definition(vahControl * ctl, const char *xmlStr) rc = 0; - exit: + exit: return rc; } @@ -822,7 +822,7 @@ vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool recursi virBufferAsprintf(buf, " \"%s/\" r,\n", tmp); } - cleanup: + cleanup: VIR_FREE(tmp); return rc; @@ -875,7 +875,7 @@ vah_add_file_chardev(virBufferPtr buf, rc = 0; } - cleanup: + cleanup: return rc; } @@ -1109,7 +1109,7 @@ get_files(vahControl * ctl) rc = 0; ctl->files = virBufferContentAndReset(&buf); - cleanup: + cleanup: VIR_FREE(uuid); return rc; } diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index bf19ee7..464d56d 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -145,7 +145,7 @@ umlConnectTapDevice(virConnectPtr conn, VIR_FORCE_CLOSE(tapfd); return 0; -error: + error: VIR_FORCE_CLOSE(tapfd); return -1; } @@ -273,7 +273,7 @@ umlBuildCommandLineNet(virConnectPtr conn, return virBufferContentAndReset(&buf); -error: + error: virBufferFreeAndReset(&buf); return NULL; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 1ab79fc..69f6c11 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -242,7 +242,7 @@ umlIdentifyOneChrPTY(struct uml_driver *driver, int retries = 0; if (virAsprintf(&cmd, "config %s%d", dev, def->target.port) < 0) return -1; -requery: + requery: if (umlMonitorCommand(driver, dom, cmd, &res) < 0) return -1; @@ -309,7 +309,7 @@ umlInotifyEvent(int watch, if (watch != driver->inotifyWatch) goto cleanup; -reread: + reread: got = read(fd, buf, sizeof(buf)); if (got == -1) { if (errno == EINTR) @@ -414,7 +414,7 @@ reread: } } -cleanup: + cleanup: umlDriverUnlock(driver); } @@ -576,10 +576,10 @@ umlStateInitialize(bool privileged, virNWFilterRegisterCallbackDriver(¨CallbackDriver); return 0; -out_of_memory: + out_of_memory: VIR_ERROR(_("umlStartup: out of memory")); -error: + error: VIR_FREE(userdir); VIR_FREE(base); umlDriverUnlock(uml_driver); @@ -809,7 +809,7 @@ static int umlReadPidFile(struct uml_driver *driver, driver->monitorDir, vm->def->name) < 0) return -1; -reopen: + reopen: if (!(file = fopen(pidfile, "r"))) { if (errno == ENOENT && retries++ < 50) { @@ -873,7 +873,7 @@ static int umlOpenMonitor(struct uml_driver *driver, return -1; VIR_DEBUG("Dest address for monitor is '%s'", addr.sun_path); -restat: + restat: if (stat(addr.sun_path, &sb) < 0) { if (errno == ENOENT && retries++ < 50) { @@ -1005,7 +1005,7 @@ static int umlMonitorCommand(const struct uml_driver *driver, return ret; -error: + error: VIR_FREE(retdata); return -1; } @@ -1126,7 +1126,7 @@ static int umlStartVMDaemon(virConnectPtr conn, goto cleanup; ret = virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, false); -cleanup: + cleanup: VIR_FORCE_CLOSE(logfd); virCommandFree(cmd); @@ -1371,7 +1371,7 @@ static virDomainPtr umlDomainLookupByID(virConnectPtr conn, dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -1399,7 +1399,7 @@ static virDomainPtr umlDomainLookupByUUID(virConnectPtr conn, dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -1427,7 +1427,7 @@ static virDomainPtr umlDomainLookupByName(virConnectPtr conn, dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -1453,7 +1453,7 @@ static int umlDomainIsActive(virDomainPtr dom) ret = virDomainObjIsActive(obj); -cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -1479,7 +1479,7 @@ static int umlDomainIsPersistent(virDomainPtr dom) ret = obj->persistent; -cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -1504,7 +1504,7 @@ static int umlDomainIsUpdated(virDomainPtr dom) ret = obj->updated; -cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -1534,7 +1534,7 @@ static int umlConnectGetVersion(virConnectPtr conn, unsigned long *version) *version = driver->umlVersion; ret = 0; -cleanup: + cleanup: umlDriverUnlock(driver); return ret; } @@ -1623,7 +1623,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml, dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virDomainDefFree(def); if (vm) virObjectUnlock(vm); @@ -1666,7 +1666,7 @@ static int umlDomainShutdownFlags(virDomainPtr dom, ret = 0; #endif -cleanup: + cleanup: VIR_FREE(info); if (vm) virObjectUnlock(vm); @@ -1713,7 +1713,7 @@ umlDomainDestroyFlags(virDomainPtr dom, } ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); if (event) @@ -1749,7 +1749,7 @@ static char *umlDomainGetOSType(virDomainPtr dom) { if (VIR_STRDUP(type, vm->def->os.type) < 0) goto cleanup; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return type; @@ -1781,7 +1781,7 @@ umlDomainGetMaxMemory(virDomainPtr dom) ret = vm->def->mem.max_balloon; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1818,7 +1818,7 @@ static int umlDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) vm->def->mem.max_balloon = newmax; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1861,7 +1861,7 @@ static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem) vm->def->mem.cur_balloon = newmem; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1904,7 +1904,7 @@ static int umlDomainGetInfo(virDomainPtr dom, info->nrVirtCpu = vm->def->vcpus; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1939,7 +1939,7 @@ umlDomainGetState(virDomainPtr dom, *state = virDomainObjGetState(vm, reason); ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1972,7 +1972,7 @@ static char *umlDomainGetXMLDesc(virDomainPtr dom, vm->newDef : vm->def, flags); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -2042,7 +2042,7 @@ static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); if (event) @@ -2091,7 +2091,7 @@ static virDomainPtr umlDomainDefineXML(virConnectPtr conn, const char *xml) dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virDomainDefFree(def); if (vm) virObjectUnlock(vm); @@ -2137,7 +2137,7 @@ static int umlDomainUndefineFlags(virDomainPtr dom, ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); umlDriverUnlock(driver); @@ -2189,7 +2189,7 @@ static int umlDomainAttachUmlDisk(struct uml_driver *driver, return 0; -error: + error: VIR_FREE(reply); VIR_FREE(cmd); @@ -2248,7 +2248,7 @@ static int umlDomainAttachDevice(virDomainPtr dom, const char *xml) goto cleanup; } -cleanup: + cleanup: virDomainDeviceDefFree(dev); if (vm) @@ -2313,7 +2313,7 @@ static int umlDomainDetachUmlDisk(struct uml_driver *driver, VIR_FREE(reply); -cleanup: + cleanup: VIR_FREE(cmd); return ret; @@ -2364,7 +2364,7 @@ static int umlDomainDetachDevice(virDomainPtr dom, const char *xml) "%s", _("This type of device cannot be hot unplugged")); } -cleanup: + cleanup: virDomainDeviceDefFree(dev); if (vm) virObjectUnlock(vm); @@ -2412,7 +2412,7 @@ static int umlDomainGetAutostart(virDomainPtr dom, *autostart = vm->autostart; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); umlDriverUnlock(driver); @@ -2480,7 +2480,7 @@ static int umlDomainSetAutostart(virDomainPtr dom, } ret = 0; -cleanup: + cleanup: VIR_FREE(configFile); VIR_FREE(autostartLink); if (vm) @@ -2552,7 +2552,7 @@ umlDomainBlockPeek(virDomainPtr dom, ret = 0; -cleanup: + cleanup: VIR_FORCE_CLOSE(fd); if (vm) virObjectUnlock(vm); @@ -2626,7 +2626,7 @@ umlDomainOpenConsole(virDomainPtr dom, goto cleanup; ret = 0; -cleanup: + cleanup: if (vm) virObjectUnlock(vm); umlDriverUnlock(driver); diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 2de24a7..118c7c3 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -116,13 +116,13 @@ vmwareCapsInit(void) goto error; } -cleanup: + cleanup: virCPUDefFree(cpu); cpuDataFree(data); return caps; -error: + error: virObjectUnref(caps); goto cleanup; } @@ -194,7 +194,7 @@ vmwareLoadDomains(struct vmware_driver *driver) ret = 0; -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(outbuf); virDomainDefFree(vmdef); @@ -303,7 +303,7 @@ vmwareExtractVersion(struct vmware_driver *driver) ret = 0; -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(outbuf); VIR_FREE(bin); @@ -361,7 +361,7 @@ vmwareParsePath(const char *path, char **directory, char **filename) return 0; -error: + error: return -1; } @@ -443,7 +443,7 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath) ret = 0; - cleanup: + cleanup: VIR_FREE(directoryName); VIR_FREE(fileName); return ret; @@ -525,7 +525,7 @@ vmwareExtractPid(const char * vmxPath) goto cleanup; } -cleanup: + cleanup: VIR_FREE(vmxDir); VIR_FREE(logFilePath); VIR_FORCE_FCLOSE(logFile); diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 0e7a37f..6edc0bc 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -185,7 +185,7 @@ vmwareConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_SUCCESS; - cleanup: + cleanup: vmwareFreeDriver(driver); return VIR_DRV_OPEN_ERROR; }; @@ -271,7 +271,7 @@ vmwareUpdateVMStatus(struct vmware_driver *driver, virDomainObjPtr vm) ret = 0; -cleanup: + cleanup: virCommandFree(cmd); VIR_FREE(outbuf); VIR_FREE(vmxAbsolutePath); @@ -395,7 +395,7 @@ vmwareDomainDefineXML(virConnectPtr conn, const char *xml) if (dom) dom->id = -1; - cleanup: + cleanup: virDomainDefFree(vmdef); VIR_FREE(vmx); VIR_FREE(directoryName); @@ -445,7 +445,7 @@ vmwareDomainShutdownFlags(virDomainPtr dom, } ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); vmwareDriverUnlock(driver); @@ -514,7 +514,7 @@ vmwareDomainSuspend(virDomainPtr dom) virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER); ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -563,7 +563,7 @@ vmwareDomainResume(virDomainPtr dom) virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED); ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -611,7 +611,7 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags) ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -681,7 +681,7 @@ vmwareDomainCreateXML(virConnectPtr conn, const char *xml, if (dom) dom->id = vm->def->id; -cleanup: + cleanup: virDomainDefFree(vmdef); VIR_FREE(vmx); VIR_FREE(vmxPath); @@ -722,7 +722,7 @@ vmwareDomainCreateWithFlags(virDomainPtr dom, ret = vmwareStartVM(driver, vm); -cleanup: + cleanup: if (vm) virObjectUnlock(vm); vmwareDriverUnlock(driver); @@ -775,7 +775,7 @@ vmwareDomainUndefineFlags(virDomainPtr dom, ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); vmwareDriverUnlock(driver); @@ -808,7 +808,7 @@ vmwareDomainLookupByID(virConnectPtr conn, int id) if (dom) dom->id = vm->def->id; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -832,7 +832,7 @@ vmwareDomainGetOSType(virDomainPtr dom) ignore_value(VIR_STRDUP(ret, vm->def->os.type)); - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -859,7 +859,7 @@ vmwareDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) if (dom) dom->id = vm->def->id; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -885,7 +885,7 @@ vmwareDomainLookupByName(virConnectPtr conn, const char *name) if (dom) dom->id = vm->def->id; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return dom; @@ -907,7 +907,7 @@ vmwareDomainIsActive(virDomainPtr dom) } ret = virDomainObjIsActive(obj); - cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -930,7 +930,7 @@ vmwareDomainIsPersistent(virDomainPtr dom) } ret = obj->persistent; - cleanup: + cleanup: if (obj) virObjectUnlock(obj); return ret; @@ -958,7 +958,7 @@ vmwareDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) ret = virDomainDefFormat(vm->def, flags); - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1094,7 +1094,7 @@ vmwareDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) info->nrVirtCpu = vm->def->vcpus; ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; @@ -1128,7 +1128,7 @@ vmwareDomainGetState(virDomainPtr dom, *state = virDomainObjGetState(vm, reason); ret = 0; - cleanup: + cleanup: if (vm) virObjectUnlock(vm); return ret; diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 9b5162b..272d873 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("vmx.vmx"); /* -mapping: + mapping: domain-xml <=> vmx @@ -637,7 +637,7 @@ virVMXConvertToUTF8(const char *encoding, const char *string) result = (char *)utf8->content; utf8->content = NULL; - cleanup: + cleanup: xmlCharEncCloseFunc(handler); xmlBufferFree(input); xmlBufferFree(utf8); @@ -1209,7 +1209,7 @@ virVMXGatherSCSIControllers(virVMXContext *ctx, virDomainDefPtr def, result = 0; - cleanup: + cleanup: VIR_FREE(autodetectedModels); return result; @@ -1778,7 +1778,7 @@ virVMXParseConfig(virVMXContext *ctx, success = true; - cleanup: + cleanup: if (! success) { virDomainDefFree(def); def = NULL; @@ -1855,7 +1855,7 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def) return 0; - failure: + failure: VIR_FREE(listenAddr); virDomainGraphicsDefFree(*def); *def = NULL; @@ -1929,7 +1929,7 @@ virVMXParseSCSIController(virConfPtr conf, int controller, bool *present, result = 0; - cleanup: + cleanup: VIR_FREE(virtualDev_string); return result; @@ -2313,7 +2313,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con result = 0; - cleanup: + cleanup: if (result < 0) { virDomainDiskDefFree(*def); *def = NULL; @@ -2327,7 +2327,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con return result; - ignore: + ignore: virDomainDiskDefFree(*def); *def = NULL; @@ -2416,7 +2416,7 @@ int virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def) result = 0; - cleanup: + cleanup: if (result < 0) { virDomainFSDefFree(*def); *def = NULL; @@ -2427,7 +2427,7 @@ int virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def) return result; - ignore: + ignore: virDomainFSDefFree(*def); *def = NULL; @@ -2641,7 +2641,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def) result = 0; - cleanup: + cleanup: if (result < 0) { virDomainNetDefFree(*def); *def = NULL; @@ -2657,7 +2657,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def) return result; - ignore: + ignore: virDomainNetDefFree(*def); *def = NULL; @@ -2838,7 +2838,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, result = 0; - cleanup: + cleanup: if (result < 0) { virDomainChrDefFree(*def); *def = NULL; @@ -2851,7 +2851,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, return result; - ignore: + ignore: virDomainChrDefFree(*def); *def = NULL; @@ -2955,7 +2955,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port, result = 0; - cleanup: + cleanup: if (result < 0) { virDomainChrDefFree(*def); *def = NULL; @@ -2966,7 +2966,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port, return result; - ignore: + ignore: virDomainChrDefFree(*def); *def = NULL; @@ -3003,7 +3003,7 @@ virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def) result = 0; - cleanup: + cleanup: if (result < 0) { virDomainVideoDefFree(*def); *def = NULL; @@ -3350,7 +3350,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe vmx = virBufferContentAndReset(&buffer); - cleanup: + cleanup: if (vmx == NULL) { virBufferFreeAndReset(&buffer); } diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 6d3288d..908448b 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -94,7 +94,7 @@ getCapsObject(void) return caps; - error_cleanup: + error_cleanup: virObjectUnref(caps); return NULL; } @@ -208,7 +208,7 @@ xenapiConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, NULL); - error: + error: VIR_FREE(username); VIR_FREE(password); @@ -441,7 +441,7 @@ xenapiConnectGetCapabilities(virConnectPtr conn) goto cleanup; return xml; } - cleanup: + cleanup: xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, _("Capabilities not available")); return NULL; @@ -955,7 +955,7 @@ xenapiDomainGetOSType(virDomainPtr dom) } else xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL); - cleanup: + cleanup: if (vms) xen_vm_set_free(vms); return ostype; @@ -1115,7 +1115,7 @@ xenapiDomainGetState(virDomainPtr dom, ret = 0; -cleanup: + cleanup: if (vms) xen_vm_set_free(vms); return ret; @@ -1545,7 +1545,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) virDomainDefFree(defPtr); return xml; - error: + error: xen_vm_set_free(vms); virDomainDefFree(defPtr); return NULL; diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index 5a5025a..c9a62d9 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -114,11 +114,11 @@ xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify) } } - cleanup: + cleanup: return result; - failure: + failure: result = -1; goto cleanup; @@ -357,7 +357,7 @@ allocStringMap(xen_string_string_map **strings, char *key, char *val) VIR_STRDUP((*strings)->contents[sz-1].val, val) < 0) goto error; return 0; - error: + error: xen_string_string_map_free(*strings); return -1; } @@ -559,7 +559,7 @@ createVMRecordFromXml(virConnectPtr conn, virDomainDefPtr def, } return 0; - error: + error: xen_vm_record_free(*record); return -1; } diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index e03e254..1165b98 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -167,7 +167,7 @@ xenParseSxprOS(const struct sexpr *node, return 0; -error: + error: return -1; } @@ -312,7 +312,7 @@ xenParseSxprChar(const char *value, return def; -error: + error: virDomainChrDefFree(def); return NULL; } @@ -516,7 +516,7 @@ xenParseSxprDisks(virDomainDefPtr def, return 0; -error: + error: virDomainDiskDefFree(disk); return -1; } @@ -611,7 +611,7 @@ xenParseSxprNets(virDomainDefPtr def, return 0; -cleanup: + cleanup: virDomainNetDefFree(net); return -1; } @@ -696,7 +696,7 @@ xenParseSxprSound(virDomainDefPtr def, return 0; -error: + error: return -1; } @@ -748,7 +748,7 @@ xenParseSxprUSB(virDomainDefPtr def, } return 0; -error: + error: return -1; } @@ -841,7 +841,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def, return 0; -error: + error: virDomainGraphicsDefFree(graphics); return -1; } @@ -943,7 +943,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def, return 0; -error: + error: virDomainGraphicsDefFree(graphics); return -1; } @@ -1062,7 +1062,7 @@ xenParseSxprPCI(virDomainDefPtr def, return 0; -error: + error: virDomainHostdevDefFree(dev); return -1; } @@ -1457,7 +1457,7 @@ xenParseSxpr(const struct sexpr *root, return def; -error: + error: VIR_FREE(tty); virDomainDefFree(def); return NULL; @@ -2560,7 +2560,7 @@ xenFormatSxpr(virConnectPtr conn, VIR_DEBUG("Formatted sexpr: \n%s", bufout); return bufout; -error: + error: virBufferFreeAndReset(&buf); return NULL; } diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index d83772c..9e4050d 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -1138,7 +1138,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, VIR_FREE(script); return def; -cleanup: + cleanup: virDomainGraphicsDefFree(graphics); virDomainNetDefFree(net); virDomainDiskDefFree(disk); @@ -1269,7 +1269,7 @@ xenFormatXMDisk(virConfValuePtr list, return 0; -cleanup: + cleanup: virBufferFreeAndReset(&buf); return -1; } @@ -1308,7 +1308,7 @@ static int xenFormatXMSerial(virConfValuePtr list, return 0; -cleanup: + cleanup: virBufferFreeAndReset(&buf); return -1; } @@ -1414,7 +1414,7 @@ static int xenFormatXMNet(virConnectPtr conn, return 0; -cleanup: + cleanup: virBufferFreeAndReset(&buf); return -1; } @@ -1483,7 +1483,7 @@ xenFormatXMPCI(virConfPtr conf, return 0; -error: + error: virConfFreeValue(pciVal); return -1; } @@ -2016,7 +2016,7 @@ virConfPtr xenFormatXM(virConnectPtr conn, return conf; -cleanup: + cleanup: virConfFreeValue(diskVal); virConfFreeValue(netVal); VIR_FREE(cpus); -- 1.8.3.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list