提交 34ff191c 编写于 作者: J Ján Tomko

Indent top-level labels by one space in src/parallels/

上级 5d831597
...@@ -148,7 +148,7 @@ parallelsBuildCapabilities(void) ...@@ -148,7 +148,7 @@ parallelsBuildCapabilities(void)
return caps; return caps;
error: error:
virObjectUnref(caps); virObjectUnref(caps);
return NULL; return NULL;
} }
...@@ -239,7 +239,7 @@ parallelsAddSerialInfo(virDomainChrDefPtr **serials, size_t *nserials, ...@@ -239,7 +239,7 @@ parallelsAddSerialInfo(virDomainChrDefPtr **serials, size_t *nserials,
return 0; return 0;
cleanup: cleanup:
virDomainChrDefFree(chr); virDomainChrDefFree(chr);
return -1; return -1;
} }
...@@ -284,7 +284,7 @@ parallelsAddVideoInfo(virDomainDefPtr def, virJSONValuePtr value) ...@@ -284,7 +284,7 @@ parallelsAddVideoInfo(virDomainDefPtr def, virJSONValuePtr value)
return 0; return 0;
error: error:
VIR_FREE(accel); VIR_FREE(accel);
virDomainVideoDefFree(video); virDomainVideoDefFree(video);
return -1; return -1;
...@@ -390,7 +390,7 @@ parallelsAddHddInfo(virDomainDefPtr def, const char *key, virJSONValuePtr value) ...@@ -390,7 +390,7 @@ parallelsAddHddInfo(virDomainDefPtr def, const char *key, virJSONValuePtr value)
return 0; return 0;
error: error:
virDomainDiskDefFree(disk); virDomainDiskDefFree(disk);
return -1; return -1;
} }
...@@ -422,7 +422,7 @@ parallelsMacAddrParse(const char *str, virMacAddrPtr addr) ...@@ -422,7 +422,7 @@ parallelsMacAddrParse(const char *str, virMacAddrPtr addr)
} }
return 0; return 0;
error: error:
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
_("Invalid MAC address format '%s'"), str); _("Invalid MAC address format '%s'"), str);
return -1; return -1;
...@@ -488,7 +488,7 @@ parallelsGetNetInfo(virDomainNetDefPtr net, ...@@ -488,7 +488,7 @@ parallelsGetNetInfo(virDomainNetDefPtr net,
return 0; return 0;
error: error:
return -1; return -1;
} }
...@@ -510,7 +510,7 @@ parallelsAddNetInfo(virDomainDefPtr def, const char *key, virJSONValuePtr value) ...@@ -510,7 +510,7 @@ parallelsAddNetInfo(virDomainDefPtr def, const char *key, virJSONValuePtr value)
return 0; return 0;
error: error:
virDomainNetDefFree(net); virDomainNetDefFree(net);
return -1; return -1;
} }
...@@ -554,7 +554,7 @@ parallelsAddDomainHardware(virDomainDefPtr def, virJSONValuePtr jobj) ...@@ -554,7 +554,7 @@ parallelsAddDomainHardware(virDomainDefPtr def, virJSONValuePtr jobj)
return 0; return 0;
cleanup: cleanup:
return -1; return -1;
} }
...@@ -627,7 +627,7 @@ parallelsAddVNCInfo(virDomainDefPtr def, virJSONValuePtr jobj_root) ...@@ -627,7 +627,7 @@ parallelsAddVNCInfo(virDomainDefPtr def, virJSONValuePtr jobj_root)
return 0; return 0;
cleanup: cleanup:
virDomainGraphicsDefFree(gr); virDomainGraphicsDefFree(gr);
return ret; return ret;
} }
...@@ -818,7 +818,7 @@ parallelsLoadDomain(parallelsConnPtr privconn, virJSONValuePtr jobj) ...@@ -818,7 +818,7 @@ parallelsLoadDomain(parallelsConnPtr privconn, virJSONValuePtr jobj)
return dom; return dom;
cleanup: cleanup:
virDomainDefFree(def); virDomainDefFree(def);
parallelsDomObjFreePrivate(pdom); parallelsDomObjFreePrivate(pdom);
return NULL; return NULL;
...@@ -867,7 +867,7 @@ parallelsLoadDomains(parallelsConnPtr privconn, const char *domain_name) ...@@ -867,7 +867,7 @@ parallelsLoadDomains(parallelsConnPtr privconn, const char *domain_name)
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(jobj); virJSONValueFree(jobj);
return ret; return ret;
} }
...@@ -908,7 +908,7 @@ parallelsOpenDefault(virConnectPtr conn) ...@@ -908,7 +908,7 @@ parallelsOpenDefault(virConnectPtr conn)
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
error: error:
virObjectUnref(privconn->domains); virObjectUnref(privconn->domains);
virObjectUnref(privconn->caps); virObjectUnref(privconn->caps);
virStoragePoolObjListFree(&privconn->pools); virStoragePoolObjListFree(&privconn->pools);
...@@ -1008,7 +1008,7 @@ parallelsConnectGetVersion(virConnectPtr conn ATTRIBUTE_UNUSED, unsigned long *h ...@@ -1008,7 +1008,7 @@ parallelsConnectGetVersion(virConnectPtr conn ATTRIBUTE_UNUSED, unsigned long *h
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(output); VIR_FREE(output);
return ret; return ret;
} }
...@@ -1114,7 +1114,7 @@ parallelsDomainLookupByID(virConnectPtr conn, int id) ...@@ -1114,7 +1114,7 @@ parallelsDomainLookupByID(virConnectPtr conn, int id)
if (ret) if (ret)
ret->id = dom->def->id; ret->id = dom->def->id;
cleanup: cleanup:
if (dom) if (dom)
virObjectUnlock(dom); virObjectUnlock(dom);
return ret; return ret;
...@@ -1143,7 +1143,7 @@ parallelsDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) ...@@ -1143,7 +1143,7 @@ parallelsDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
if (ret) if (ret)
ret->id = dom->def->id; ret->id = dom->def->id;
cleanup: cleanup:
if (dom) if (dom)
virObjectUnlock(dom); virObjectUnlock(dom);
return ret; return ret;
...@@ -1170,7 +1170,7 @@ parallelsDomainLookupByName(virConnectPtr conn, const char *name) ...@@ -1170,7 +1170,7 @@ parallelsDomainLookupByName(virConnectPtr conn, const char *name)
if (ret) if (ret)
ret->id = dom->def->id; ret->id = dom->def->id;
cleanup: cleanup:
if (dom) if (dom)
virObjectUnlock(dom); virObjectUnlock(dom);
return ret; return ret;
...@@ -1199,7 +1199,7 @@ parallelsDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) ...@@ -1199,7 +1199,7 @@ parallelsDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
info->cpuTime = 0; info->cpuTime = 0;
ret = 0; ret = 0;
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
return ret; return ret;
...@@ -1222,7 +1222,7 @@ parallelsDomainGetOSType(virDomainPtr domain) ...@@ -1222,7 +1222,7 @@ parallelsDomainGetOSType(virDomainPtr domain)
ignore_value(VIR_STRDUP(ret, privdom->def->os.type)); ignore_value(VIR_STRDUP(ret, privdom->def->os.type));
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -1245,7 +1245,7 @@ parallelsDomainIsPersistent(virDomainPtr domain) ...@@ -1245,7 +1245,7 @@ parallelsDomainIsPersistent(virDomainPtr domain)
ret = 1; ret = 1;
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -1273,7 +1273,7 @@ parallelsDomainGetState(virDomainPtr domain, ...@@ -1273,7 +1273,7 @@ parallelsDomainGetState(virDomainPtr domain,
*state = virDomainObjGetState(privdom, reason); *state = virDomainObjGetState(privdom, reason);
ret = 0; ret = 0;
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
return ret; return ret;
...@@ -1303,7 +1303,7 @@ parallelsDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) ...@@ -1303,7 +1303,7 @@ parallelsDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
ret = virDomainDefFormat(def, flags); ret = virDomainDefFormat(def, flags);
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
return ret; return ret;
...@@ -1328,7 +1328,7 @@ parallelsDomainGetAutostart(virDomainPtr domain, int *autostart) ...@@ -1328,7 +1328,7 @@ parallelsDomainGetAutostart(virDomainPtr domain, int *autostart)
*autostart = privdom->autostart; *autostart = privdom->autostart;
ret = 0; ret = 0;
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
return ret; return ret;
...@@ -1371,7 +1371,7 @@ parallelsDomainChangeState(virDomainPtr domain, ...@@ -1371,7 +1371,7 @@ parallelsDomainChangeState(virDomainPtr domain,
ret = 0; ret = 0;
cleanup: cleanup:
if (privdom) if (privdom)
virObjectUnlock(privdom); virObjectUnlock(privdom);
...@@ -1490,7 +1490,7 @@ parallelsApplyGraphicsParams(virDomainGraphicsDefPtr *oldgraphics, int nold, ...@@ -1490,7 +1490,7 @@ parallelsApplyGraphicsParams(virDomainGraphicsDefPtr *oldgraphics, int nold,
} }
return 0; return 0;
error: error:
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("changing display parameters is not supported " _("changing display parameters is not supported "
"by parallels driver")); "by parallels driver"));
...@@ -1538,7 +1538,7 @@ parallelsApplySerialParams(virDomainChrDefPtr *oldserials, int nold, ...@@ -1538,7 +1538,7 @@ parallelsApplySerialParams(virDomainChrDefPtr *oldserials, int nold,
} }
return 0; return 0;
error: error:
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("changing serial device parameters is " _("changing serial device parameters is "
"not supported by parallels driver")); "not supported by parallels driver"));
...@@ -1634,7 +1634,7 @@ static int parallelsAddHddByVolume(parallelsDomObjPtr pdom, ...@@ -1634,7 +1634,7 @@ static int parallelsAddHddByVolume(parallelsDomObjPtr pdom,
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
...@@ -1674,7 +1674,7 @@ static int parallelsAddHdd(virConnectPtr conn, ...@@ -1674,7 +1674,7 @@ static int parallelsAddHdd(virConnectPtr conn,
ret = parallelsAddHddByVolume(pdom, disk, pool, voldef); ret = parallelsAddHddByVolume(pdom, disk, pool, voldef);
cleanup: cleanup:
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
virObjectUnref(vol); virObjectUnref(vol);
...@@ -1895,7 +1895,7 @@ static int parallelsApplyIfaceParams(parallelsDomObjPtr pdom, ...@@ -1895,7 +1895,7 @@ static int parallelsApplyIfaceParams(parallelsDomObjPtr pdom,
ret = 0; ret = 0;
cleanup: cleanup:
if (create) if (create)
VIR_FREE(oldnet); VIR_FREE(oldnet);
virCommandFree(cmd); virCommandFree(cmd);
...@@ -2262,9 +2262,9 @@ parallelsCreateVm(virConnectPtr conn, virDomainDefPtr def) ...@@ -2262,9 +2262,9 @@ parallelsCreateVm(virConnectPtr conn, virDomainDefPtr def)
return 0; return 0;
error2: error2:
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
error: error:
virObjectUnref(vol); virObjectUnref(vol);
return -1; return -1;
} }
...@@ -2295,7 +2295,7 @@ parallelsCreateCt(virConnectPtr conn ATTRIBUTE_UNUSED, virDomainDefPtr def) ...@@ -2295,7 +2295,7 @@ parallelsCreateCt(virConnectPtr conn ATTRIBUTE_UNUSED, virDomainDefPtr def)
return 0; return 0;
error: error:
return -1; return -1;
} }
...@@ -2361,7 +2361,7 @@ parallelsDomainDefineXML(virConnectPtr conn, const char *xml) ...@@ -2361,7 +2361,7 @@ parallelsDomainDefineXML(virConnectPtr conn, const char *xml)
if (ret) if (ret)
ret->id = dom->def->id; ret->id = dom->def->id;
cleanup: cleanup:
virDomainDefFree(def); virDomainDefFree(def);
if (dom) if (dom)
virObjectUnlock(dom); virObjectUnlock(dom);
......
...@@ -94,7 +94,7 @@ static int parallelsGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj ...@@ -94,7 +94,7 @@ static int parallelsGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(bridgeLink); VIR_FREE(bridgeLink);
VIR_FREE(bridgePath); VIR_FREE(bridgePath);
VIR_FREE(bridgeAddress); VIR_FREE(bridgeAddress);
...@@ -175,7 +175,7 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name) ...@@ -175,7 +175,7 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(jobj); virJSONValueFree(jobj);
return ret; return ret;
} }
...@@ -236,7 +236,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj) ...@@ -236,7 +236,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
virNetworkObjUnlock(net); virNetworkObjUnlock(net);
return net; return net;
cleanup: cleanup:
virNetworkDefFree(def); virNetworkDefFree(def);
return NULL; return NULL;
} }
...@@ -273,7 +273,7 @@ parallelsAddRoutedNetwork(parallelsConnPtr privconn) ...@@ -273,7 +273,7 @@ parallelsAddRoutedNetwork(parallelsConnPtr privconn)
return net; return net;
cleanup: cleanup:
virNetworkDefFree(def); virNetworkDefFree(def);
return NULL; return NULL;
} }
...@@ -317,7 +317,7 @@ static int parallelsLoadNetworks(parallelsConnPtr privconn) ...@@ -317,7 +317,7 @@ static int parallelsLoadNetworks(parallelsConnPtr privconn)
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(jobj); virJSONValueFree(jobj);
return ret; return ret;
} }
...@@ -480,7 +480,7 @@ static virNetworkPtr parallelsNetworkLookupByUUID(virConnectPtr conn, ...@@ -480,7 +480,7 @@ static virNetworkPtr parallelsNetworkLookupByUUID(virConnectPtr conn,
ret = virGetNetwork(conn, network->def->name, network->def->uuid); ret = virGetNetwork(conn, network->def->name, network->def->uuid);
cleanup: cleanup:
if (network) if (network)
virNetworkObjUnlock(network); virNetworkObjUnlock(network);
return ret; return ret;
...@@ -504,7 +504,7 @@ static virNetworkPtr parallelsNetworkLookupByName(virConnectPtr conn, ...@@ -504,7 +504,7 @@ static virNetworkPtr parallelsNetworkLookupByName(virConnectPtr conn,
ret = virGetNetwork(conn, network->def->name, network->def->uuid); ret = virGetNetwork(conn, network->def->name, network->def->uuid);
cleanup: cleanup:
if (network) if (network)
virNetworkObjUnlock(network); virNetworkObjUnlock(network);
return ret; return ret;
...@@ -531,7 +531,7 @@ static char *parallelsNetworkGetXMLDesc(virNetworkPtr net, ...@@ -531,7 +531,7 @@ static char *parallelsNetworkGetXMLDesc(virNetworkPtr net,
ret = virNetworkDefFormat(network->def, flags); ret = virNetworkDefFormat(network->def, flags);
cleanup: cleanup:
if (network) if (network)
virNetworkObjUnlock(network); virNetworkObjUnlock(network);
return ret; return ret;
...@@ -552,7 +552,7 @@ static int parallelsNetworkIsActive(virNetworkPtr net) ...@@ -552,7 +552,7 @@ static int parallelsNetworkIsActive(virNetworkPtr net)
} }
ret = virNetworkObjIsActive(obj); ret = virNetworkObjIsActive(obj);
cleanup: cleanup:
if (obj) if (obj)
virNetworkObjUnlock(obj); virNetworkObjUnlock(obj);
return ret; return ret;
...@@ -573,7 +573,7 @@ static int parallelsNetworkIsPersistent(virNetworkPtr net) ...@@ -573,7 +573,7 @@ static int parallelsNetworkIsPersistent(virNetworkPtr net)
} }
ret = obj->persistent; ret = obj->persistent;
cleanup: cleanup:
if (obj) if (obj)
virNetworkObjUnlock(obj); virNetworkObjUnlock(obj);
return ret; return ret;
...@@ -598,7 +598,7 @@ static int parallelsNetworkGetAutostart(virNetworkPtr net, ...@@ -598,7 +598,7 @@ static int parallelsNetworkGetAutostart(virNetworkPtr net,
*autostart = network->autostart; *autostart = network->autostart;
ret = 0; ret = 0;
cleanup: cleanup:
if (network) if (network)
virNetworkObjUnlock(network); virNetworkObjUnlock(network);
return ret; return ret;
......
...@@ -115,7 +115,7 @@ parallelsFindVolumes(virStoragePoolObjPtr pool) ...@@ -115,7 +115,7 @@ parallelsFindVolumes(virStoragePoolObjPtr pool)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
closedir(dir); closedir(dir);
return ret; return ret;
...@@ -194,7 +194,7 @@ parallelsPoolCreateByPath(virConnectPtr conn, const char *path) ...@@ -194,7 +194,7 @@ parallelsPoolCreateByPath(virConnectPtr conn, const char *path)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
return pool; return pool;
error: error:
virStoragePoolDefFree(def); virStoragePoolDefFree(def);
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
...@@ -267,7 +267,7 @@ static int parallelsDiskDescParseNode(xmlDocPtr xml, ...@@ -267,7 +267,7 @@ static int parallelsDiskDescParseNode(xmlDocPtr xml,
def->capacity <<= 9; def->capacity <<= 9;
def->allocation = def->capacity; def->allocation = def->capacity;
ret = 0; ret = 0;
cleanup: cleanup:
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
return ret; return ret;
...@@ -315,9 +315,9 @@ static int parallelsAddDiskVolume(virStoragePoolObjPtr pool, ...@@ -315,9 +315,9 @@ static int parallelsAddDiskVolume(virStoragePoolObjPtr pool,
goto error; goto error;
return 0; return 0;
no_memory: no_memory:
virReportOOMError(); virReportOOMError();
error: error:
virStorageVolDefFree(def); virStorageVolDefFree(def);
return -1; return -1;
} }
...@@ -372,7 +372,7 @@ static int parallelsFindVmVolumes(virStoragePoolObjPtr pool, ...@@ -372,7 +372,7 @@ static int parallelsFindVmVolumes(virStoragePoolObjPtr pool,
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(diskPath); VIR_FREE(diskPath);
VIR_FREE(diskDescPath); VIR_FREE(diskDescPath);
closedir(dir); closedir(dir);
...@@ -446,7 +446,7 @@ static int parallelsLoadPools(virConnectPtr conn) ...@@ -446,7 +446,7 @@ static int parallelsLoadPools(virConnectPtr conn)
return 0; return 0;
error: error:
VIR_FREE(base); VIR_FREE(base);
return -1; return -1;
} }
...@@ -480,7 +480,7 @@ parallelsStorageOpen(virConnectPtr conn, ...@@ -480,7 +480,7 @@ parallelsStorageOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
error: error:
parallelsStorageUnlock(storageState); parallelsStorageUnlock(storageState);
parallelsStorageClose(conn); parallelsStorageClose(conn);
return -1; return -1;
...@@ -524,7 +524,7 @@ parallelsConnectListStoragePools(virConnectPtr conn, char **const names, int nna ...@@ -524,7 +524,7 @@ parallelsConnectListStoragePools(virConnectPtr conn, char **const names, int nna
return n; return n;
error: error:
for (n = 0; n < nnames; n++) for (n = 0; n < nnames; n++)
VIR_FREE(names[n]); VIR_FREE(names[n]);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -573,7 +573,7 @@ parallelsConnectListDefinedStoragePools(virConnectPtr conn, ...@@ -573,7 +573,7 @@ parallelsConnectListDefinedStoragePools(virConnectPtr conn,
return n; return n;
error: error:
for (n = 0; n < nnames; n++) for (n = 0; n < nnames; n++)
VIR_FREE(names[n]); VIR_FREE(names[n]);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -597,7 +597,7 @@ parallelsStoragePoolIsActive(virStoragePoolPtr pool) ...@@ -597,7 +597,7 @@ parallelsStoragePoolIsActive(virStoragePoolPtr pool)
} }
ret = virStoragePoolObjIsActive(obj); ret = virStoragePoolObjIsActive(obj);
cleanup: cleanup:
if (obj) if (obj)
virStoragePoolObjUnlock(obj); virStoragePoolObjUnlock(obj);
return ret; return ret;
...@@ -628,7 +628,7 @@ parallelsStoragePoolLookupByUUID(virConnectPtr conn, const unsigned char *uuid) ...@@ -628,7 +628,7 @@ parallelsStoragePoolLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid, ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
NULL, NULL); NULL, NULL);
cleanup: cleanup:
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
return ret; return ret;
...@@ -653,7 +653,7 @@ parallelsStoragePoolLookupByName(virConnectPtr conn, const char *name) ...@@ -653,7 +653,7 @@ parallelsStoragePoolLookupByName(virConnectPtr conn, const char *name)
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid, ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
NULL, NULL); NULL, NULL);
cleanup: cleanup:
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
return ret; return ret;
...@@ -736,7 +736,7 @@ parallelsStoragePoolDefineXML(virConnectPtr conn, ...@@ -736,7 +736,7 @@ parallelsStoragePoolDefineXML(virConnectPtr conn,
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid, ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
NULL, NULL); NULL, NULL);
cleanup: cleanup:
virStoragePoolDefFree(def); virStoragePoolDefFree(def);
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
...@@ -773,7 +773,7 @@ parallelsStoragePoolUndefine(virStoragePoolPtr pool) ...@@ -773,7 +773,7 @@ parallelsStoragePoolUndefine(virStoragePoolPtr pool)
virStoragePoolObjRemove(&privconn->pools, privpool); virStoragePoolObjRemove(&privconn->pools, privpool);
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -807,7 +807,7 @@ parallelsStoragePoolCreate(virStoragePoolPtr pool, unsigned int flags) ...@@ -807,7 +807,7 @@ parallelsStoragePoolCreate(virStoragePoolPtr pool, unsigned int flags)
privpool->active = 1; privpool->active = 1;
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -840,7 +840,7 @@ parallelsStoragePoolDestroy(virStoragePoolPtr pool) ...@@ -840,7 +840,7 @@ parallelsStoragePoolDestroy(virStoragePoolPtr pool)
} }
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
parallelsDriverUnlock(privconn); parallelsDriverUnlock(privconn);
...@@ -872,7 +872,7 @@ parallelsStoragePoolRefresh(virStoragePoolPtr pool, unsigned int flags) ...@@ -872,7 +872,7 @@ parallelsStoragePoolRefresh(virStoragePoolPtr pool, unsigned int flags)
} }
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -905,7 +905,7 @@ parallelsStoragePoolGetInfo(virStoragePoolPtr pool, virStoragePoolInfoPtr info) ...@@ -905,7 +905,7 @@ parallelsStoragePoolGetInfo(virStoragePoolPtr pool, virStoragePoolInfoPtr info)
info->available = privpool->def->available; info->available = privpool->def->available;
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -931,7 +931,7 @@ parallelsStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags) ...@@ -931,7 +931,7 @@ parallelsStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags)
ret = virStoragePoolDefFormat(privpool->def); ret = virStoragePoolDefFormat(privpool->def);
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -960,7 +960,7 @@ parallelsStoragePoolGetAutostart(virStoragePoolPtr pool, int *autostart) ...@@ -960,7 +960,7 @@ parallelsStoragePoolGetAutostart(virStoragePoolPtr pool, int *autostart)
} }
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -990,7 +990,7 @@ parallelsStoragePoolSetAutostart(virStoragePoolPtr pool, int autostart) ...@@ -990,7 +990,7 @@ parallelsStoragePoolSetAutostart(virStoragePoolPtr pool, int autostart)
privpool->autostart = (autostart != 0); privpool->autostart = (autostart != 0);
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1020,7 +1020,7 @@ parallelsStoragePoolNumOfVolumes(virStoragePoolPtr pool) ...@@ -1020,7 +1020,7 @@ parallelsStoragePoolNumOfVolumes(virStoragePoolPtr pool)
ret = privpool->volumes.count; ret = privpool->volumes.count;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1061,7 +1061,7 @@ parallelsStoragePoolListVolumes(virStoragePoolPtr pool, ...@@ -1061,7 +1061,7 @@ parallelsStoragePoolListVolumes(virStoragePoolPtr pool,
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return n; return n;
error: error:
for (n = 0; n < maxnames; n++) for (n = 0; n < maxnames; n++)
VIR_FREE(names[i]); VIR_FREE(names[i]);
...@@ -1107,7 +1107,7 @@ parallelsStorageVolLookupByName(virStoragePoolPtr pool, ...@@ -1107,7 +1107,7 @@ parallelsStorageVolLookupByName(virStoragePoolPtr pool,
privvol->name, privvol->key, privvol->name, privvol->key,
NULL, NULL); NULL, NULL);
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1257,7 +1257,7 @@ parallelsStorageVolDefineXML(virStoragePoolObjPtr pool, ...@@ -1257,7 +1257,7 @@ parallelsStorageVolDefineXML(virStoragePoolObjPtr pool,
ret = privvol; ret = privvol;
privvol = NULL; privvol = NULL;
cleanup: cleanup:
virStorageVolDefFree(privvol); virStorageVolDefFree(privvol);
VIR_FREE(xml_path); VIR_FREE(xml_path);
return ret; return ret;
...@@ -1296,7 +1296,7 @@ parallelsStorageVolCreateXML(virStoragePoolPtr pool, ...@@ -1296,7 +1296,7 @@ parallelsStorageVolCreateXML(virStoragePoolPtr pool,
ret = virGetStorageVol(pool->conn, privpool->def->name, ret = virGetStorageVol(pool->conn, privpool->def->name,
privvol->name, privvol->key, privvol->name, privvol->key,
NULL, NULL); NULL, NULL);
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1379,7 +1379,7 @@ parallelsStorageVolCreateXMLFrom(virStoragePoolPtr pool, ...@@ -1379,7 +1379,7 @@ parallelsStorageVolCreateXMLFrom(virStoragePoolPtr pool,
NULL, NULL); NULL, NULL);
privvol = NULL; privvol = NULL;
cleanup: cleanup:
virStorageVolDefFree(privvol); virStorageVolDefFree(privvol);
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
...@@ -1417,7 +1417,7 @@ int parallelsStorageVolDefRemove(virStoragePoolObjPtr privpool, ...@@ -1417,7 +1417,7 @@ int parallelsStorageVolDefRemove(virStoragePoolObjPtr privpool,
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(xml_path); VIR_FREE(xml_path);
return ret; return ret;
} }
...@@ -1462,7 +1462,7 @@ parallelsStorageVolDelete(virStorageVolPtr vol, unsigned int flags) ...@@ -1462,7 +1462,7 @@ parallelsStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1478,7 +1478,7 @@ parallelsStorageVolTypeForPool(int pooltype) ...@@ -1478,7 +1478,7 @@ parallelsStorageVolTypeForPool(int pooltype)
case VIR_STORAGE_POOL_FS: case VIR_STORAGE_POOL_FS:
case VIR_STORAGE_POOL_NETFS: case VIR_STORAGE_POOL_NETFS:
return VIR_STORAGE_VOL_FILE; return VIR_STORAGE_VOL_FILE;
default: default:
return VIR_STORAGE_VOL_BLOCK; return VIR_STORAGE_VOL_BLOCK;
} }
} }
...@@ -1520,7 +1520,7 @@ parallelsStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info) ...@@ -1520,7 +1520,7 @@ parallelsStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info)
info->allocation = privvol->allocation; info->allocation = privvol->allocation;
ret = 0; ret = 0;
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1561,7 +1561,7 @@ parallelsStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) ...@@ -1561,7 +1561,7 @@ parallelsStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
ret = virStorageVolDefFormat(privpool->def, privvol); ret = virStorageVolDefFormat(privpool->def, privvol);
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
...@@ -1600,7 +1600,7 @@ parallelsStorageVolGetPath(virStorageVolPtr vol) ...@@ -1600,7 +1600,7 @@ parallelsStorageVolGetPath(virStorageVolPtr vol)
ignore_value(VIR_STRDUP(ret, privvol->target.path)); ignore_value(VIR_STRDUP(ret, privvol->target.path));
cleanup: cleanup:
if (privpool) if (privpool)
virStoragePoolObjUnlock(privpool); virStoragePoolObjUnlock(privpool);
return ret; return ret;
......
...@@ -47,7 +47,7 @@ parallelsDoCmdRun(char **outbuf, const char *binary, va_list list) ...@@ -47,7 +47,7 @@ parallelsDoCmdRun(char **outbuf, const char *binary, va_list list)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
if (ret && outbuf) if (ret && outbuf)
VIR_FREE(*outbuf); VIR_FREE(*outbuf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册