goto done;
if (outputs)
- VIR_STEAL_PTR(*outputs, ret.outputs);
+ *outputs = g_steal_pointer(&ret.outputs);
rv = ret.noutputs;
xdr_free((xdrproc_t) xdr_admin_connect_get_logging_outputs_ret, (char *) &ret);
return -1;
}
- VIR_STEAL_PTR(ret->outputs, outputs);
+ ret->outputs = g_steal_pointer(&outputs);
ret->noutputs = noutputs;
return 0;
cmd->num_args++;
}
- VIR_STEAL_PTR(*data, cmd);
+ *data = g_steal_pointer(&cmd);
ret = 0;
cleanup:
VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
model->name, NULLSTR(sigs), (unsigned long)signature);
- VIR_STEAL_PTR(cpu->model, cpuModel->model);
- VIR_STEAL_PTR(cpu->features, cpuModel->features);
+ cpu->model = g_steal_pointer(&cpuModel->model);
+ cpu->features = g_steal_pointer(&cpuModel->features);
cpu->nfeatures = cpuModel->nfeatures;
cpuModel->nfeatures = 0;
cpu->nfeatures_max = cpuModel->nfeatures_max;
VIR_MIGRATE_AUTO_CONVERGE);
VIR_DEBUG("Prepare3 %p flags=0x%x", dconn, destflags);
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
if (useParams) {
*/
VIR_DEBUG("Perform3 %p uri=%s", domain->conn, uri);
VIR_FREE(cookiein);
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
/* dconnuri not relevant in non-P2P modes, so left NULL here */
*/
VIR_DEBUG("Finish3 %p ret=%d", dconn, ret);
VIR_FREE(cookiein);
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
if (useParams) {
if (notify_source) {
VIR_DEBUG("Confirm3 %p ret=%d domain=%p", domain->conn, ret, domain);
VIR_FREE(cookiein);
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
if (useParams) {
net->bandwidth = bandwidth;
}
- VIR_STEAL_PTR(ret, net);
+ ret = g_steal_pointer(&net);
cleanup:
virDomainNetDefFree(net);
goto cleanup;
}
- VIR_STEAL_PTR(lock->privateData, priv);
+ lock->privateData = g_steal_pointer(&priv);
ret = 0;
cleanup:
virLockManagerLockDaemonPrivateFree(priv);
if (VIR_EXPAND_N(priv->resources, priv->nresources, 1) < 0)
goto cleanup;
- VIR_STEAL_PTR(priv->resources[priv->nresources-1].lockspace, newLockspace);
- VIR_STEAL_PTR(priv->resources[priv->nresources-1].name, newName);
+ priv->resources[priv->nresources-1].lockspace = g_steal_pointer(&newLockspace);
+ priv->resources[priv->nresources-1].name = g_steal_pointer(&newName);
if (flags & VIR_LOCK_MANAGER_RESOURCE_SHARED)
priv->resources[priv->nresources-1].flags |=
goto cleanup;
if (nsdata->noptions > 0)
- VIR_STEAL_PTR(*data, nsdata);
+ *data = g_steal_pointer(&nsdata);
ret = 0;
if (VIR_STRDUP(backing_device, char_ptr) < 0)
goto cleanup;
} else {
- VIR_STEAL_PTR(backing_device, ret);
+ backing_device = g_steal_pointer(&ret);
}
char_ptr = strchr(backing_device, '\n');
switch ((remoteDriverMode)mode) {
case REMOTE_DRIVER_MODE_LEGACY:
- VIR_STEAL_PTR(sock_name, legacy_sock_name);
- VIR_STEAL_PTR(*daemon, legacy_daemon);
+ sock_name = g_steal_pointer(&legacy_sock_name);
+ *daemon = g_steal_pointer(&legacy_daemon);
break;
case REMOTE_DRIVER_MODE_DIRECT:
return NULL;
}
- VIR_STEAL_PTR(sock_name, direct_sock_name);
- VIR_STEAL_PTR(*daemon, direct_daemon);
+ sock_name = g_steal_pointer(&direct_sock_name);
+ *daemon = g_steal_pointer(&direct_daemon);
break;
case REMOTE_DRIVER_MODE_AUTO:
goto error;
}
- VIR_STEAL_PTR(auth->password, pass);
+ auth->password = g_steal_pointer(&pass);
auth->filename = file;
auth->method = VIR_NET_LIBSSH_AUTH_PRIVKEY;
auth->ssh_flags = SSH_AUTH_METHOD_PUBLICKEY;
if (!(obj = virSecretObjListAdd(driver->secrets, def,
driver->configDir, &backup)))
goto cleanup;
- VIR_STEAL_PTR(objDef, def);
+ objDef = g_steal_pointer(&def);
if (!objDef->isephemeral) {
if (backup && backup->isephemeral) {
* the backup; otherwise, this is a new secret, thus remove it. */
if (backup) {
virSecretObjSetDef(obj, backup);
- VIR_STEAL_PTR(def, objDef);
+ def = g_steal_pointer(&objDef);
} else {
virSecretObjListRemove(driver->secrets, obj);
virObjectUnref(obj);
mgr->drv = drv;
mgr->flags = flags;
mgr->virtDriver = virtDriver;
- VIR_STEAL_PTR(mgr->privateData, privateData);
+ mgr->privateData = g_steal_pointer(&privateData);
if (drv->open(mgr) < 0)
goto error;
if (VIR_ALLOC(ret) < 0)
goto cleanup;
- VIR_STEAL_PTR(ret->fds, fds);
+ ret->fds = g_steal_pointer(&fds);
ret->nfds = nfds;
nfds = 0;
if (!(tmp = virStringReplace(pcontent, template_end, replace_files)))
goto clean_all;
VIR_FREE(pcontent);
- VIR_STEAL_PTR(pcontent, tmp);
+ pcontent = g_steal_pointer(&tmp);
}
/* write the file */
if ((pathtmp = mdir_name(pathdir)) == NULL)
goto cleanup;
VIR_FREE(pathdir);
- VIR_STEAL_PTR(pathdir, pathtmp);
+ pathdir = g_steal_pointer(&pathtmp);
}
if (strlen(pathdir) == 1) {
cmdopts->noptions++;
}
- VIR_STEAL_PTR(*data, cmdopts);
+ *data = g_steal_pointer(&cmdopts);
ret = 0;
cleanup:
if (S_ISDIR(st->st_mode)) {
vol->type = VIR_STORAGE_VOL_NETDIR;
vol->target.format = VIR_STORAGE_FILE_DIR;
- VIR_STEAL_PTR(*volptr, vol);
+ *volptr = g_steal_pointer(&vol);
ret = 0;
goto cleanup;
}
vol->target.compat = meta->compat;
meta->compat = NULL;
- VIR_STEAL_PTR(*volptr, vol);
+ *volptr = g_steal_pointer(&vol);
ret = 0;
cleanup:
if (fd)
goto cleanup;
}
- VIR_STEAL_PTR(*targets, tmp_targets);
+ *targets = g_steal_pointer(&tmp_targets);
*ntargets = tmp_ntargets;
tmp_ntargets = 0;
goto error;
if (portalRet)
- VIR_STEAL_PTR(*portalRet, portal);
+ *portalRet = g_steal_pointer(&portal);
cleanup:
return iscsi;
if (!(thisSource = virStoragePoolSourceListNewSource(sourceList)))
return -1;
- VIR_STEAL_PTR(thisSource->name, vgname);
+ thisSource->name = g_steal_pointer(&vgname);
}
if (VIR_REALLOC_N(thisSource->devices, thisSource->ndevice + 1) != 0)
thisSource->format = VIR_STORAGE_POOL_LOGICAL_LVM2;
memset(dev, 0, sizeof(*dev));
- VIR_STEAL_PTR(dev->path, pvname);
+ dev->path = g_steal_pointer(&pvname);
return 0;
}
cmdopts->noptions++;
}
- VIR_STEAL_PTR(*data, cmdopts);
+ *data = g_steal_pointer(&cmdopts);
ret = 0;
cleanup:
nnames = nimages;
for (i = 0; i < nimages; i++)
- VIR_STEAL_PTR(names[i], images[i].name);
+ names[i] = g_steal_pointer(&images[i].name);
return names;
if (VIR_ALLOC(vol) < 0)
goto cleanup;
- VIR_STEAL_PTR(vol->name, names[i]);
+ vol->name = g_steal_pointer(&names[i]);
r = volStorageBackendRBDRefreshVolInfo(vol, pool, ptr);
*/
if (VIR_ALLOC(cbdata) == 0) {
memcpy(cbdata->pool_uuid, def->uuid, VIR_UUID_BUFLEN);
- VIR_STEAL_PTR(cbdata->fchost_name, name);
+ cbdata->fchost_name = g_steal_pointer(&name);
if (virThreadCreate(&thread, false, virStoragePoolFCRefreshThread,
cbdata) < 0) {
VIR_INFO("Creating volume '%s' in storage pool '%s'",
newvol->name, def->name);
- VIR_STEAL_PTR(vol, newvol);
+ vol = g_steal_pointer(&newvol);
voldef = NULL;
cleanup:
VIR_INFO("Creating volume '%s' in storage pool '%s'",
newvol->name, def->name);
- VIR_STEAL_PTR(vol, newvol);
+ vol = g_steal_pointer(&newvol);
voldef = NULL;
cleanup:
buf[ret] = '\0';
- VIR_STEAL_PTR(*linkpath, buf);
+ *linkpath = g_steal_pointer(&buf);
return 0;
}
if (pooltype == VIR_STORAGE_POOL_NETFS) {
src->format = VIR_STORAGE_POOL_NETFS_GLUSTERFS;
- VIR_STEAL_PTR(src->dir, volname);
+ src->dir = g_steal_pointer(&volname);
} else if (pooltype == VIR_STORAGE_POOL_GLUSTER) {
if (VIR_STRDUP(src->dir, "/") < 0)
goto cleanup;
- VIR_STEAL_PTR(src->name, volname);
+ src->name = g_steal_pointer(&volname);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unsupported gluster lookup"));
}
virBitmapFree(target->features);
- VIR_STEAL_PTR(target->features, meta->features);
+ target->features = g_steal_pointer(&meta->features);
if (meta->compat) {
VIR_FREE(target->compat);
- VIR_STEAL_PTR(target->compat, meta->compat);
+ target->compat = g_steal_pointer(&meta->compat);
}
return 0;
}
/* This field is optional. */
privconn->auths[i].password = virXMLPropString(nodes[i], "password");
- VIR_STEAL_PTR(privconn->auths[i].username, username);
+ privconn->auths[i].username = g_steal_pointer(&username);
}
return 0;
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;
- VIR_STEAL_PTR(*ret_def, def);
+ *ret_def = g_steal_pointer(&def);
return fd;
error:
/* Switch name in domain definition. */
VIR_FREE(privdom->def->name);
- VIR_STEAL_PTR(privdom->def->name, new_dom_name);
+ privdom->def->name = g_steal_pointer(&new_dom_name);
event_new = virDomainEventLifecycleNewFromObj(privdom,
VIR_DOMAIN_EVENT_DEFINED,
VIR_FREE(bandwidth->out);
if (!net->bandwidth) {
- VIR_STEAL_PTR(net->bandwidth, bandwidth);
+ net->bandwidth = g_steal_pointer(&bandwidth);
} else {
if (bandwidth->in) {
VIR_FREE(net->bandwidth->in);
- VIR_STEAL_PTR(net->bandwidth->in, bandwidth->in);
+ net->bandwidth->in = g_steal_pointer(&bandwidth->in);
} else if (inboundSpecified) {
/* if we got here it means user requested @inbound to be cleared */
VIR_FREE(net->bandwidth->in);
}
if (bandwidth->out) {
VIR_FREE(net->bandwidth->out);
- VIR_STEAL_PTR(net->bandwidth->out, bandwidth->out);
+ net->bandwidth->out = g_steal_pointer(&bandwidth->out);
} else if (outboundSpecified) {
/* if we got here it means user requested @outbound to be cleared */
VIR_FREE(net->bandwidth->out);
info_ret[0]->ndevAlias = info_ret[1]->ndevAlias = 1;
- VIR_STEAL_PTR(*info, info_ret);
+ *info = g_steal_pointer(&info_ret);
ret = 2;
goto cleanup;
goto cleanup;
}
- VIR_STEAL_PTR(*params, par);
+ *params = g_steal_pointer(&par);
*nparams = npar;
npar = 0;
VIR_APPEND_ELEMENT_INPLACE(ifaces_ret, ifaces_count, iface);
}
- VIR_STEAL_PTR(*ifaces, ifaces_ret);
+ *ifaces = g_steal_pointer(&ifaces_ret);
ret = ifaces_count;
cleanup:
if (VIR_STRDUP(dev->parentName, def->parent) < 0)
goto cleanup;
- VIR_STEAL_PTR(ret, dev);
+ ret = g_steal_pointer(&dev);
cleanup:
virNodeDeviceObjEndAPI(&obj);
gVBoxAPI.UINetworkAdapter.GetBridgedInterface(adapter, &utf16);
VBOX_UTF16_TO_UTF8(utf16, &utf8);
- VIR_STEAL_PTR(net->data.bridge.brname, utf8);
+ net->data.bridge.brname = g_steal_pointer(&utf8);
VBOX_UTF16_FREE(utf16);
break;
gVBoxAPI.UINetworkAdapter.GetInternalNetwork(adapter, &utf16);
VBOX_UTF16_TO_UTF8(utf16, &utf8);
- VIR_STEAL_PTR(net->data.internal.name, utf8);
+ net->data.internal.name = g_steal_pointer(&utf8);
VBOX_UTF16_FREE(utf16);
break;
gVBoxAPI.UINetworkAdapter.GetHostOnlyInterface(adapter, &utf16);
VBOX_UTF16_TO_UTF8(utf16, &utf8);
- VIR_STEAL_PTR(net->data.network.name, utf8);
+ net->data.network.name = g_steal_pointer(&utf8);
VBOX_UTF16_FREE(utf16);
break;
cpu->cores = coresPerSocket;
cpu->threads = 1;
- VIR_STEAL_PTR(def->cpu, cpu);
+ def->cpu = g_steal_pointer(&cpu);
}
/* vmx:sched.cpu.affinity -> def:cpumask */
vzConnPtr privconn_list;
virMutexLock(&vz_driver_lock);
- VIR_STEAL_PTR(driver, vz_driver);
- VIR_STEAL_PTR(privconn_list, vz_conn_list);
+ driver = g_steal_pointer(&vz_driver);
+ privconn_list = g_steal_pointer(&vz_conn_list);
virMutexUnlock(&vz_driver_lock);
while (privconn_list) {
VIR_MIGRATE_PARAM_DEST_XML, dom_xml) < 0)
goto done;
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
virObjectUnlock(dom);
}
VIR_FREE(cookiein);
- VIR_STEAL_PTR(cookiein, cookieout);
+ cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
cookieoutlen = 0;
if (vzDomainMigratePerformStep(dom, driver, params, nparams, cookiein,
goto cleanup;
ip->prefix = nbits;
- VIR_STEAL_PTR(ret, ip);
+ ret = g_steal_pointer(&ip);
cleanup:
if (!ret)
goto cleanup;
}
- VIR_STEAL_PTR(ret, snapshots);
+ ret = g_steal_pointer(&snapshots);
cleanup:
virDomainSnapshotObjListFree(snapshots);
"except-interface=lo\n")))
goto fail;
VIR_FREE(actual);
- VIR_STEAL_PTR(actual, tmp);
+ actual = g_steal_pointer(&tmp);
#endif
if (virTestCompareToFile(actual, outconf) < 0)
" \"disk\": [], \"type\": \"xfs\"}]}") < 0)
goto cleanup;
- VIR_STEAL_PTR(*test, ret_test);
- VIR_STEAL_PTR(*def, ret_def);
+ *test = g_steal_pointer(&ret_test);
+ *def = g_steal_pointer(&ret_def);
ret = 0;
cleanup:
if (virDomainSnapshotDiskDefParseXML(node, ctxt, diskdef,
VIR_DOMAIN_DEF_PARSE_STATUS,
xmlopt) == 0)
- VIR_STEAL_PTR(ret, diskdef->src);
+ ret = g_steal_pointer(&diskdef->src);
virDomainSnapshotDiskDefFree(diskdef);
return ret;
0)))
return -1;
- VIR_STEAL_PTR(*vm_ret, vm);
+ *vm_ret = g_steal_pointer(&vm);
return 0;
}
fprintf(stderr, "No qemuCaps generated\n");
goto cleanup;
}
- VIR_STEAL_PTR(info->qemuCaps, qemuCaps);
+ info->qemuCaps = g_steal_pointer(&qemuCaps);
if (gic != GIC_NONE && testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
goto cleanup;
if (virStorageFileGetMetadata(def, uid, gid, false) < 0)
return NULL;
- VIR_STEAL_PTR(ret, def);
+ ret = g_steal_pointer(&def);
return ret;
}