? virConnectOpenReadOnly(name)
: virConnectOpen(name);
- if (client->conn == NULL) {
+ if (client->conn == NULL)
goto cleanup;
- }
rv = 0;
ret->supported = virDrvSupportsFeature(conn, args->feature);
- if (ret->supported < 0) {
+ if (ret->supported < 0)
goto cleanup;
- }
rv = 0;
}
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.
goto cleanup;
}
- if (virConnectGetVersion(conn, &hvVer) < 0) {
+ if (virConnectGetVersion(conn, &hvVer) < 0)
goto cleanup;
- }
ret->hv_ver = hvVer;
rv = 0;
goto cleanup;
}
- if (virConnectGetLibVersion(conn, &libVer) < 0) {
+ if (virConnectGetLibVersion(conn, &libVer) < 0)
goto cleanup;
- }
ret->lib_ver = libVer;
rv = 0;
}
hostname = virConnectGetHostname(conn);
- if (hostname == NULL) {
+ if (hostname == NULL)
goto cleanup;
- }
ret->hostname = hostname;
rv = 0;
}
uri = virConnectGetURI(conn);
- if (uri == NULL) {
+ if (uri == NULL)
goto cleanup;
- }
ret->uri = uri;
rv = 0;
flags = args->flags;
sysinfo = virConnectGetSysinfo(conn, flags);
- if (sysinfo == NULL) {
+ if (sysinfo == NULL)
goto cleanup;
- }
ret->sysinfo = sysinfo;
rv = 0;
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;
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;
}
caps = virConnectGetCapabilities(conn);
- if (caps == NULL) {
+ if (caps == NULL)
goto cleanup;
- }
ret->capabilities = caps;
rv = 0;
(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;
}
freeMem = virNodeGetFreeMemory(conn);
- if (freeMem == 0) {
+ if (freeMem == 0)
goto cleanup;
- }
ret->freeMem = freeMem;
rv = 0;
}
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;
goto no_memory;
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;
}
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;
}
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;
}
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;
}
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) {
}
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) {
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
path = args->path;
offset = args->offset;
size = args->size;
}
if (virDomainBlockPeek(dom, path, offset, size,
- ret->buffer.buffer_val, flags) < 0) {
+ ret->buffer.buffer_val, flags) < 0)
goto cleanup;
- }
rv = 0;
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
offset = args->offset;
size = args->size;
flags = args->flags;
}
if (virDomainMemoryPeek(dom, offset, size,
- ret->buffer.buffer_val, flags) < 0) {
+ ret->buffer.buffer_val, flags) < 0)
goto cleanup;
- }
if (dom)
virDomainFree(dom);
}
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;
}
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;
}
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;
}
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;
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);
}
dom = virDomainCreateXML(conn, args->xml_desc, args->flags);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
}
dom = virDomainDefineXML(conn, args->xml);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
}
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;
}
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;
}
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;
}
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;
args->nativeFormat,
args->nativeConfig,
args->flags);
- if (!ret->domainXml) {
+ if (!ret->domainXml)
goto cleanup;
- }
rv = 0;
cleanup:
args->nativeFormat,
args->domainXml,
args->flags);
- if (!ret->nativeConfig) {
+ if (!ret->nativeConfig)
goto cleanup;
- }
rv = 0;
cleanup:
}
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;
}
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;
}
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;
}
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;
}
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) {
}
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) {
}
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:
}
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"));
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;
}
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;
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.
}
dom = get_nonnull_domain(conn, args->dom);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
dname = args->dname == NULL ? NULL : *args->dname;
args->cookie.cookie_len,
args->uri,
args->flags, dname, args->resource);
- if (r < 0) {
+ if (r < 0)
goto cleanup;
- }
rv = 0;
args->cookie.cookie_len,
args->uri,
args->flags);
- if (ddom == NULL) {
+ if (ddom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->ddom, ddom);
rv = 0;
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.
args->uri,
args->flags,
args->retcode);
- if (ddom == NULL) {
+ if (ddom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->ddom, ddom);
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;
len = virConnectListDefinedDomains(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
dom = virDomainLookupByID(conn, args->id);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
}
dom = virDomainLookupByName(conn, args->name);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
}
dom = virDomainLookupByUUID(conn, (unsigned char *) args->uuid);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
make_nonnull_domain(&ret->dom, dom);
}
ret->num = virConnectNumOfDefinedDomains(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
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"));
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;
}
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;
goto cleanup;
}
- if (virDomainRestore(conn, args->from) < 0) {
+ if (virDomainRestore(conn, args->from) < 0)
goto cleanup;
- }
rv = 0;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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
*/
}
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;
}
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
*/
}
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;
}
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;
}
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;
}
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;
}
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;
len = virConnectListDefinedNetworks(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
len = virConnectListDomains(conn,
ret->ids.ids_val, args->maxids);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->ids.ids_len = len;
rv = 0;
}
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;
}
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;
}
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;
len = virConnectListNetworks(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
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;
}
net = virNetworkCreateXML(conn, args->xml);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
}
net = virNetworkDefineXML(conn, args->xml);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
}
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;
}
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;
}
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;
}
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;
}
net = virNetworkLookupByName(conn, args->name);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
}
net = virNetworkLookupByUUID(conn, (unsigned char *) args->uuid);
- if (net == NULL) {
+ if (net == NULL)
goto cleanup;
- }
make_nonnull_network(&ret->net, net);
}
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;
}
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;
}
len = virConnectNumOfDefinedNetworks(conn);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->num = len;
rv = 0;
}
ret->num = virConnectNumOfDomains(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
ret->num = virConnectNumOfNetworks(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
ret->num = virConnectNumOfInterfaces(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
len = virConnectListInterfaces(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
len = virConnectNumOfDefinedInterfaces(conn);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->num = len;
rv = 0;
len = virConnectListDefinedInterfaces(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
iface = virInterfaceLookupByName(conn, args->name);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
}
iface = virInterfaceLookupByMACString(conn, args->mac);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
}
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;
}
iface = virInterfaceDefineXML(conn, args->xml, args->flags);
- if (iface == NULL) {
+ if (iface == NULL)
goto cleanup;
- }
make_nonnull_interface(&ret->iface, iface);
}
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;
}
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;
}
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;
len = virConnectListDefinedStoragePools(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
len = virConnectListStoragePools(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
args->type,
args->srcSpec ? *args->srcSpec : NULL,
args->flags);
- if (ret->xml == NULL) {
+ if (ret->xml == NULL)
goto cleanup;
- }
rv = 0;
}
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;
}
pool = virStoragePoolCreateXML(conn, args->xml, args->flags);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
}
pool = virStoragePoolDefineXML(conn, args->xml, args->flags);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
pool = virStoragePoolLookupByName(conn, args->name);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
}
pool = virStoragePoolLookupByUUID(conn, (unsigned char *) args->uuid);
- if (pool == NULL) {
+ if (pool == NULL)
goto cleanup;
- }
make_nonnull_storage_pool(&ret->pool, pool);
}
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);
}
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;
}
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;
}
ret->num = virConnectNumOfStoragePools(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
ret->num = virConnectNumOfDefinedStoragePools(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
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) {
len = virStoragePoolListVolumes(pool,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
vol = virStorageVolLookupByKey(conn, args->key);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
}
vol = virStorageVolLookupByPath(conn, args->path);
- if (vol == NULL) {
+ if (vol == NULL)
goto cleanup;
- }
make_nonnull_storage_vol(&ret->vol, vol);
ret->num = virNodeNumOfDevices(conn,
args->cap ? *args->cap : NULL,
args->flags);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
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;
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
make_nonnull_node_device(&ret->dev, dev);
}
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;
}
dev = virNodeDeviceLookupByName(conn, args->name);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
parent = virNodeDeviceGetParent(dev);
}
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;
}
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,
len = virNodeDeviceListCaps(dev, ret->names.names_val,
args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
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;
}
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;
}
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;
}
dev = virNodeDeviceCreateXML(conn, args->xml_desc, args->flags);
- if (dev == NULL) {
+ if (dev == NULL)
goto cleanup;
- }
make_nonnull_node_device(&ret->dev, dev);
}
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;
}
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;
}
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;
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;
}
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;
}
ret->num = virConnectNumOfSecrets(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
len = virConnectListSecrets(conn, ret->uuids.uuids_val,
args->maxuuids);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->uuids.uuids_len = len;
rv = 0;
}
secret = virSecretDefineXML(conn, args->xml, args->flags);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
rv = 0;
}
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;
}
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;
}
secret = virSecretLookupByUUID(conn, (unsigned char *)args->uuid);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
}
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;
}
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;
}
secret = virSecretLookupByUsage(conn, args->usageType, args->usageID);
- if (secret == NULL) {
+ if (secret == NULL)
goto cleanup;
- }
make_nonnull_secret(&ret->secret, secret);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
ret->secure = virConnectIsSecure(conn);
- if (ret->secure < 0) {
+ if (ret->secure < 0)
goto cleanup;
- }
rv = 0;
}
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;
(const char **) args->xmlCPUs.xmlCPUs_val,
args->xmlCPUs.xmlCPUs_len,
args->flags);
- if (cpu == NULL) {
+ if (cpu == NULL)
goto cleanup;
- }
ret->cpu = cpu;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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) {
ret->names.names_val,
args->nameslen,
args->flags);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
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);
}
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;
}
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);
NULL,
args->eventID,
domainEventCallbacks[args->eventID],
- client, NULL)) < 0) {
+ client, NULL)) < 0)
goto cleanup;
- }
client->domainEventCallbackID[args->eventID] = callbackID;
goto cleanup;
}
- if (virConnectDomainEventDeregisterAny(conn, callbackID) < 0) {
+ if (virConnectDomainEventDeregisterAny(conn, callbackID) < 0)
goto cleanup;
- }
client->domainEventCallbackID[args->eventID] = -1;
rv = 0;
}
nwfilter = virNWFilterLookupByName(conn, args->name);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
}
nwfilter = virNWFilterLookupByUUID(conn, (unsigned char *) args->uuid);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
}
nwfilter = virNWFilterDefineXML(conn, args->xml);
- if (nwfilter == NULL) {
+ if (nwfilter == NULL)
goto cleanup;
- }
make_nonnull_nwfilter(&ret->nwfilter, nwfilter);
}
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;
len = virConnectListNWFilters(conn,
ret->names.names_val, args->maxnames);
- if (len < 0) {
+ if (len < 0)
goto cleanup;
- }
ret->names.names_len = len;
rv = 0;
}
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;
}
ret->num = virConnectNumOfNWFilters(conn);
- if (ret->num < 0) {
+ if (ret->num < 0)
goto cleanup;
- }
rv = 0;
}
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;
}
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;
}
dom = get_nonnull_domain(conn, args->domain);
- if (dom == NULL) {
+ if (dom == NULL)
goto cleanup;
- }
stream = remoteCreateClientStream(conn, hdr);
if (!stream) {
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;