Replace all occurrances of
if (....) {
goto cleanup;
}
With
if (.....)
goto cleanup;
to save one line of code
* daemon/remote.c: Remove curly braces on single line conditionals
---
daemon/remote.c | 951 ++++++++++++++++++------------------------------------
1 files changed, 317 insertions(+), 634 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 325ba90..247a226 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -427,9 +427,8 @@ remoteDispatchOpen(struct qemud_server *server,
? virConnectOpenReadOnly(name)
: virConnectOpen(name);
- if (client->conn == NULL) {
+ if (client->conn == NULL)
goto cleanup;
- }
rv = 0;
@@ -476,9 +475,8 @@ remoteDispatchSupportsFeature(struct qemud_server *server
ATTRIBUTE_UNUSED,
ret->supported = virDrvSupportsFeature(conn, args->feature);
- if (ret->supported < 0) {
+ if (ret->supported < 0)
goto cleanup;
- }
rv = 0;
@@ -505,9 +503,8 @@ remoteDispatchGetType(struct qemud_server *server ATTRIBUTE_UNUSED,
}
type = virConnectGetType(conn);
- if (type == NULL) {
+ if (type == NULL)
goto cleanup;
- }
/* We have to strdup because remoteDispatchClientRequest will
* free this string after it's been serialised.
@@ -543,9 +540,8 @@ remoteDispatchGetVersion(struct qemud_server *server
ATTRIBUTE_UNUSED,
goto cleanup;
}
- if (virConnectGetVersion(conn, &hvVer) < 0) {
+ if (virConnectGetVersion(conn, &hvVer) < 0)
goto cleanup;
- }
ret->hv_ver = hvVer;
rv = 0;
@@ -573,9 +569,8 @@ remoteDispatchGetLibVersion(struct qemud_server *server
ATTRIBUTE_UNUSED,
goto cleanup;
}
- if (virConnectGetLibVersion(conn, &libVer) < 0) {
+ if (virConnectGetLibVersion(conn, &libVer) < 0)
goto cleanup;
- }
ret->lib_ver = libVer;
rv = 0;
@@ -604,9 +599,8 @@ remoteDispatchGetHostname(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
hostname = virConnectGetHostname(conn);
- if (hostname == NULL) {
+ if (hostname == NULL)
goto cleanup;
- }
ret->hostname = hostname;
rv = 0;
@@ -635,9 +629,8 @@ remoteDispatchGetUri(struct qemud_server *server ATTRIBUTE_UNUSED,
}
uri = virConnectGetURI(conn);
- if (uri == NULL) {
+ if (uri == NULL)
goto cleanup;
- }
ret->uri = uri;
rv = 0;
@@ -668,9 +661,8 @@ remoteDispatchGetSysinfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
flags = args->flags;
sysinfo = virConnectGetSysinfo(conn, flags);
- if (sysinfo == NULL) {
+ if (sysinfo == NULL)
goto cleanup;
- }
ret->sysinfo = sysinfo;
rv = 0;
@@ -700,9 +692,8 @@ remoteDispatchGetMaxVcpus(struct qemud_server *server
ATTRIBUTE_UNUSED,
type = args->type ? *args->type : NULL;
ret->max_vcpus = virConnectGetMaxVcpus(conn, type);
- if (ret->max_vcpus < 0) {
+ if (ret->max_vcpus < 0)
goto cleanup;
- }
rv = 0;
@@ -729,9 +720,8 @@ remoteDispatchNodeGetInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
goto cleanup;
}
- if (virNodeGetInfo(conn, &info) < 0) {
+ if (virNodeGetInfo(conn, &info) < 0)
goto cleanup;
- }
memcpy(ret->model, info.model, sizeof ret->model);
ret->memory = info.memory;
@@ -768,9 +758,8 @@ remoteDispatchGetCapabilities(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
caps = virConnectGetCapabilities(conn);
- if (caps == NULL) {
+ if (caps == NULL)
goto cleanup;
- }
ret->capabilities = caps;
rv = 0;
@@ -814,9 +803,8 @@ remoteDispatchNodeGetCellsFreeMemory(struct qemud_server *server
ATTRIBUTE_UNUSE
(unsigned long long *)ret->freeMems.freeMems_val,
args->startCell,
args->maxCells);
- if (err <= 0) {
+ if (err <= 0)
goto cleanup;
- }
ret->freeMems.freeMems_len = err;
rv = 0;
@@ -848,9 +836,8 @@ remoteDispatchNodeGetFreeMemory(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
freeMem = virNodeGetFreeMemory(conn);
- if (freeMem == 0) {
+ if (freeMem == 0)
goto cleanup;
- }
ret->freeMem = freeMem;
rv = 0;
@@ -881,14 +868,12 @@ remoteDispatchDomainGetSchedulerType(struct qemud_server *server
ATTRIBUTE_UNUSE
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
type = virDomainGetSchedulerType(dom, &nparams);
- if (type == NULL) {
+ if (type == NULL)
goto cleanup;
- }
ret->type = type;
ret->nparams = nparams;
@@ -933,14 +918,12 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server
*server ATTRIBUTE
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainGetSchedulerParameters(dom, params, &nparams);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
/* Serialise the scheduler parameters. */
ret->params.params_len = nparams;
@@ -1046,14 +1029,12 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server
*server ATTRIBUTE
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainSetSchedulerParameters(dom, params, nparams);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
rv = 0;
@@ -1086,14 +1067,12 @@ remoteDispatchDomainBlockStats(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
path = args->path;
- if (virDomainBlockStats(dom, path, &stats, sizeof stats) < 0) {
+ if (virDomainBlockStats(dom, path, &stats, sizeof stats) < 0)
goto cleanup;
- }
ret->rd_req = stats.rd_req;
ret->rd_bytes = stats.rd_bytes;
@@ -1131,14 +1110,12 @@ remoteDispatchDomainInterfaceStats(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
path = args->path;
- if (virDomainInterfaceStats(dom, path, &stats, sizeof stats) < 0) {
+ if (virDomainInterfaceStats(dom, path, &stats, sizeof stats) < 0)
goto cleanup;
- }
ret->rx_bytes = stats.rx_bytes;
ret->rx_packets = stats.rx_packets;
@@ -1185,9 +1162,8 @@ remoteDispatchDomainMemoryStats(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
/* Allocate stats array for making dispatch call */
if (VIR_ALLOC_N(stats, args->maxStats) < 0) {
@@ -1196,9 +1172,8 @@ remoteDispatchDomainMemoryStats(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nr_stats = virDomainMemoryStats(dom, stats, args->maxStats, 0);
- if (nr_stats < 0) {
+ if (nr_stats < 0)
goto cleanup;
- }
/* Allocate return buffer */
if (VIR_ALLOC_N(ret->stats.stats_val, args->maxStats) < 0) {
@@ -1245,9 +1220,8 @@ remoteDispatchDomainBlockPeek(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
path = args->path;
offset = args->offset;
size = args->size;
@@ -1266,9 +1240,8 @@ remoteDispatchDomainBlockPeek(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
if (virDomainBlockPeek(dom, path, offset, size,
- ret->buffer.buffer_val, flags) < 0) {
+ ret->buffer.buffer_val, flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -1303,9 +1276,8 @@ remoteDispatchDomainMemoryPeek(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
offset = args->offset;
size = args->size;
flags = args->flags;
@@ -1323,9 +1295,8 @@ remoteDispatchDomainMemoryPeek(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
if (virDomainMemoryPeek(dom, offset, size,
- ret->buffer.buffer_val, flags) < 0) {
+ ret->buffer.buffer_val, flags) < 0)
goto cleanup;
- }
if (dom)
virDomainFree(dom);
@@ -1359,13 +1330,11 @@ remoteDispatchDomainAttachDevice(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainAttachDevice(dom, args->xml) < 0) {
+ if (virDomainAttachDevice(dom, args->xml) < 0)
goto cleanup;
- }
rv = 0;
@@ -1395,13 +1364,11 @@ remoteDispatchDomainAttachDeviceFlags(struct qemud_server *server
ATTRIBUTE_UNUS
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainAttachDeviceFlags(dom, args->xml, args->flags) < 0) {
+ if (virDomainAttachDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -1431,13 +1398,11 @@ remoteDispatchDomainUpdateDeviceFlags(struct qemud_server *server
ATTRIBUTE_UNUS
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainUpdateDeviceFlags(dom, args->xml, args->flags) < 0) {
+ if (virDomainUpdateDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -1467,13 +1432,11 @@ remoteDispatchDomainCreate(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainCreate(dom) < 0) {
+ if (virDomainCreate(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -1498,13 +1461,11 @@ remoteDispatchDomainCreateWithFlags(struct qemud_server *server
ATTRIBUTE_UNUSED
virDomainPtr dom = NULL;
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainCreateWithFlags(dom, args->flags) < 0) {
+ if (virDomainCreateWithFlags(dom, args->flags) < 0)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -1536,9 +1497,8 @@ remoteDispatchDomainCreateXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = virDomainCreateXML(conn, args->xml_desc, args->flags);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -1570,9 +1530,8 @@ remoteDispatchDomainDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = virDomainDefineXML(conn, args->xml);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -1604,13 +1563,11 @@ remoteDispatchDomainDestroy(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainDestroy(dom) < 0) {
+ if (virDomainDestroy(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -1640,13 +1597,11 @@ remoteDispatchDomainDetachDevice(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainDetachDevice(dom, args->xml) < 0) {
+ if (virDomainDetachDevice(dom, args->xml) < 0)
goto cleanup;
- }
rv = 0;
@@ -1676,13 +1631,11 @@ remoteDispatchDomainDetachDeviceFlags(struct qemud_server *server
ATTRIBUTE_UNUS
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainDetachDeviceFlags(dom, args->xml, args->flags) < 0) {
+ if (virDomainDetachDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -1712,15 +1665,13 @@ remoteDispatchDomainDumpXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virDomainGetXMLDesc(dom, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -1753,9 +1704,8 @@ remoteDispatchDomainXmlFromNative(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->nativeFormat,
args->nativeConfig,
args->flags);
- if (!ret->domainXml) {
+ if (!ret->domainXml)
goto cleanup;
- }
rv = 0;
cleanup:
@@ -1785,9 +1735,8 @@ remoteDispatchDomainXmlToNative(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->nativeFormat,
args->domainXml,
args->flags);
- if (!ret->nativeConfig) {
+ if (!ret->nativeConfig)
goto cleanup;
- }
rv = 0;
cleanup:
@@ -1815,13 +1764,11 @@ remoteDispatchDomainGetAutostart(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainGetAutostart(dom, &ret->autostart) < 0) {
+ if (virDomainGetAutostart(dom, &ret->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -1852,13 +1799,11 @@ remoteDispatchDomainGetInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainGetInfo(dom, &info) < 0) {
+ if (virDomainGetInfo(dom, &info) < 0)
goto cleanup;
- }
ret->state = info.state;
ret->max_mem = info.maxMem;
@@ -1894,14 +1839,12 @@ remoteDispatchDomainGetMaxMemory(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
ret->memory = virDomainGetMaxMemory(dom);
- if (ret->memory == 0) {
+ if (ret->memory == 0)
goto cleanup;
- }
rv = 0;
@@ -1931,14 +1874,12 @@ remoteDispatchDomainGetMaxVcpus(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
ret->num = virDomainGetMaxVcpus(dom);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -1969,18 +1910,16 @@ remoteDispatchDomainGetSecurityLabel(struct qemud_server *server
ATTRIBUTE_UNUSE
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
if (VIR_ALLOC(seclabel) < 0) {
virReportOOMError();
goto cleanup;
}
- if (virDomainGetSecurityLabel(dom, seclabel) < 0) {
+ if (virDomainGetSecurityLabel(dom, seclabel) < 0)
goto cleanup;
- }
ret->label.label_len = strlen(seclabel->label) + 1;
if (VIR_ALLOC_N(ret->label.label_val, ret->label.label_len) < 0) {
@@ -2019,9 +1958,8 @@ remoteDispatchNodeGetSecurityModel(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
memset(&secmodel, 0, sizeof secmodel);
- if (virNodeGetSecurityModel(conn, &secmodel) < 0) {
+ if (virNodeGetSecurityModel(conn, &secmodel) < 0)
goto cleanup;
- }
ret->model.model_len = strlen(secmodel.model) + 1;
if (VIR_ALLOC_N(ret->model.model_val, ret->model.model_len) < 0) {
@@ -2063,15 +2001,13 @@ remoteDispatchDomainGetOsType(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this */
ret->type = virDomainGetOSType(dom);
- if (ret->type == NULL) {
+ if (ret->type == NULL)
goto cleanup;
- }
rv = 0;
cleanup:
@@ -2103,9 +2039,8 @@ remoteDispatchDomainGetVcpus(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
if (args->maxinfo > REMOTE_VCPUINFO_MAX) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("maxinfo >
REMOTE_VCPUINFO_MAX"));
@@ -2127,9 +2062,8 @@ remoteDispatchDomainGetVcpus(struct qemud_server *server
ATTRIBUTE_UNUSED,
info_len = virDomainGetVcpus(dom,
info, args->maxinfo,
cpumaps, args->maplen);
- if (info_len < 0) {
+ if (info_len < 0)
goto cleanup;
- }
/* Allocate the return buffer for info. */
ret->info.info_len = info_len;
@@ -2187,14 +2121,12 @@ remoteDispatchDomainGetVcpusFlags(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
ret->num = virDomainGetVcpusFlags(dom, args->flags);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -2240,9 +2172,8 @@ remoteDispatchDomainMigratePrepare(struct qemud_server *server
ATTRIBUTE_UNUSED,
r = virDomainMigratePrepare(conn, &cookie, &cookielen,
uri_in, uri_out,
args->flags, dname, args->resource);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
/* remoteDispatchClientRequest will free cookie, uri_out and
* the string if there is one.
@@ -2285,9 +2216,8 @@ remoteDispatchDomainMigratePerform(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
dname = args->dname == NULL ? NULL : *args->dname;
@@ -2296,9 +2226,8 @@ remoteDispatchDomainMigratePerform(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->cookie.cookie_len,
args->uri,
args->flags, dname, args->resource);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
rv = 0;
@@ -2332,9 +2261,8 @@ remoteDispatchDomainMigrateFinish(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->cookie.cookie_len,
args->uri,
args->flags);
- if (ddom == NULL) {
+ if (ddom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->ddom, ddom);
rv = 0;
@@ -2382,9 +2310,8 @@ remoteDispatchDomainMigratePrepare2(struct qemud_server *server
ATTRIBUTE_UNUSED
uri_in, uri_out,
args->flags, dname, args->resource,
args->dom_xml);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
/* remoteDispatchClientRequest will free cookie, uri_out and
* the string if there is one.
@@ -2424,9 +2351,8 @@ remoteDispatchDomainMigrateFinish2(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->uri,
args->flags,
args->retcode);
- if (ddom == NULL) {
+ if (ddom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->ddom, ddom);
@@ -2470,13 +2396,11 @@ remoteDispatchDomainMigratePrepareTunnel(struct qemud_server
*server ATTRIBUTE_U
r = virDomainMigratePrepareTunnel(conn, stream->st,
args->flags, dname, args->resource,
args->dom_xml);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
- if (remoteAddClientStream(client, stream, 0) < 0) {
+ if (remoteAddClientStream(client, stream, 0) < 0)
goto cleanup;
- }
rv = 0;
@@ -2522,9 +2446,8 @@ remoteDispatchListDefinedDomains(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListDefinedDomains(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -2555,9 +2478,8 @@ remoteDispatchDomainLookupById(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = virDomainLookupByID(conn, args->id);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -2589,9 +2511,8 @@ remoteDispatchDomainLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = virDomainLookupByName(conn, args->name);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -2623,9 +2544,8 @@ remoteDispatchDomainLookupByUuid(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = virDomainLookupByUUID(conn, (unsigned char *) args->uuid);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
@@ -2656,9 +2576,8 @@ remoteDispatchNumOfDefinedDomains(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfDefinedDomains(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -2686,9 +2605,8 @@ remoteDispatchDomainPinVcpu(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
if (args->cpumap.cpumap_len > REMOTE_CPUMAP_MAX) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("cpumap_len >
REMOTE_CPUMAP_MAX"));
@@ -2698,9 +2616,8 @@ remoteDispatchDomainPinVcpu(struct qemud_server *server
ATTRIBUTE_UNUSED,
rv = virDomainPinVcpu(dom, args->vcpu,
(unsigned char *) args->cpumap.cpumap_val,
args->cpumap.cpumap_len);
- if (rv < 0) {
+ if (rv < 0)
goto cleanup;
- }
rv = 0;
@@ -2730,13 +2647,11 @@ remoteDispatchDomainReboot(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainReboot(dom, args->flags) < 0) {
+ if (virDomainReboot(dom, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -2764,9 +2679,8 @@ remoteDispatchDomainRestore(struct qemud_server *server
ATTRIBUTE_UNUSED,
goto cleanup;
}
- if (virDomainRestore(conn, args->from) < 0) {
+ if (virDomainRestore(conn, args->from) < 0)
goto cleanup;
- }
rv = 0;
@@ -2794,13 +2708,11 @@ remoteDispatchDomainResume(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainResume(dom) < 0) {
+ if (virDomainResume(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -2830,13 +2742,11 @@ remoteDispatchDomainSave(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSave(dom, args->to) < 0) {
+ if (virDomainSave(dom, args->to) < 0)
goto cleanup;
- }
rv = 0;
@@ -2866,13 +2776,11 @@ remoteDispatchDomainCoreDump(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainCoreDump(dom, args->to, args->flags) < 0) {
+ if (virDomainCoreDump(dom, args->to, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -2902,13 +2810,11 @@ remoteDispatchDomainSetAutostart(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetAutostart(dom, args->autostart) < 0) {
+ if (virDomainSetAutostart(dom, args->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -2938,13 +2844,11 @@ remoteDispatchDomainSetMaxMemory(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetMaxMemory(dom, args->memory) < 0) {
+ if (virDomainSetMaxMemory(dom, args->memory) < 0)
goto cleanup;
- }
rv = 0;
@@ -2974,13 +2878,11 @@ remoteDispatchDomainSetMemory(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetMemory(dom, args->memory) < 0) {
+ if (virDomainSetMemory(dom, args->memory) < 0)
goto cleanup;
- }
rv = 0;
@@ -3010,13 +2912,11 @@ remoteDispatchDomainSetMemoryFlags(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetMemoryFlags(dom, args->memory, args->flags) < 0) {
+ if (virDomainSetMemoryFlags(dom, args->memory, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -3108,14 +3008,12 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server
*server
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainSetMemoryParameters(dom, params, nparams, flags);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
rv = 0;
@@ -3166,14 +3064,12 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server
*server
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainGetMemoryParameters(dom, params, &nparams, flags);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
/* In this case, we need to send back the number of parameters
* supported
*/
@@ -3329,14 +3225,12 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server
*server
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainSetBlkioParameters(dom, params, nparams, flags);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
rv = 0;
@@ -3387,14 +3281,12 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server
*server
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
r = virDomainGetBlkioParameters(dom, params, &nparams, flags);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
/* In this case, we need to send back the number of parameters
* supported
*/
@@ -3490,13 +3382,11 @@ remoteDispatchDomainSetVcpus(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetVcpus(dom, args->nvcpus) < 0) {
+ if (virDomainSetVcpus(dom, args->nvcpus) < 0)
goto cleanup;
- }
rv = 0;
@@ -3526,13 +3416,11 @@ remoteDispatchDomainSetVcpusFlags(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSetVcpusFlags(dom, args->nvcpus, args->flags) < 0) {
+ if (virDomainSetVcpusFlags(dom, args->nvcpus, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -3562,13 +3450,11 @@ remoteDispatchDomainShutdown(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainShutdown(dom) < 0) {
+ if (virDomainShutdown(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -3598,13 +3484,11 @@ remoteDispatchDomainSuspend(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainSuspend(dom) < 0) {
+ if (virDomainSuspend(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -3634,13 +3518,11 @@ remoteDispatchDomainUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainUndefine(dom) < 0) {
+ if (virDomainUndefine(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -3683,9 +3565,8 @@ remoteDispatchListDefinedNetworks(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListDefinedNetworks(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -3729,9 +3610,8 @@ remoteDispatchListDomains(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListDomains(conn,
ret->ids.ids_val, args->maxids);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->ids.ids_len = len;
rv = 0;
@@ -3762,13 +3642,11 @@ remoteDispatchDomainManagedSave(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainManagedSave(dom, args->flags) < 0) {
+ if (virDomainManagedSave(dom, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -3798,14 +3676,12 @@ remoteDispatchDomainHasManagedSaveImage(struct qemud_server
*server ATTRIBUTE_UN
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
ret->ret = virDomainHasManagedSaveImage(dom, args->flags);
- if (ret->ret < 0) {
+ if (ret->ret < 0)
goto cleanup;
- }
rv = 0;
@@ -3835,13 +3711,11 @@ remoteDispatchDomainManagedSaveRemove(struct qemud_server *server
ATTRIBUTE_UNUS
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainManagedSaveRemove(dom, args->flags) < 0) {
+ if (virDomainManagedSaveRemove(dom, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -3884,9 +3758,8 @@ remoteDispatchListNetworks(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListNetworks(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -3917,13 +3790,11 @@ remoteDispatchNetworkCreate(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
- if (virNetworkCreate(net) < 0) {
+ if (virNetworkCreate(net) < 0)
goto cleanup;
- }
rv = 0;
@@ -3953,9 +3824,8 @@ remoteDispatchNetworkCreateXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = virNetworkCreateXML(conn, args->xml);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
@@ -3987,9 +3857,8 @@ remoteDispatchNetworkDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = virNetworkDefineXML(conn, args->xml);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
@@ -4021,13 +3890,11 @@ remoteDispatchNetworkDestroy(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
- if (virNetworkDestroy(net) < 0) {
+ if (virNetworkDestroy(net) < 0)
goto cleanup;
- }
rv = 0;
@@ -4057,15 +3924,13 @@ remoteDispatchNetworkDumpXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virNetworkGetXMLDesc(net, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -4095,13 +3960,11 @@ remoteDispatchNetworkGetAutostart(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
- if (virNetworkGetAutostart(net, &ret->autostart) < 0) {
+ if (virNetworkGetAutostart(net, &ret->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -4131,15 +3994,13 @@ remoteDispatchNetworkGetBridgeName(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->name = virNetworkGetBridgeName(net);
- if (!ret->name) {
+ if (!ret->name)
goto cleanup;
- }
rv = 0;
@@ -4169,9 +4030,8 @@ remoteDispatchNetworkLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = virNetworkLookupByName(conn, args->name);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
@@ -4203,9 +4063,8 @@ remoteDispatchNetworkLookupByUuid(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = virNetworkLookupByUUID(conn, (unsigned char *) args->uuid);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
@@ -4237,13 +4096,11 @@ remoteDispatchNetworkSetAutostart(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
- if (virNetworkSetAutostart(net, args->autostart) < 0) {
+ if (virNetworkSetAutostart(net, args->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -4273,13 +4130,11 @@ remoteDispatchNetworkUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
- if (virNetworkUndefine(net) < 0) {
+ if (virNetworkUndefine(net) < 0)
goto cleanup;
- }
rv = 0;
@@ -4309,9 +4164,8 @@ remoteDispatchNumOfDefinedNetworks(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
len = virConnectNumOfDefinedNetworks(conn);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->num = len;
rv = 0;
@@ -4339,9 +4193,8 @@ remoteDispatchNumOfDomains(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfDomains(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -4368,9 +4221,8 @@ remoteDispatchNumOfNetworks(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfNetworks(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -4399,9 +4251,8 @@ remoteDispatchNumOfInterfaces(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfInterfaces(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -4442,9 +4293,8 @@ remoteDispatchListInterfaces(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListInterfaces(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -4475,9 +4325,8 @@ remoteDispatchNumOfDefinedInterfaces(struct qemud_server *server
ATTRIBUTE_UNUSE
}
len = virConnectNumOfDefinedInterfaces(conn);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->num = len;
rv = 0;
@@ -4519,9 +4368,8 @@ remoteDispatchListDefinedInterfaces(struct qemud_server *server
ATTRIBUTE_UNUSED
len = virConnectListDefinedInterfaces(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -4552,9 +4400,8 @@ remoteDispatchInterfaceLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSED
}
iface = virInterfaceLookupByName(conn, args->name);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
@@ -4586,9 +4433,8 @@ remoteDispatchInterfaceLookupByMacString(struct qemud_server *server
ATTRIBUTE_U
}
iface = virInterfaceLookupByMACString(conn, args->mac);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
@@ -4620,15 +4466,13 @@ remoteDispatchInterfaceGetXmlDesc(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virInterfaceGetXMLDesc(iface, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -4658,9 +4502,8 @@ remoteDispatchInterfaceDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
iface = virInterfaceDefineXML(conn, args->xml, args->flags);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
@@ -4692,13 +4535,11 @@ remoteDispatchInterfaceUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
- if (virInterfaceUndefine(iface) < 0) {
+ if (virInterfaceUndefine(iface) < 0)
goto cleanup;
- }
rv = 0;
@@ -4728,13 +4569,11 @@ remoteDispatchInterfaceCreate(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
- if (virInterfaceCreate(iface, args->flags) < 0) {
+ if (virInterfaceCreate(iface, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -4764,13 +4603,11 @@ remoteDispatchInterfaceDestroy(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
- if (virInterfaceDestroy(iface, args->flags) < 0) {
+ if (virInterfaceDestroy(iface, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -4857,9 +4694,8 @@ remoteDispatchAuthSaslInit(struct qemud_server *server,
virStrerror(errno, ebuf, sizeof ebuf));
goto error;
}
- if ((localAddr = virSocketFormatAddrFull(&sa, true, ";")) == NULL) {
+ if ((localAddr = virSocketFormatAddrFull(&sa, true, ";")) == NULL)
goto error;
- }
/* Get remote address in form IPADDR:PORT */
sa.len = sizeof(sa.data.stor);
@@ -5617,9 +5453,8 @@ remoteDispatchListDefinedStoragePools(struct qemud_server *server
ATTRIBUTE_UNUS
len = virConnectListDefinedStoragePools(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -5663,9 +5498,8 @@ remoteDispatchListStoragePools(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListStoragePools(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -5699,9 +5533,8 @@ remoteDispatchFindStoragePoolSources(struct qemud_server *server
ATTRIBUTE_UNUSE
args->type,
args->srcSpec ? *args->srcSpec : NULL,
args->flags);
- if (ret->xml == NULL) {
+ if (ret->xml == NULL)
goto cleanup;
- }
rv = 0;
@@ -5730,13 +5563,11 @@ remoteDispatchStoragePoolCreate(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolCreate(pool, args->flags) < 0) {
+ if (virStoragePoolCreate(pool, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -5766,9 +5597,8 @@ remoteDispatchStoragePoolCreateXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = virStoragePoolCreateXML(conn, args->xml, args->flags);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
@@ -5800,9 +5630,8 @@ remoteDispatchStoragePoolDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = virStoragePoolDefineXML(conn, args->xml, args->flags);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
@@ -5834,13 +5663,11 @@ remoteDispatchStoragePoolBuild(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolBuild(pool, args->flags) < 0) {
+ if (virStoragePoolBuild(pool, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -5871,13 +5698,11 @@ remoteDispatchStoragePoolDestroy(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolDestroy(pool) < 0) {
+ if (virStoragePoolDestroy(pool) < 0)
goto cleanup;
- }
rv = 0;
@@ -5907,13 +5732,11 @@ remoteDispatchStoragePoolDelete(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolDelete(pool, args->flags) < 0) {
+ if (virStoragePoolDelete(pool, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -5943,13 +5766,11 @@ remoteDispatchStoragePoolRefresh(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolRefresh(pool, args->flags) < 0) {
+ if (virStoragePoolRefresh(pool, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -5980,13 +5801,11 @@ remoteDispatchStoragePoolGetInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolGetInfo(pool, &info) < 0) {
+ if (virStoragePoolGetInfo(pool, &info) < 0)
goto cleanup;
- }
ret->state = info.state;
ret->capacity = info.capacity;
@@ -6021,15 +5840,13 @@ remoteDispatchStoragePoolDumpXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virStoragePoolGetXMLDesc(pool, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -6059,13 +5876,11 @@ remoteDispatchStoragePoolGetAutostart(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolGetAutostart(pool, &ret->autostart) < 0) {
+ if (virStoragePoolGetAutostart(pool, &ret->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -6096,9 +5911,8 @@ remoteDispatchStoragePoolLookupByName(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = virStoragePoolLookupByName(conn, args->name);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
@@ -6130,9 +5944,8 @@ remoteDispatchStoragePoolLookupByUuid(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = virStoragePoolLookupByUUID(conn, (unsigned char *) args->uuid);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
@@ -6165,14 +5978,12 @@ remoteDispatchStoragePoolLookupByVolume(struct qemud_server
*server ATTRIBUTE_UN
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
pool = virStoragePoolLookupByVolume(vol);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
@@ -6206,13 +6017,11 @@ remoteDispatchStoragePoolSetAutostart(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolSetAutostart(pool, args->autostart) < 0) {
+ if (virStoragePoolSetAutostart(pool, args->autostart) < 0)
goto cleanup;
- }
rv = 0;
@@ -6242,13 +6051,11 @@ remoteDispatchStoragePoolUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
- if (virStoragePoolUndefine(pool) < 0) {
+ if (virStoragePoolUndefine(pool) < 0)
goto cleanup;
- }
rv = 0;
@@ -6277,9 +6084,8 @@ remoteDispatchNumOfStoragePools(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfStoragePools(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -6306,9 +6112,8 @@ remoteDispatchNumOfDefinedStoragePools(struct qemud_server *server
ATTRIBUTE_UNU
}
ret->num = virConnectNumOfDefinedStoragePools(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -6343,9 +6148,8 @@ remoteDispatchStoragePoolListVolumes(struct qemud_server *server
ATTRIBUTE_UNUSE
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
/* Allocate return buffer. */
if (VIR_ALLOC_N(ret->names.names_val, args->maxnames) < 0) {
@@ -6355,9 +6159,8 @@ remoteDispatchStoragePoolListVolumes(struct qemud_server *server
ATTRIBUTE_UNUSE
len = virStoragePoolListVolumes(pool,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -6391,14 +6194,12 @@ remoteDispatchStoragePoolNumOfVolumes(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
ret->num = virStoragePoolNumOfVolumes(pool);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -6436,14 +6237,12 @@ remoteDispatchStorageVolCreateXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
vol = virStorageVolCreateXML(pool, args->xml, args->flags);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
rv = 0;
@@ -6478,20 +6277,17 @@ remoteDispatchStorageVolCreateXmlFrom(struct qemud_server *server
ATTRIBUTE_UNUS
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
clonevol = get_nonnull_storage_vol(conn, args->clonevol);
- if (clonevol == NULL) {
+ if (clonevol == NULL)
goto cleanup;
- }
newvol = virStorageVolCreateXMLFrom(pool, args->xml, clonevol,
args->flags);
- if (newvol == NULL) {
+ if (newvol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, newvol);
rv = 0;
@@ -6526,13 +6322,11 @@ remoteDispatchStorageVolDelete(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
- if (virStorageVolDelete(vol, args->flags) < 0) {
+ if (virStorageVolDelete(vol, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -6562,13 +6356,11 @@ remoteDispatchStorageVolWipe(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
- if (virStorageVolWipe(vol, args->flags) < 0) {
+ if (virStorageVolWipe(vol, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -6599,13 +6391,11 @@ remoteDispatchStorageVolGetInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
- if (virStorageVolGetInfo(vol, &info) < 0) {
+ if (virStorageVolGetInfo(vol, &info) < 0)
goto cleanup;
- }
ret->type = info.type;
ret->capacity = info.capacity;
@@ -6639,15 +6429,13 @@ remoteDispatchStorageVolDumpXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virStorageVolGetXMLDesc(vol, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -6678,15 +6466,13 @@ remoteDispatchStorageVolGetPath(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->name = virStorageVolGetPath(vol);
- if (!ret->name) {
+ if (!ret->name)
goto cleanup;
- }
rv = 0;
@@ -6718,14 +6504,12 @@ remoteDispatchStorageVolLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSE
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
vol = virStorageVolLookupByName(pool, args->name);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
@@ -6759,9 +6543,8 @@ remoteDispatchStorageVolLookupByKey(struct qemud_server *server
ATTRIBUTE_UNUSED
}
vol = virStorageVolLookupByKey(conn, args->key);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
@@ -6794,9 +6577,8 @@ remoteDispatchStorageVolLookupByPath(struct qemud_server *server
ATTRIBUTE_UNUSE
}
vol = virStorageVolLookupByPath(conn, args->path);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
@@ -6834,9 +6616,8 @@ remoteDispatchNodeNumOfDevices(struct qemud_server *server
ATTRIBUTE_UNUSED,
ret->num = virNodeNumOfDevices(conn,
args->cap ? *args->cap : NULL,
args->flags);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -6879,9 +6660,8 @@ remoteDispatchNodeListDevices(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virNodeListDevices(conn,
args->cap ? *args->cap : NULL,
ret->names.names_val, args->maxnames,
args->flags);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -6913,9 +6693,8 @@ remoteDispatchNodeDeviceLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSE
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
make_nonnull_node_device(&ret->dev, dev);
@@ -6948,15 +6727,13 @@ remoteDispatchNodeDeviceDumpXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virNodeDeviceGetXMLDesc(dev, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -6988,9 +6765,8 @@ remoteDispatchNodeDeviceGetParent(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
parent = virNodeDeviceGetParent(dev);
@@ -7040,14 +6816,12 @@ remoteDispatchNodeDeviceNumOfCaps(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
ret->num = virNodeDeviceNumOfCaps(dev);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -7079,9 +6853,8 @@ remoteDispatchNodeDeviceListCaps(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
if (args->maxnames > REMOTE_NODE_DEVICE_NAME_LIST_MAX) {
virNetError(VIR_ERR_INTERNAL_ERROR,
@@ -7097,9 +6870,8 @@ remoteDispatchNodeDeviceListCaps(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virNodeDeviceListCaps(dev, ret->names.names_val,
args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -7133,13 +6905,11 @@ remoteDispatchNodeDeviceDettach(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
- if (virNodeDeviceDettach(dev) < 0) {
+ if (virNodeDeviceDettach(dev) < 0)
goto cleanup;
- }
rv = 0;
@@ -7170,13 +6940,11 @@ remoteDispatchNodeDeviceReAttach(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
- if (virNodeDeviceReAttach(dev) < 0) {
+ if (virNodeDeviceReAttach(dev) < 0)
goto cleanup;
- }
rv = 0;
@@ -7207,13 +6975,11 @@ remoteDispatchNodeDeviceReset(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
- if (virNodeDeviceReset(dev) < 0) {
+ if (virNodeDeviceReset(dev) < 0)
goto cleanup;
- }
rv = 0;
@@ -7244,9 +7010,8 @@ remoteDispatchNodeDeviceCreateXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceCreateXML(conn, args->xml_desc, args->flags);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
make_nonnull_node_device(&ret->dev, dev);
@@ -7279,13 +7044,11 @@ remoteDispatchNodeDeviceDestroy(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
- if (virNodeDeviceDestroy(dev) < 0) {
+ if (virNodeDeviceDestroy(dev) < 0)
goto cleanup;
- }
rv = 0;
@@ -7315,24 +7078,20 @@ static int remoteDispatchStorageVolUpload(struct qemud_server
*server ATTRIBUTE_
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
stream = remoteCreateClientStream(conn, hdr);
- if (!stream) {
+ if (!stream)
goto cleanup;
- }
if (virStorageVolUpload(vol, stream->st,
args->offset, args->length,
- args->flags) < 0) {
+ args->flags) < 0)
goto cleanup;
- }
- if (remoteAddClientStream(client, stream, 0) < 0) {
+ if (remoteAddClientStream(client, stream, 0) < 0)
goto cleanup;
- }
rv = 0;
@@ -7366,24 +7125,20 @@ static int remoteDispatchStorageVolDownload(struct qemud_server
*server ATTRIBUT
}
vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
stream = remoteCreateClientStream(conn, hdr);
- if (!stream) {
+ if (!stream)
goto cleanup;
- }
if (virStorageVolDownload(vol, stream->st,
args->offset, args->length,
- args->flags) < 0) {
+ args->flags) < 0)
goto cleanup;
- }
- if (remoteAddClientStream(client, stream, 1) < 0) {
+ if (remoteAddClientStream(client, stream, 1) < 0)
goto cleanup;
- }
rv = 0;
@@ -7429,9 +7184,8 @@ remoteDispatchDomainEventsRegister(struct qemud_server *server
ATTRIBUTE_UNUSED,
NULL,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventLifecycle),
- client, NULL)) < 0) {
+ client, NULL)) < 0)
goto cleanup;
- }
client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] = callbackID;
@@ -7465,9 +7219,8 @@ remoteDispatchDomainEventsDeregister(struct qemud_server *server
ATTRIBUTE_UNUSE
}
if (virConnectDomainEventDeregisterAny(conn,
-
client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE]) < 0) {
+
client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE]) < 0)
goto cleanup;
- }
client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] = -1;
rv = 0;
@@ -7559,9 +7312,8 @@ remoteDispatchNumOfSecrets(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfSecrets(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -7601,9 +7353,8 @@ remoteDispatchListSecrets(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListSecrets(conn, ret->uuids.uuids_val,
args->maxuuids);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->uuids.uuids_len = len;
rv = 0;
@@ -7634,9 +7385,8 @@ remoteDispatchSecretDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = virSecretDefineXML(conn, args->xml, args->flags);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
rv = 0;
@@ -7669,14 +7419,12 @@ remoteDispatchSecretGetValue(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
value = virSecretGetValue(secret, &value_size, args->flags);
- if (value == NULL) {
+ if (value == NULL)
goto cleanup;
- }
ret->value.value_len = value_size;
ret->value.value_val = (char *)value;
@@ -7709,13 +7457,11 @@ remoteDispatchSecretGetXmlDesc(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
ret->xml = virSecretGetXMLDesc(secret, args->flags);
- if (ret->xml == NULL) {
+ if (ret->xml == NULL)
goto cleanup;
- }
rv = 0;
@@ -7745,9 +7491,8 @@ remoteDispatchSecretLookupByUuid(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = virSecretLookupByUUID(conn, (unsigned char *)args->uuid);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
@@ -7779,13 +7524,11 @@ remoteDispatchSecretSetValue(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
if (virSecretSetValue(secret, (const unsigned char *)args->value.value_val,
- args->value.value_len, args->flags) < 0) {
+ args->value.value_len, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -7815,12 +7558,10 @@ remoteDispatchSecretUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
- if (virSecretUndefine(secret) < 0) {
+ if (virSecretUndefine(secret) < 0)
goto cleanup;
- }
rv = 0;
@@ -7850,9 +7591,8 @@ remoteDispatchSecretLookupByUsage(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
secret = virSecretLookupByUsage(conn, args->usageType, args->usageID);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
@@ -7884,15 +7624,13 @@ static int remoteDispatchDomainIsActive(struct qemud_server
*server ATTRIBUTE_UN
}
domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
ret->active = virDomainIsActive(domain);
- if (ret->active < 0) {
+ if (ret->active < 0)
goto cleanup;
- }
rv = 0;
@@ -7921,15 +7659,13 @@ static int remoteDispatchDomainIsPersistent(struct qemud_server
*server ATTRIBUT
}
domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
ret->persistent = virDomainIsPersistent(domain);
- if (ret->persistent < 0) {
+ if (ret->persistent < 0)
goto cleanup;
- }
rv = 0;
@@ -7958,15 +7694,13 @@ static int remoteDispatchDomainIsUpdated(struct qemud_server
*server ATTRIBUTE_U
}
domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
ret->updated = virDomainIsUpdated(domain);
- if (ret->updated < 0) {
+ if (ret->updated < 0)
goto cleanup;
- }
rv = 0;
@@ -7995,15 +7729,13 @@ static int remoteDispatchInterfaceIsActive(struct qemud_server
*server ATTRIBUTE
}
iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
ret->active = virInterfaceIsActive(iface);
- if (ret->active < 0) {
+ if (ret->active < 0)
goto cleanup;
- }
rv = 0;
@@ -8032,15 +7764,13 @@ static int remoteDispatchNetworkIsActive(struct qemud_server
*server ATTRIBUTE_U
}
network = get_nonnull_network(conn, args->net);
- if (network == NULL) {
+ if (network == NULL)
goto cleanup;
- }
ret->active = virNetworkIsActive(network);
- if (ret->active < 0) {
+ if (ret->active < 0)
goto cleanup;
- }
rv = 0;
@@ -8069,15 +7799,13 @@ static int remoteDispatchNetworkIsPersistent(struct qemud_server
*server ATTRIBU
}
network = get_nonnull_network(conn, args->net);
- if (network == NULL) {
+ if (network == NULL)
goto cleanup;
- }
ret->persistent = virNetworkIsPersistent(network);
- if (ret->persistent < 0) {
+ if (ret->persistent < 0)
goto cleanup;
- }
rv = 0;
@@ -8106,15 +7834,13 @@ static int remoteDispatchStoragePoolIsActive(struct qemud_server
*server ATTRIBU
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
ret->active = virStoragePoolIsActive(pool);
- if (ret->active < 0) {
+ if (ret->active < 0)
goto cleanup;
- }
rv = 0;
@@ -8143,15 +7869,13 @@ static int remoteDispatchStoragePoolIsPersistent(struct
qemud_server *server ATT
}
pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
ret->persistent = virStoragePoolIsPersistent(pool);
- if (ret->persistent < 0) {
+ if (ret->persistent < 0)
goto cleanup;
- }
rv = 0;
@@ -8181,9 +7905,8 @@ static int remoteDispatchIsSecure(struct qemud_server *server
ATTRIBUTE_UNUSED,
ret->secure = virConnectIsSecure(conn);
- if (ret->secure < 0) {
+ if (ret->secure < 0)
goto cleanup;
- }
rv = 0;
@@ -8212,9 +7935,8 @@ remoteDispatchCpuCompare(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
result = virConnectCompareCPU(conn, args->xml, args->flags);
- if (result == VIR_CPU_COMPARE_ERROR) {
+ if (result == VIR_CPU_COMPARE_ERROR)
goto cleanup;
- }
ret->result = result;
rv = 0;
@@ -8247,9 +7969,8 @@ remoteDispatchCpuBaseline(struct qemud_server *server
ATTRIBUTE_UNUSED,
(const char **) args->xmlCPUs.xmlCPUs_val,
args->xmlCPUs.xmlCPUs_len,
args->flags);
- if (cpu == NULL) {
+ if (cpu == NULL)
goto cleanup;
- }
ret->cpu = cpu;
@@ -8281,13 +8002,11 @@ remoteDispatchDomainGetJobInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainGetJobInfo(dom, &info) < 0) {
+ if (virDomainGetJobInfo(dom, &info) < 0)
goto cleanup;
- }
ret->type = info.type;
ret->timeElapsed = info.timeElapsed;
@@ -8331,13 +8050,11 @@ remoteDispatchDomainAbortJob(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainAbortJob(dom) < 0) {
+ if (virDomainAbortJob(dom) < 0)
goto cleanup;
- }
rv = 0;
@@ -8368,13 +8085,11 @@ remoteDispatchDomainMigrateSetMaxDowntime(struct qemud_server
*server ATTRIBUTE_
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainMigrateSetMaxDowntime(dom, args->downtime, args->flags) < 0) {
+ if (virDomainMigrateSetMaxDowntime(dom, args->downtime, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -8404,13 +8119,11 @@ remoteDispatchDomainMigrateSetMaxSpeed(struct qemud_server *server
ATTRIBUTE_UNU
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) < 0) {
+ if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -8441,14 +8154,12 @@ remoteDispatchDomainSnapshotCreateXml(struct qemud_server *server
ATTRIBUTE_UNUS
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
snapshot = virDomainSnapshotCreateXML(domain, args->xml_desc, args->flags);
- if (snapshot == NULL) {
+ if (snapshot == NULL)
goto cleanup;
- }
make_nonnull_domain_snapshot(&ret->snap, snapshot);
@@ -8525,14 +8236,12 @@ remoteDispatchDomainSnapshotNum(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
ret->num = virDomainSnapshotNum(domain, args->flags);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -8569,9 +8278,8 @@ remoteDispatchDomainSnapshotListNames(struct qemud_server *server
ATTRIBUTE_UNUS
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
/* Allocate return buffer. */
if (VIR_ALLOC_N(ret->names.names_val, args->nameslen) < 0) {
@@ -8583,9 +8291,8 @@ remoteDispatchDomainSnapshotListNames(struct qemud_server *server
ATTRIBUTE_UNUS
ret->names.names_val,
args->nameslen,
args->flags);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -8619,14 +8326,12 @@ remoteDispatchDomainSnapshotLookupByName(struct qemud_server
*server ATTRIBUTE_U
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
snapshot = virDomainSnapshotLookupByName(domain, args->name, args->flags);
- if (snapshot == NULL) {
+ if (snapshot == NULL)
goto cleanup;
- }
make_nonnull_domain_snapshot(&ret->snap, snapshot);
@@ -8661,14 +8366,12 @@ remoteDispatchDomainHasCurrentSnapshot(struct qemud_server *server
ATTRIBUTE_UNU
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
result = virDomainHasCurrentSnapshot(domain, args->flags);
- if (result < 0) {
+ if (result < 0)
goto cleanup;
- }
ret->result = result;
@@ -8701,14 +8404,12 @@ remoteDispatchDomainSnapshotCurrent(struct qemud_server *server
ATTRIBUTE_UNUSED
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
snapshot = virDomainSnapshotCurrent(domain, args->flags);
- if (snapshot == NULL) {
+ if (snapshot == NULL)
goto cleanup;
- }
make_nonnull_domain_snapshot(&ret->snap, snapshot);
@@ -8839,9 +8540,8 @@ remoteDispatchDomainEventsRegisterAny(struct qemud_server *server
ATTRIBUTE_UNUS
NULL,
args->eventID,
domainEventCallbacks[args->eventID],
- client, NULL)) < 0) {
+ client, NULL)) < 0)
goto cleanup;
- }
client->domainEventCallbackID[args->eventID] = callbackID;
@@ -8883,9 +8583,8 @@ remoteDispatchDomainEventsDeregisterAny(struct qemud_server *server
ATTRIBUTE_UN
goto cleanup;
}
- if (virConnectDomainEventDeregisterAny(conn, callbackID) < 0) {
+ if (virConnectDomainEventDeregisterAny(conn, callbackID) < 0)
goto cleanup;
- }
client->domainEventCallbackID[args->eventID] = -1;
rv = 0;
@@ -8916,9 +8615,8 @@ remoteDispatchNwfilterLookupByName(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nwfilter = virNWFilterLookupByName(conn, args->name);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
@@ -8950,9 +8648,8 @@ remoteDispatchNwfilterLookupByUuid(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nwfilter = virNWFilterLookupByUUID(conn, (unsigned char *) args->uuid);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
@@ -8985,9 +8682,8 @@ remoteDispatchNwfilterDefineXml(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nwfilter = virNWFilterDefineXML(conn, args->xml);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
@@ -9020,13 +8716,11 @@ remoteDispatchNwfilterUndefine(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
- if (virNWFilterUndefine(nwfilter) < 0) {
+ if (virNWFilterUndefine(nwfilter) < 0)
goto cleanup;
- }
rv = 0;
@@ -9069,9 +8763,8 @@ remoteDispatchListNwfilters(struct qemud_server *server
ATTRIBUTE_UNUSED,
len = virConnectListNWFilters(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
@@ -9103,15 +8796,13 @@ remoteDispatchNwfilterGetXmlDesc(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
/* remoteDispatchClientRequest will free this. */
ret->xml = virNWFilterGetXMLDesc(nwfilter, args->flags);
- if (!ret->xml) {
+ if (!ret->xml)
goto cleanup;
- }
rv = 0;
@@ -9141,9 +8832,8 @@ remoteDispatchNumOfNwfilters(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
ret->num = virConnectNumOfNWFilters(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
@@ -9173,13 +8863,11 @@ remoteDispatchDomainGetBlockInfo(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
- if (virDomainGetBlockInfo(dom, args->path, &info, args->flags) < 0) {
+ if (virDomainGetBlockInfo(dom, args->path, &info, args->flags) < 0)
goto cleanup;
- }
ret->capacity = info.capacity;
ret->allocation = info.allocation;
@@ -9213,14 +8901,12 @@ qemuDispatchMonitorCommand(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL) {
+ if (domain == NULL)
goto cleanup;
- }
if (virDomainQemuMonitorCommand(domain, args->cmd, &ret->result,
- args->flags) < 0) {
+ args->flags) < 0)
goto cleanup;
- }
rv = 0;
@@ -9253,9 +8939,8 @@ remoteDispatchDomainOpenConsole(struct qemud_server *server
ATTRIBUTE_UNUSED,
}
dom = get_nonnull_domain(conn, args->domain);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
stream = remoteCreateClientStream(conn, hdr);
if (!stream) {
@@ -9267,13 +8952,11 @@ remoteDispatchDomainOpenConsole(struct qemud_server *server
ATTRIBUTE_UNUSED,
args->devname ? *args->devname : NULL,
stream->st,
args->flags);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
- if (remoteAddClientStream(client, stream, 1) < 0) {
+ if (remoteAddClientStream(client, stream, 1) < 0)
goto cleanup;
- }
rv = 0;
--
1.7.4.2