goto cleanup;
}
- ret->supported = virDrvSupportsFeature(conn, args->feature);
-
- if (ret->supported < 0)
+ if ((ret->supported = virDrvSupportsFeature(conn, args->feature)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- type = virConnectGetType(conn);
- if (type == NULL)
+ if (!(type = virConnectGetType(conn)))
goto cleanup;
/* We have to strdup because remoteDispatchClientRequest will
* free this string after it's been serialised.
*/
- ret->type = strdup(type);
- if (!ret->type) {
+ if (!(ret->type = strdup(type))) {
virReportOOMError();
goto cleanup;
}
goto cleanup;
}
- hostname = virConnectGetHostname(conn);
- if (hostname == NULL)
+ if (!(hostname = virConnectGetHostname(conn)))
goto cleanup;
ret->hostname = hostname;
goto cleanup;
}
- uri = virConnectGetURI(conn);
- if (uri == NULL)
+ if (!(uri = virConnectGetURI(conn)))
goto cleanup;
ret->uri = uri;
}
flags = args->flags;
- sysinfo = virConnectGetSysinfo(conn, flags);
- if (sysinfo == NULL)
+ if (!(sysinfo = virConnectGetSysinfo(conn, flags)))
goto cleanup;
ret->sysinfo = sysinfo;
}
type = args->type ? *args->type : NULL;
- ret->max_vcpus = virConnectGetMaxVcpus(conn, type);
- if (ret->max_vcpus < 0)
+ if ((ret->max_vcpus = virConnectGetMaxVcpus(conn, type)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- caps = virConnectGetCapabilities(conn);
- if (caps == NULL)
+ if (!(caps = virConnectGetCapabilities(conn)))
goto cleanup;
ret->capabilities = caps;
remote_node_get_cells_free_memory_args *args,
remote_node_get_cells_free_memory_ret *ret)
{
- int err;
+ int len;
int rv = -1;
if (!conn) {
goto cleanup;
}
- err = virNodeGetCellsFreeMemory(conn,
+ len = virNodeGetCellsFreeMemory(conn,
(unsigned long long *)ret->freeMems.freeMems_val,
args->startCell,
args->maxCells);
- if (err <= 0)
+ if (len <= 0)
goto cleanup;
- ret->freeMems.freeMems_len = err;
+ ret->freeMems.freeMems_len = len;
rv = 0;
goto cleanup;
}
- freeMem = virNodeGetFreeMemory(conn);
- if (freeMem == 0)
+ if ((freeMem = virNodeGetFreeMemory(conn)) == 0)
goto cleanup;
ret->freeMem = freeMem;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- type = virDomainGetSchedulerType(dom, &nparams);
- if (type == NULL)
+ if (!(type = virDomainGetSchedulerType(dom, &nparams)))
goto cleanup;
ret->type = type;
{
virDomainPtr dom = NULL;
virSchedParameterPtr params = NULL;
- int i, r, nparams;
+ int i, nparams;
int rv = -1;
if (!conn) {
if (VIR_ALLOC_N(params, nparams) < 0)
goto no_memory;
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainGetSchedulerParameters(dom, params, &nparams);
- if (r < 0)
+ if (virDomainGetSchedulerParameters(dom, params, &nparams) < 0)
goto cleanup;
/* Serialise the scheduler parameters. */
void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom = NULL;
- int i, r, nparams;
virSchedParameterPtr params = NULL;
+ int i, nparams;
int rv = -1;
if (!conn) {
}
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainSetSchedulerParameters(dom, params, nparams);
- if (r < 0)
+ if (virDomainSetSchedulerParameters(dom, params, nparams) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
path = args->path;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
path = args->path;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
/* Allocate stats array for making dispatch call */
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
path = args->path;
offset = args->offset;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
offset = args->offset;
size = args->size;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainAttachDevice(dom, args->xml) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainAttachDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainUpdateDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainCreate(dom) < 0)
int rv = -1;
virDomainPtr dom = NULL;
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainCreateWithFlags(dom, args->flags) < 0)
goto cleanup;
}
- dom = virDomainCreateXML(conn, args->xml_desc, args->flags);
- if (dom == NULL)
+ if (!(dom = virDomainCreateXML(conn, args->xml_desc, args->flags)))
goto cleanup;
make_nonnull_domain(&ret->dom, dom);
goto cleanup;
}
- dom = virDomainDefineXML(conn, args->xml);
- if (dom == NULL)
+ if (!(dom = virDomainDefineXML(conn, args->xml)))
goto cleanup;
make_nonnull_domain(&ret->dom, dom);
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainDestroy(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainDetachDevice(dom, args->xml) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainDetachDeviceFlags(dom, args->xml, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virDomainGetXMLDesc(dom, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virDomainGetXMLDesc(dom, args->flags)))
goto cleanup;
rv = 0;
}
/* remoteDispatchClientRequest will free this. */
- ret->domainXml = virConnectDomainXMLFromNative(conn,
- args->nativeFormat,
- args->nativeConfig,
- args->flags);
- if (!ret->domainXml)
+ if (!(ret->domainXml = virConnectDomainXMLFromNative(conn,
+ args->nativeFormat,
+ args->nativeConfig,
+ args->flags)))
goto cleanup;
+
rv = 0;
cleanup:
}
/* remoteDispatchClientRequest will free this. */
- ret->nativeConfig = virConnectDomainXMLToNative(conn,
- args->nativeFormat,
- args->domainXml,
- args->flags);
- if (!ret->nativeConfig)
+ if (!(ret->nativeConfig = virConnectDomainXMLToNative(conn,
+ args->nativeFormat,
+ args->domainXml,
+ args->flags)))
goto cleanup;
+
rv = 0;
cleanup:
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainGetAutostart(dom, &ret->autostart) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainGetInfo(dom, &info) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->memory = virDomainGetMaxMemory(dom);
- if (ret->memory == 0)
+ if ((ret->memory = virDomainGetMaxMemory(dom)) == 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->num = virDomainGetMaxVcpus(dom);
- if (ret->num < 0)
+ if ((ret->num = virDomainGetMaxVcpus(dom)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (VIR_ALLOC(seclabel) < 0) {
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
/* remoteDispatchClientRequest will free this */
- ret->type = virDomainGetOSType(dom);
- if (ret->type == NULL)
+ if (!(ret->type = virDomainGetOSType(dom)))
goto cleanup;
+
rv = 0;
cleanup:
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (args->maxinfo > REMOTE_VCPUINFO_MAX) {
VIR_ALLOC_N(cpumaps, args->maxinfo * args->maplen) < 0)
goto no_memory;
- info_len = virDomainGetVcpus(dom,
- info, args->maxinfo,
- cpumaps, args->maplen);
- if (info_len < 0)
+ if ((info_len = virDomainGetVcpus(dom,
+ info, args->maxinfo,
+ cpumaps, args->maplen)) < 0)
goto cleanup;
/* Allocate the return buffer for info. */
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->num = virDomainGetVcpusFlags(dom, args->flags);
- if (ret->num < 0)
+ if ((ret->num = virDomainGetVcpusFlags(dom, args->flags)) < 0)
goto cleanup;
rv = 0;
remote_domain_migrate_prepare_args *args,
remote_domain_migrate_prepare_ret *ret)
{
- int r;
char *cookie = NULL;
int cookielen = 0;
char *uri_in;
goto cleanup;
}
- r = virDomainMigratePrepare(conn, &cookie, &cookielen,
+ if (virDomainMigratePrepare(conn, &cookie, &cookielen,
uri_in, uri_out,
- args->flags, dname, args->resource);
- if (r < 0)
+ args->flags, dname, args->resource) < 0)
goto cleanup;
/* remoteDispatchClientRequest will free cookie, uri_out and
remote_domain_migrate_perform_args *args,
void *ret ATTRIBUTE_UNUSED)
{
- int r;
virDomainPtr dom = NULL;
char *dname;
int rv = -1;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
dname = args->dname == NULL ? NULL : *args->dname;
- r = virDomainMigratePerform(dom,
+ if (virDomainMigratePerform(dom,
args->cookie.cookie_val,
args->cookie.cookie_len,
args->uri,
- args->flags, dname, args->resource);
- if (r < 0)
+ args->flags, dname, args->resource) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- ddom = virDomainMigrateFinish(conn, args->dname,
- args->cookie.cookie_val,
- args->cookie.cookie_len,
- args->uri,
- args->flags);
- if (ddom == NULL)
+ if (!(ddom = virDomainMigrateFinish(conn, args->dname,
+ args->cookie.cookie_val,
+ args->cookie.cookie_len,
+ args->uri,
+ args->flags)))
goto cleanup;
make_nonnull_domain(&ret->ddom, ddom);
remote_domain_migrate_prepare2_args *args,
remote_domain_migrate_prepare2_ret *ret)
{
- int r;
char *cookie = NULL;
int cookielen = 0;
char *uri_in;
goto cleanup;
}
- r = virDomainMigratePrepare2(conn, &cookie, &cookielen,
+ if (virDomainMigratePrepare2(conn, &cookie, &cookielen,
uri_in, uri_out,
args->flags, dname, args->resource,
- args->dom_xml);
- if (r < 0)
+ args->dom_xml) < 0)
goto cleanup;
/* remoteDispatchClientRequest will free cookie, uri_out and
goto cleanup;
}
- ddom = virDomainMigrateFinish2(conn, args->dname,
- args->cookie.cookie_val,
- args->cookie.cookie_len,
- args->uri,
- args->flags,
- args->retcode);
- if (ddom == NULL)
+ if (!(ddom = virDomainMigrateFinish2(conn, args->dname,
+ args->cookie.cookie_val,
+ args->cookie.cookie_len,
+ args->uri,
+ args->flags,
+ args->retcode)))
goto cleanup;
make_nonnull_domain(&ret->ddom, ddom);
remote_domain_migrate_prepare_tunnel_args *args,
void *ret ATTRIBUTE_UNUSED)
{
- int r;
char *dname;
struct qemud_client_stream *stream = NULL;
int rv = -1;
dname = args->dname == NULL ? NULL : *args->dname;
- stream = remoteCreateClientStream(conn, hdr);
- if (!stream) {
+ if (!(stream = remoteCreateClientStream(conn, hdr))) {
virReportOOMError();
goto cleanup;
}
- r = virDomainMigratePrepareTunnel(conn, stream->st,
+ if (virDomainMigratePrepareTunnel(conn, stream->st,
args->flags, dname, args->resource,
- args->dom_xml);
- if (r < 0)
+ args->dom_xml) < 0)
goto cleanup;
if (remoteAddClientStream(client, stream, 0) < 0)
goto cleanup;
}
- dom = virDomainLookupByID(conn, args->id);
- if (dom == NULL)
+ if (!(dom = virDomainLookupByID(conn, args->id)))
goto cleanup;
make_nonnull_domain(&ret->dom, dom);
goto cleanup;
}
- dom = virDomainLookupByName(conn, args->name);
- if (dom == NULL)
+ if (!(dom = virDomainLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_domain(&ret->dom, dom);
goto cleanup;
}
- dom = virDomainLookupByUUID(conn, (unsigned char *) args->uuid);
- if (dom == NULL)
+ if (!(dom = virDomainLookupByUUID(conn, (unsigned char *) args->uuid)))
goto cleanup;
make_nonnull_domain(&ret->dom, dom);
goto cleanup;
}
- ret->num = virConnectNumOfDefinedDomains(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfDefinedDomains(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (args->cpumap.cpumap_len > REMOTE_CPUMAP_MAX) {
goto cleanup;
}
- rv = virDomainPinVcpu(dom, args->vcpu,
- (unsigned char *) args->cpumap.cpumap_val,
- args->cpumap.cpumap_len);
- if (rv < 0)
+ if (virDomainPinVcpu(dom, args->vcpu,
+ (unsigned char *) args->cpumap.cpumap_val,
+ args->cpumap.cpumap_len) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainReboot(dom, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainResume(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSave(dom, args->to) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainCoreDump(dom, args->to, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetAutostart(dom, args->autostart) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetMaxMemory(dom, args->memory) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetMemory(dom, args->memory) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetMemoryFlags(dom, args->memory, args->flags) < 0)
* args, void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom = NULL;
- int i, r, nparams;
virMemoryParameterPtr params = NULL;
+ int i, nparams;
unsigned int flags;
int rv = -1;
}
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainSetMemoryParameters(dom, params, nparams, flags);
- if (r < 0)
+ if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0)
goto cleanup;
rv = 0;
{
virDomainPtr dom = NULL;
virMemoryParameterPtr params = NULL;
- int i, r, nparams;
+ int i, nparams;
unsigned int flags;
int rv = -1;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainGetMemoryParameters(dom, params, &nparams, flags);
- if (r < 0)
+ if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0)
goto cleanup;
+
/* In this case, we need to send back the number of parameters
* supported
*/
* args, void *ret ATTRIBUTE_UNUSED)
{
virDomainPtr dom = NULL;
- int i, r, nparams;
virBlkioParameterPtr params = NULL;
+ int i, nparams;
unsigned int flags;
int rv = -1;
}
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainSetBlkioParameters(dom, params, nparams, flags);
- if (r < 0)
+ if (virDomainSetBlkioParameters(dom, params, nparams, flags) < 0)
goto cleanup;
rv = 0;
{
virDomainPtr dom = NULL;
virBlkioParameterPtr params = NULL;
- int i, r, nparams;
+ int i, nparams;
unsigned int flags;
int rv = -1;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- r = virDomainGetBlkioParameters(dom, params, &nparams, flags);
- if (r < 0)
+ if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0)
goto cleanup;
+
/* In this case, we need to send back the number of parameters
* supported
*/
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetVcpus(dom, args->nvcpus) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSetVcpusFlags(dom, args->nvcpus, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainShutdown(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainSuspend(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainUndefine(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainManagedSave(dom, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->ret = virDomainHasManagedSaveImage(dom, args->flags);
- if (ret->ret < 0)
+ if ((ret->ret = virDomainHasManagedSaveImage(dom, args->flags)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainManagedSaveRemove(dom, args->flags) < 0)
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
if (virNetworkCreate(net) < 0)
goto cleanup;
}
- net = virNetworkCreateXML(conn, args->xml);
- if (net == NULL)
+ if (!(net = virNetworkCreateXML(conn, args->xml)))
goto cleanup;
make_nonnull_network(&ret->net, net);
goto cleanup;
}
- net = virNetworkDefineXML(conn, args->xml);
- if (net == NULL)
+ if (!(net = virNetworkDefineXML(conn, args->xml)))
goto cleanup;
make_nonnull_network(&ret->net, net);
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
if (virNetworkDestroy(net) < 0)
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virNetworkGetXMLDesc(net, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virNetworkGetXMLDesc(net, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
if (virNetworkGetAutostart(net, &ret->autostart) < 0)
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->name = virNetworkGetBridgeName(net);
- if (!ret->name)
+ if (!(ret->name = virNetworkGetBridgeName(net)))
goto cleanup;
rv = 0;
goto cleanup;
}
- net = virNetworkLookupByName(conn, args->name);
- if (net == NULL)
+ if (!(net = virNetworkLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_network(&ret->net, net);
goto cleanup;
}
- net = virNetworkLookupByUUID(conn, (unsigned char *) args->uuid);
- if (net == NULL)
+ if (!(net = virNetworkLookupByUUID(conn, (unsigned char *) args->uuid)))
goto cleanup;
make_nonnull_network(&ret->net, net);
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
if (virNetworkSetAutostart(net, args->autostart) < 0)
goto cleanup;
}
- net = get_nonnull_network(conn, args->net);
- if (net == NULL)
+ if (!(net = get_nonnull_network(conn, args->net)))
goto cleanup;
if (virNetworkUndefine(net) < 0)
goto cleanup;
}
- ret->num = virConnectNumOfDomains(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfDomains(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- ret->num = virConnectNumOfNetworks(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfNetworks(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- ret->num = virConnectNumOfInterfaces(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfInterfaces(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- iface = virInterfaceLookupByName(conn, args->name);
- if (iface == NULL)
+ if (!(iface = virInterfaceLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_interface(&ret->iface, iface);
goto cleanup;
}
- iface = virInterfaceLookupByMACString(conn, args->mac);
- if (iface == NULL)
+ if (!(iface = virInterfaceLookupByMACString(conn, args->mac)))
goto cleanup;
make_nonnull_interface(&ret->iface, iface);
goto cleanup;
}
- iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL)
+ if (!(iface = get_nonnull_interface(conn, args->iface)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virInterfaceGetXMLDesc(iface, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virInterfaceGetXMLDesc(iface, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- iface = virInterfaceDefineXML(conn, args->xml, args->flags);
- if (iface == NULL)
+ if (!(iface = virInterfaceDefineXML(conn, args->xml, args->flags)))
goto cleanup;
make_nonnull_interface(&ret->iface, iface);
goto cleanup;
}
- iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL)
+ if (!(iface = get_nonnull_interface(conn, args->iface)))
goto cleanup;
if (virInterfaceUndefine(iface) < 0)
goto cleanup;
}
- iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL)
+ if (!(iface = get_nonnull_interface(conn, args->iface)))
goto cleanup;
if (virInterfaceCreate(iface, args->flags) < 0)
goto cleanup;
}
- iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL)
+ if (!(iface = get_nonnull_interface(conn, args->iface)))
goto cleanup;
if (virInterfaceDestroy(iface, args->flags) < 0)
goto cleanup;
}
- ret->xml =
- virConnectFindStoragePoolSources(conn,
- args->type,
- args->srcSpec ? *args->srcSpec : NULL,
- args->flags);
- if (ret->xml == NULL)
+ if (!(ret->xml =
+ virConnectFindStoragePoolSources(conn,
+ args->type,
+ args->srcSpec ? *args->srcSpec : NULL,
+ args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolCreate(pool, args->flags) < 0)
goto cleanup;
}
- pool = virStoragePoolCreateXML(conn, args->xml, args->flags);
- if (pool == NULL)
+ if (!(pool = virStoragePoolCreateXML(conn, args->xml, args->flags)))
goto cleanup;
make_nonnull_storage_pool(&ret->pool, pool);
goto cleanup;
}
- pool = virStoragePoolDefineXML(conn, args->xml, args->flags);
- if (pool == NULL)
+ if (!(pool = virStoragePoolDefineXML(conn, args->xml, args->flags)))
goto cleanup;
make_nonnull_storage_pool(&ret->pool, pool);
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolBuild(pool, args->flags) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolDestroy(pool) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolDelete(pool, args->flags) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolRefresh(pool, args->flags) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolGetInfo(pool, &info) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virStoragePoolGetXMLDesc(pool, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virStoragePoolGetXMLDesc(pool, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolGetAutostart(pool, &ret->autostart) < 0)
goto cleanup;
}
- pool = virStoragePoolLookupByName(conn, args->name);
- if (pool == NULL)
+ if (!(pool = virStoragePoolLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_storage_pool(&ret->pool, pool);
goto cleanup;
}
- pool = virStoragePoolLookupByUUID(conn, (unsigned char *) args->uuid);
- if (pool == NULL)
+ if (!(pool = virStoragePoolLookupByUUID(conn, (unsigned char *) args->uuid)))
goto cleanup;
make_nonnull_storage_pool(&ret->pool, pool);
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
- pool = virStoragePoolLookupByVolume(vol);
- if (pool == NULL)
+ if (!(pool = virStoragePoolLookupByVolume(vol)))
goto cleanup;
make_nonnull_storage_pool(&ret->pool, pool);
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolSetAutostart(pool, args->autostart) < 0)
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
if (virStoragePoolUndefine(pool) < 0)
goto cleanup;
}
- ret->num = virConnectNumOfStoragePools(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfStoragePools(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- ret->num = virConnectNumOfDefinedStoragePools(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfDefinedStoragePools(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
/* Allocate return buffer. */
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- ret->num = virStoragePoolNumOfVolumes(pool);
- if (ret->num < 0)
+ if ((ret->num = virStoragePoolNumOfVolumes(pool)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- vol = virStorageVolCreateXML(pool, args->xml, args->flags);
- if (vol == NULL)
+ if (!(vol = virStorageVolCreateXML(pool, args->xml, args->flags)))
goto cleanup;
make_nonnull_storage_vol(&ret->vol, vol);
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- clonevol = get_nonnull_storage_vol(conn, args->clonevol);
- if (clonevol == NULL)
+ if (!(clonevol = get_nonnull_storage_vol(conn, args->clonevol)))
goto cleanup;
- newvol = virStorageVolCreateXMLFrom(pool, args->xml, clonevol,
- args->flags);
- if (newvol == NULL)
+ if (!(newvol = virStorageVolCreateXMLFrom(pool, args->xml, clonevol,
+ args->flags)))
goto cleanup;
make_nonnull_storage_vol(&ret->vol, newvol);
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
if (virStorageVolDelete(vol, args->flags) < 0)
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
if (virStorageVolWipe(vol, args->flags) < 0)
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
if (virStorageVolGetInfo(vol, &info) < 0)
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virStorageVolGetXMLDesc(vol, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virStorageVolGetXMLDesc(vol, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->name = virStorageVolGetPath(vol);
- if (!ret->name)
+ if (!(ret->name = virStorageVolGetPath(vol)))
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- vol = virStorageVolLookupByName(pool, args->name);
- if (vol == NULL)
+ if (!(vol = virStorageVolLookupByName(pool, args->name)))
goto cleanup;
make_nonnull_storage_vol(&ret->vol, vol);
goto cleanup;
}
- vol = virStorageVolLookupByKey(conn, args->key);
- if (vol == NULL)
+ if (!(vol = virStorageVolLookupByKey(conn, args->key)))
goto cleanup;
make_nonnull_storage_vol(&ret->vol, vol);
goto cleanup;
}
- vol = virStorageVolLookupByPath(conn, args->path);
- if (vol == NULL)
+ if (!(vol = virStorageVolLookupByPath(conn, args->path)))
goto cleanup;
make_nonnull_storage_vol(&ret->vol, vol);
goto cleanup;
}
- ret->num = virNodeNumOfDevices(conn,
- args->cap ? *args->cap : NULL,
- args->flags);
- if (ret->num < 0)
+ if ((ret->num = virNodeNumOfDevices(conn,
+ args->cap ? *args->cap : NULL,
+ args->flags)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_node_device(&ret->dev, dev);
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virNodeDeviceGetXMLDesc(dev, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virNodeDeviceGetXMLDesc(dev, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
parent = virNodeDeviceGetParent(dev);
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
- ret->num = virNodeDeviceNumOfCaps(dev);
- if (ret->num < 0)
+ if ((ret->num = virNodeDeviceNumOfCaps(dev)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
if (args->maxnames > REMOTE_NODE_DEVICE_NAME_LIST_MAX) {
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
if (virNodeDeviceDettach(dev) < 0)
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
if (virNodeDeviceReAttach(dev) < 0)
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
if (virNodeDeviceReset(dev) < 0)
goto cleanup;
}
- dev = virNodeDeviceCreateXML(conn, args->xml_desc, args->flags);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceCreateXML(conn, args->xml_desc, args->flags)))
goto cleanup;
make_nonnull_node_device(&ret->dev, dev);
goto cleanup;
}
- dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL)
+ if (!(dev = virNodeDeviceLookupByName(conn, args->name)))
goto cleanup;
if (virNodeDeviceDestroy(dev) < 0)
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
- stream = remoteCreateClientStream(conn, hdr);
- if (!stream)
+ if (!(stream = remoteCreateClientStream(conn, hdr)))
goto cleanup;
if (virStorageVolUpload(vol, stream->st,
goto cleanup;
}
- vol = get_nonnull_storage_vol(conn, args->vol);
- if (vol == NULL)
+ if (!(vol = get_nonnull_storage_vol(conn, args->vol)))
goto cleanup;
- stream = remoteCreateClientStream(conn, hdr);
- if (!stream)
+ if (!(stream = remoteCreateClientStream(conn, hdr)))
goto cleanup;
if (virStorageVolDownload(vol, stream->st,
goto cleanup;
}
- ret->num = virConnectNumOfSecrets(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfSecrets(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- secret = virSecretDefineXML(conn, args->xml, args->flags);
- if (secret == NULL)
+ if (!(secret = virSecretDefineXML(conn, args->xml, args->flags)))
goto cleanup;
make_nonnull_secret(&ret->secret, secret);
goto cleanup;
}
- secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL)
+ if (!(secret = get_nonnull_secret(conn, args->secret)))
goto cleanup;
- value = virSecretGetValue(secret, &value_size, args->flags);
- if (value == NULL)
+ if (!(value = virSecretGetValue(secret, &value_size, args->flags)))
goto cleanup;
ret->value.value_len = value_size;
goto cleanup;
}
- secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL)
+ if (!(secret = get_nonnull_secret(conn, args->secret)))
goto cleanup;
- ret->xml = virSecretGetXMLDesc(secret, args->flags);
- if (ret->xml == NULL)
+ if (!(ret->xml = virSecretGetXMLDesc(secret, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- secret = virSecretLookupByUUID(conn, (unsigned char *)args->uuid);
- if (secret == NULL)
+ if (!(secret = virSecretLookupByUUID(conn, (unsigned char *)args->uuid)))
goto cleanup;
make_nonnull_secret(&ret->secret, secret);
goto cleanup;
}
- secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL)
+ if (!(secret = get_nonnull_secret(conn, args->secret)))
goto cleanup;
if (virSecretSetValue(secret, (const unsigned char *)args->value.value_val,
args->value.value_len, args->flags) < 0)
goto cleanup;
}
- secret = get_nonnull_secret(conn, args->secret);
- if (secret == NULL)
+ if (!(secret = get_nonnull_secret(conn, args->secret)))
goto cleanup;
if (virSecretUndefine(secret) < 0)
goto cleanup;
goto cleanup;
}
- secret = virSecretLookupByUsage(conn, args->usageType, args->usageID);
- if (secret == NULL)
+ if (!(secret = virSecretLookupByUsage(conn, args->usageType, args->usageID)))
goto cleanup;
make_nonnull_secret(&ret->secret, secret);
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->active = virDomainIsActive(domain);
-
- if (ret->active < 0)
+ if ((ret->active = virDomainIsActive(domain)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->persistent = virDomainIsPersistent(domain);
-
- if (ret->persistent < 0)
+ if ((ret->persistent = virDomainIsPersistent(domain)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->dom);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->dom)))
goto cleanup;
- ret->updated = virDomainIsUpdated(domain);
-
- if (ret->updated < 0)
+ if ((ret->updated = virDomainIsUpdated(domain)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- iface = get_nonnull_interface(conn, args->iface);
- if (iface == NULL)
+ if (!(iface = get_nonnull_interface(conn, args->iface)))
goto cleanup;
- ret->active = virInterfaceIsActive(iface);
-
- if (ret->active < 0)
+ if ((ret->active = virInterfaceIsActive(iface)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- network = get_nonnull_network(conn, args->net);
- if (network == NULL)
+ if (!(network = get_nonnull_network(conn, args->net)))
goto cleanup;
- ret->active = virNetworkIsActive(network);
-
- if (ret->active < 0)
+ if ((ret->active = virNetworkIsActive(network)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- network = get_nonnull_network(conn, args->net);
- if (network == NULL)
+ if (!(network = get_nonnull_network(conn, args->net)))
goto cleanup;
- ret->persistent = virNetworkIsPersistent(network);
-
- if (ret->persistent < 0)
+ if ((ret->persistent = virNetworkIsPersistent(network)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- ret->active = virStoragePoolIsActive(pool);
-
- if (ret->active < 0)
+ if ((ret->active = virStoragePoolIsActive(pool)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- pool = get_nonnull_storage_pool(conn, args->pool);
- if (pool == NULL)
+ if (!(pool = get_nonnull_storage_pool(conn, args->pool)))
goto cleanup;
- ret->persistent = virStoragePoolIsPersistent(pool);
-
- if (ret->persistent < 0)
+ if ((ret->persistent = virStoragePoolIsPersistent(pool)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- ret->secure = virConnectIsSecure(conn);
-
- if (ret->secure < 0)
+ if ((ret->secure = virConnectIsSecure(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- result = virConnectCompareCPU(conn, args->xml, args->flags);
- if (result == VIR_CPU_COMPARE_ERROR)
+ if ((result = virConnectCompareCPU(conn, args->xml, args->flags)) == VIR_CPU_COMPARE_ERROR)
goto cleanup;
ret->result = result;
goto cleanup;
}
- cpu = virConnectBaselineCPU(conn,
- (const char **) args->xmlCPUs.xmlCPUs_val,
- args->xmlCPUs.xmlCPUs_len,
- args->flags);
- if (cpu == NULL)
+ if (!(cpu = virConnectBaselineCPU(conn,
+ (const char **) args->xmlCPUs.xmlCPUs_val,
+ args->xmlCPUs.xmlCPUs_len,
+ args->flags)))
goto cleanup;
ret->cpu = cpu;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainGetJobInfo(dom, &info) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainAbortJob(dom) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainMigrateSetMaxDowntime(dom, args->downtime, args->flags) < 0)
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) < 0)
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
- snapshot = virDomainSnapshotCreateXML(domain, args->xml_desc, args->flags);
- if (snapshot == NULL)
+ if (!(snapshot = virDomainSnapshotCreateXML(domain, args->xml_desc, args->flags)))
goto cleanup;
make_nonnull_domain_snapshot(&ret->snap, snapshot);
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->snap.domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->snap.domain)))
goto cleanup;
- snapshot = get_nonnull_domain_snapshot(domain, args->snap);
- if (snapshot == NULL)
+ if (!(snapshot = get_nonnull_domain_snapshot(domain, args->snap)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virDomainSnapshotGetXMLDesc(snapshot, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virDomainSnapshotGetXMLDesc(snapshot, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
- ret->num = virDomainSnapshotNum(domain, args->flags);
- if (ret->num < 0)
+ if ((ret->num = virDomainSnapshotNum(domain, args->flags)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
/* Allocate return buffer. */
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
- snapshot = virDomainSnapshotLookupByName(domain, args->name, args->flags);
- if (snapshot == NULL)
+ if (!(snapshot = virDomainSnapshotLookupByName(domain, args->name, args->flags)))
goto cleanup;
make_nonnull_domain_snapshot(&ret->snap, snapshot);
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
result = virDomainHasCurrentSnapshot(domain, args->flags);
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
- snapshot = virDomainSnapshotCurrent(domain, args->flags);
- if (snapshot == NULL)
+ if (!(snapshot = virDomainSnapshotCurrent(domain, args->flags)))
goto cleanup;
make_nonnull_domain_snapshot(&ret->snap, snapshot);
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->snap.domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->snap.domain)))
goto cleanup;
- snapshot = get_nonnull_domain_snapshot(domain, args->snap);
- if (snapshot == NULL)
+ if (!(snapshot = get_nonnull_domain_snapshot(domain, args->snap)))
goto cleanup;
if (virDomainRevertToSnapshot(snapshot, args->flags) < 0)
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->snap.domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->snap.domain)))
goto cleanup;
- snapshot = get_nonnull_domain_snapshot(domain, args->snap);
- if (snapshot == NULL)
+ if (!(snapshot = get_nonnull_domain_snapshot(domain, args->snap)))
goto cleanup;
if (virDomainSnapshotDelete(snapshot, args->flags) < 0)
goto cleanup;
}
- callbackID = client->domainEventCallbackID[args->eventID];
- if (callbackID < 0) {
+ if ((callbackID = client->domainEventCallbackID[args->eventID]) < 0) {
virNetError(VIR_ERR_INTERNAL_ERROR, _("domain event %d not registered"), args->eventID);
goto cleanup;
}
goto cleanup;
}
- nwfilter = virNWFilterLookupByName(conn, args->name);
- if (nwfilter == NULL)
+ if (!(nwfilter = virNWFilterLookupByName(conn, args->name)))
goto cleanup;
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
goto cleanup;
}
- nwfilter = virNWFilterLookupByUUID(conn, (unsigned char *) args->uuid);
- if (nwfilter == NULL)
+ if (!(nwfilter = virNWFilterLookupByUUID(conn, (unsigned char *) args->uuid)))
goto cleanup;
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
goto cleanup;
}
- nwfilter = virNWFilterDefineXML(conn, args->xml);
- if (nwfilter == NULL)
+ if (!(nwfilter = virNWFilterDefineXML(conn, args->xml)))
goto cleanup;
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
goto cleanup;
}
- nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
- if (nwfilter == NULL)
+ if (!(nwfilter = get_nonnull_nwfilter(conn, args->nwfilter)))
goto cleanup;
if (virNWFilterUndefine(nwfilter) < 0)
goto cleanup;
}
- nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
- if (nwfilter == NULL)
+ if (!(nwfilter = get_nonnull_nwfilter(conn, args->nwfilter)))
goto cleanup;
/* remoteDispatchClientRequest will free this. */
- ret->xml = virNWFilterGetXMLDesc(nwfilter, args->flags);
- if (!ret->xml)
+ if (!(ret->xml = virNWFilterGetXMLDesc(nwfilter, args->flags)))
goto cleanup;
rv = 0;
goto cleanup;
}
- ret->num = virConnectNumOfNWFilters(conn);
- if (ret->num < 0)
+ if ((ret->num = virConnectNumOfNWFilters(conn)) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainGetBlockInfo(dom, args->path, &info, args->flags) < 0)
goto cleanup;
}
- domain = get_nonnull_domain(conn, args->domain);
- if (domain == NULL)
+ if (!(domain = get_nonnull_domain(conn, args->domain)))
goto cleanup;
if (virDomainQemuMonitorCommand(domain, args->cmd, &ret->result,
remote_domain_open_console_args *args,
void *ret ATTRIBUTE_UNUSED)
{
- int r;
struct qemud_client_stream *stream = NULL;
virDomainPtr dom = NULL;
int rv = -1;
goto cleanup;
}
- dom = get_nonnull_domain(conn, args->domain);
- if (dom == NULL)
+ if (!(dom = get_nonnull_domain(conn, args->domain)))
goto cleanup;
- stream = remoteCreateClientStream(conn, hdr);
- if (!stream) {
+ if (!(stream = remoteCreateClientStream(conn, hdr))) {
virReportOOMError();
goto cleanup;
}
- r = virDomainOpenConsole(dom,
+ if (virDomainOpenConsole(dom,
args->devname ? *args->devname : NULL,
stream->st,
- args->flags);
- if (r < 0)
+ args->flags) < 0)
goto cleanup;
if (remoteAddClientStream(client, stream, 1) < 0)