ret->supported = virDrvSupportsFeature(conn, args->feature);
- if (ret->supported == -1) {
+ if (ret->supported < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virConnectGetVersion(conn, &hvVer) == -1) {
+ if (virConnectGetVersion(conn, &hvVer) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virConnectGetLibVersion(conn, &libVer) == -1) {
+ if (virConnectGetLibVersion(conn, &libVer) < 0) {
goto cleanup;
}
type = args->type ? *args->type : NULL;
ret->max_vcpus = virConnectGetMaxVcpus(conn, type);
- if (ret->max_vcpus == -1) {
+ if (ret->max_vcpus < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNodeGetInfo(conn, &info) == -1) {
+ if (virNodeGetInfo(conn, &info) < 0) {
goto cleanup;
}
}
r = virDomainGetSchedulerParameters(dom, params, &nparams);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
}
r = virDomainSetSchedulerParameters(dom, params, nparams);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
}
path = args->path;
- if (virDomainBlockStats(dom, path, &stats, sizeof stats) == -1) {
+ if (virDomainBlockStats(dom, path, &stats, sizeof stats) < 0) {
goto cleanup;
}
}
path = args->path;
- if (virDomainInterfaceStats(dom, path, &stats, sizeof stats) == -1) {
+ if (virDomainInterfaceStats(dom, path, &stats, sizeof stats) < 0) {
goto cleanup;
}
{
virDomainPtr dom = NULL;
struct _virDomainMemoryStat *stats;
- unsigned int nr_stats, i;
+ int nr_stats, i;
int rv = -1;
if (!conn) {
}
nr_stats = virDomainMemoryStats(dom, stats, args->maxStats, 0);
- if (nr_stats == -1) {
+ if (nr_stats < 0) {
goto cleanup;
}
}
if (virDomainBlockPeek(dom, path, offset, size,
- ret->buffer.buffer_val, flags) == -1) {
+ ret->buffer.buffer_val, flags) < 0) {
goto cleanup;
}
}
if (virDomainMemoryPeek(dom, offset, size,
- ret->buffer.buffer_val, flags) == -1) {
+ ret->buffer.buffer_val, flags) < 0) {
goto cleanup;
}
if (dom)
goto cleanup;
}
- if (virDomainAttachDevice(dom, args->xml) == -1) {
+ if (virDomainAttachDevice(dom, args->xml) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainAttachDeviceFlags(dom, args->xml, args->flags) == -1) {
+ if (virDomainAttachDeviceFlags(dom, args->xml, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainUpdateDeviceFlags(dom, args->xml, args->flags) == -1) {
+ if (virDomainUpdateDeviceFlags(dom, args->xml, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainCreate(dom) == -1) {
+ if (virDomainCreate(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainCreateWithFlags(dom, args->flags) == -1) {
+ if (virDomainCreateWithFlags(dom, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainDestroy(dom) == -1) {
+ if (virDomainDestroy(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainDetachDevice(dom, args->xml) == -1) {
+ if (virDomainDetachDevice(dom, args->xml) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainDetachDeviceFlags(dom, args->xml, args->flags) == -1) {
+ if (virDomainDetachDeviceFlags(dom, args->xml, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainGetAutostart(dom, &ret->autostart) == -1) {
+ if (virDomainGetAutostart(dom, &ret->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainGetInfo(dom, &info) == -1) {
+ if (virDomainGetInfo(dom, &info) < 0) {
goto cleanup;
}
}
ret->num = virDomainGetMaxVcpus(dom);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainGetSecurityLabel(dom, seclabel) == -1) {
+ if (virDomainGetSecurityLabel(dom, seclabel) < 0) {
goto cleanup;
}
}
memset(&secmodel, 0, sizeof secmodel);
- if (virNodeGetSecurityModel(conn, &secmodel) == -1) {
+ if (virNodeGetSecurityModel(conn, &secmodel) < 0) {
goto cleanup;
}
info_len = virDomainGetVcpus(dom,
info, args->maxinfo,
cpumaps, args->maplen);
- if (info_len == -1) {
+ if (info_len < 0) {
goto cleanup;
}
}
ret->num = virDomainGetVcpusFlags(dom, args->flags);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
r = virDomainMigratePrepare(conn, &cookie, &cookielen,
uri_in, uri_out,
args->flags, dname, args->resource);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
args->cookie.cookie_len,
args->uri,
args->flags, dname, args->resource);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
uri_in, uri_out,
args->flags, dname, args->resource,
args->dom_xml);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
r = virDomainMigratePrepareTunnel(conn, stream->st,
args->flags, dname, args->resource,
args->dom_xml);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
remote_list_defined_domains_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListDefinedDomains(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListDefinedDomains(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
}
ret->num = virConnectNumOfDefinedDomains(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
rv = virDomainPinVcpu(dom, args->vcpu,
(unsigned char *) args->cpumap.cpumap_val,
args->cpumap.cpumap_len);
- if (rv == -1) {
+ if (rv < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainReboot(dom, args->flags) == -1) {
+ if (virDomainReboot(dom, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainRestore(conn, args->from) == -1) {
+ if (virDomainRestore(conn, args->from) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainResume(dom) == -1) {
+ if (virDomainResume(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSave(dom, args->to) == -1) {
+ if (virDomainSave(dom, args->to) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainCoreDump(dom, args->to, args->flags) == -1) {
+ if (virDomainCoreDump(dom, args->to, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSetAutostart(dom, args->autostart) == -1) {
+ if (virDomainSetAutostart(dom, args->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSetMaxMemory(dom, args->memory) == -1) {
+ if (virDomainSetMaxMemory(dom, args->memory) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSetMemory(dom, args->memory) == -1) {
+ if (virDomainSetMemory(dom, args->memory) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSetMemoryFlags(dom, args->memory, args->flags) == -1) {
+ if (virDomainSetMemoryFlags(dom, args->memory, args->flags) < 0) {
goto cleanup;
}
}
r = virDomainSetMemoryParameters(dom, params, nparams, flags);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
}
r = virDomainGetMemoryParameters(dom, params, &nparams, flags);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
/* In this case, we need to send back the number of parameters
}
r = virDomainSetBlkioParameters(dom, params, nparams, flags);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
}
r = virDomainGetBlkioParameters(dom, params, &nparams, flags);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}
/* In this case, we need to send back the number of parameters
goto cleanup;
}
- if (virDomainSetVcpus(dom, args->nvcpus) == -1) {
+ if (virDomainSetVcpus(dom, args->nvcpus) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSetVcpusFlags(dom, args->nvcpus, args->flags) == -1) {
+ if (virDomainSetVcpusFlags(dom, args->nvcpus, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainShutdown(dom) == -1) {
+ if (virDomainShutdown(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainSuspend(dom) == -1) {
+ if (virDomainSuspend(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainUndefine(dom) == -1) {
+ if (virDomainUndefine(dom) < 0) {
goto cleanup;
}
remote_list_defined_networks_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListDefinedNetworks(conn,
+ len = virConnectListDefinedNetworks(conn,
ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
remote_list_domains_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->ids.ids_len = virConnectListDomains(conn,
- ret->ids.ids_val, args->maxids);
- if (ret->ids.ids_len == -1) {
+ len = virConnectListDomains(conn,
+ ret->ids.ids_val, args->maxids);
+ if (len < 0) {
goto cleanup;
}
+ ret->ids.ids_len = len;
rv = 0;
goto cleanup;
}
- if (virDomainManagedSave(dom, args->flags) == -1) {
+ if (virDomainManagedSave(dom, args->flags) < 0) {
goto cleanup;
}
}
ret->ret = virDomainHasManagedSaveImage(dom, args->flags);
- if (ret->ret == -1) {
+ if (ret->ret < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainManagedSaveRemove(dom, args->flags) == -1) {
+ if (virDomainManagedSaveRemove(dom, args->flags) < 0) {
goto cleanup;
}
remote_list_networks_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListNetworks(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListNetworks(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
goto cleanup;
}
- if (virNetworkCreate(net) == -1) {
+ if (virNetworkCreate(net) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNetworkDestroy(net) == -1) {
+ if (virNetworkDestroy(net) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNetworkGetAutostart(net, &ret->autostart) == -1) {
+ if (virNetworkGetAutostart(net, &ret->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNetworkSetAutostart(net, args->autostart) == -1) {
+ if (virNetworkSetAutostart(net, args->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNetworkUndefine(net) == -1) {
+ if (virNetworkUndefine(net) < 0) {
goto cleanup;
}
remote_num_of_defined_networks_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->num = virConnectNumOfDefinedNetworks(conn);
- if (ret->num == -1) {
+ len = virConnectNumOfDefinedNetworks(conn);
+ if (len < 0) {
goto cleanup;
}
+ ret->num = len;
rv = 0;
}
ret->num = virConnectNumOfDomains(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
}
ret->num = virConnectNumOfNetworks(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
}
ret->num = virConnectNumOfInterfaces(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
remote_list_interfaces_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListInterfaces(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListInterfaces(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
remote_num_of_defined_interfaces_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->num = virConnectNumOfDefinedInterfaces(conn);
- if (ret->num == -1) {
+ len = virConnectNumOfDefinedInterfaces(conn);
+ if (len < 0) {
goto cleanup;
}
+ ret->num = len;
rv = 0;
remote_list_defined_interfaces_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListDefinedInterfaces(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListDefinedInterfaces(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
goto cleanup;
}
- if (virInterfaceUndefine(iface) == -1) {
+ if (virInterfaceUndefine(iface) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virInterfaceCreate(iface, args->flags) == -1) {
+ if (virInterfaceCreate(iface, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virInterfaceDestroy(iface, args->flags) == -1) {
+ if (virInterfaceDestroy(iface, args->flags) < 0) {
goto cleanup;
}
remote_list_defined_storage_pools_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListDefinedStoragePools(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListDefinedStoragePools(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
remote_list_storage_pools_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListStoragePools(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListStoragePools(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
goto cleanup;
}
- if (virStoragePoolCreate(pool, args->flags) == -1) {
+ if (virStoragePoolCreate(pool, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolBuild(pool, args->flags) == -1) {
+ if (virStoragePoolBuild(pool, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolDestroy(pool) == -1) {
+ if (virStoragePoolDestroy(pool) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolDelete(pool, args->flags) == -1) {
+ if (virStoragePoolDelete(pool, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolRefresh(pool, args->flags) == -1) {
+ if (virStoragePoolRefresh(pool, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolGetInfo(pool, &info) == -1) {
+ if (virStoragePoolGetInfo(pool, &info) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolGetAutostart(pool, &ret->autostart) == -1) {
+ if (virStoragePoolGetAutostart(pool, &ret->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolSetAutostart(pool, args->autostart) == -1) {
+ if (virStoragePoolSetAutostart(pool, args->autostart) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStoragePoolUndefine(pool) == -1) {
+ if (virStoragePoolUndefine(pool) < 0) {
goto cleanup;
}
}
ret->num = virConnectNumOfStoragePools(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
}
ret->num = virConnectNumOfDefinedStoragePools(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
{
virStoragePoolPtr pool = NULL;
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virStoragePoolListVolumes(pool,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virStoragePoolListVolumes(pool,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
}
ret->num = virStoragePoolNumOfVolumes(pool);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStorageVolDelete(vol, args->flags) == -1) {
+ if (virStorageVolDelete(vol, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStorageVolWipe(vol, args->flags) == -1) {
+ if (virStorageVolWipe(vol, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virStorageVolGetInfo(vol, &info) == -1) {
+ if (virStorageVolGetInfo(vol, &info) < 0) {
goto cleanup;
}
ret->num = virNodeNumOfDevices(conn,
args->cap ? *args->cap : NULL,
args->flags);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
remote_node_list_devices_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virNodeListDevices(conn,
- args->cap ? *args->cap : NULL,
- ret->names.names_val, args->maxnames, args->flags);
- if (ret->names.names_len == -1) {
+ len = virNodeListDevices(conn,
+ args->cap ? *args->cap : NULL,
+ ret->names.names_val, args->maxnames, args->flags);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
{
virNodeDevicePtr dev = NULL;
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virNodeDeviceListCaps(dev, ret->names.names_val,
- args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virNodeDeviceListCaps(dev, ret->names.names_val,
+ args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
goto cleanup;
}
- if (virNodeDeviceDettach(dev) == -1) {
+ if (virNodeDeviceDettach(dev) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNodeDeviceReAttach(dev) == -1) {
+ if (virNodeDeviceReAttach(dev) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNodeDeviceReset(dev) == -1) {
+ if (virNodeDeviceReset(dev) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virNodeDeviceDestroy(dev) == -1) {
+ if (virNodeDeviceDestroy(dev) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] == -1) {
+ if (client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] < 0) {
virNetError(VIR_ERR_INTERNAL_ERROR, _("domain event %d not registered"), VIR_DOMAIN_EVENT_ID_LIFECYCLE);
goto cleanup;
}
}
ret->num = virConnectNumOfSecrets(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
remote_list_secrets_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->uuids.uuids_len = virConnectListSecrets(conn, ret->uuids.uuids_val,
- args->maxuuids);
- if (ret->uuids.uuids_len == -1) {
+ len = virConnectListSecrets(conn, ret->uuids.uuids_val,
+ args->maxuuids);
+ if (len < 0) {
goto cleanup;
}
+ ret->uuids.uuids_len = len;
rv = 0;
goto cleanup;
}
- if (virDomainGetJobInfo(dom, &info) == -1) {
+ if (virDomainGetJobInfo(dom, &info) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainAbortJob(dom) == -1) {
+ if (virDomainAbortJob(dom) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainMigrateSetMaxDowntime(dom, args->downtime, args->flags) == -1) {
+ if (virDomainMigrateSetMaxDowntime(dom, args->downtime, args->flags) < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) == -1) {
+ if (virDomainMigrateSetMaxSpeed(dom, args->bandwidth, args->flags) < 0) {
goto cleanup;
}
}
ret->num = virDomainSnapshotNum(domain, args->flags);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
{
virDomainPtr domain = NULL;
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len = virDomainSnapshotListNames(domain,
- ret->names.names_val,
- args->nameslen,
- args->flags);
- if (ret->names.names_len == -1) {
+ len = virDomainSnapshotListNames(domain,
+ ret->names.names_val,
+ args->nameslen,
+ args->flags);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
if (snapshot == NULL)
goto cleanup;
- if (virDomainRevertToSnapshot(snapshot, args->flags) == -1)
+ if (virDomainRevertToSnapshot(snapshot, args->flags) < 0)
goto cleanup;
rv = 0;
if (snapshot == NULL)
goto cleanup;
- if (virDomainSnapshotDelete(snapshot, args->flags) == -1)
+ if (virDomainSnapshotDelete(snapshot, args->flags) < 0)
goto cleanup;
rv = 0;
goto cleanup;
}
- if (virNWFilterUndefine(nwfilter) == -1) {
+ if (virNWFilterUndefine(nwfilter) < 0) {
goto cleanup;
}
remote_list_nwfilters_ret *ret)
{
int rv = -1;
+ int len;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
- ret->names.names_len =
- virConnectListNWFilters(conn,
- ret->names.names_val, args->maxnames);
- if (ret->names.names_len == -1) {
+ len = virConnectListNWFilters(conn,
+ ret->names.names_val, args->maxnames);
+ if (len < 0) {
goto cleanup;
}
+ ret->names.names_len = len;
rv = 0;
}
ret->num = virConnectNumOfNWFilters(conn);
- if (ret->num == -1) {
+ if (ret->num < 0) {
goto cleanup;
}
goto cleanup;
}
- if (virDomainGetBlockInfo(dom, args->path, &info, args->flags) == -1) {
+ if (virDomainGetBlockInfo(dom, args->path, &info, args->flags) < 0) {
goto cleanup;
}
}
if (virDomainQemuMonitorCommand(domain, args->cmd, &ret->result,
- args->flags) == -1) {
+ args->flags) < 0) {
goto cleanup;
}
args->devname ? *args->devname : NULL,
stream->st,
args->flags);
- if (r == -1) {
+ if (r < 0) {
goto cleanup;
}