Remove all usage of VIR_RETURN_PTR

Prefer:
    return g_steal_pointer(&ptr);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko
2019-10-16 13:35:54 +02:00
parent d402e71901
commit 483a14f871
19 changed files with 49 additions and 49 deletions

View File

@@ -16560,7 +16560,7 @@ virDomainDeviceDefParse(const char *xmlStr,
if (virDomainDeviceDefValidate(dev, def, flags, xmlopt) < 0) if (virDomainDeviceDefValidate(dev, def, flags, xmlopt) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(dev); return g_steal_pointer(&dev);
} }
@@ -21681,7 +21681,7 @@ virDomainDefParseNode(xmlDocPtr xml,
if (virDomainDefValidate(def, caps, flags, xmlopt) < 0) if (virDomainDefValidate(def, caps, flags, xmlopt) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(def); return g_steal_pointer(&def);
} }
@@ -30672,7 +30672,7 @@ virDomainNetDefToNetworkPort(virDomainDefPtr dom,
port->trustGuestRxFilters = iface->trustGuestRxFilters; port->trustGuestRxFilters = iface->trustGuestRxFilters;
VIR_RETURN_PTR(port); return g_steal_pointer(&port);
} }
int int
@@ -30925,7 +30925,7 @@ virDomainNetDefActualToNetworkPort(virDomainDefPtr dom,
port->class_id = actual->class_id; port->class_id = actual->class_id;
port->trustGuestRxFilters = actual->trustGuestRxFilters; port->trustGuestRxFilters = actual->trustGuestRxFilters;
VIR_RETURN_PTR(port); return g_steal_pointer(&port);
} }

View File

@@ -193,7 +193,7 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
&& virSecretDefParseUsage(ctxt, def) < 0) && virSecretDefParseUsage(ctxt, def) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(def); return g_steal_pointer(&def);
} }
static virSecretDefPtr static virSecretDefPtr

View File

@@ -718,7 +718,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec,
node) < 0) node) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(def); return g_steal_pointer(&def);
} }

View File

@@ -253,7 +253,7 @@ virNetworkPortDefParseXML(xmlXPathContextPtr ctxt)
return NULL; return NULL;
} }
VIR_RETURN_PTR(def); return g_steal_pointer(&def);
} }

View File

@@ -2247,5 +2247,5 @@ xenFormatXL(virDomainDefPtr def, virConnectPtr conn)
if (xenFormatXLDomainChannels(conf, def) < 0) if (xenFormatXLDomainChannels(conf, def) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(conf); return g_steal_pointer(&conf);
} }

View File

@@ -616,5 +616,5 @@ xenFormatXM(virConnectPtr conn,
if (xenFormatXMInputDevs(conf, def) < 0) if (xenFormatXMInputDevs(conf, def) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(conf); return g_steal_pointer(&conf);
} }

View File

@@ -255,7 +255,7 @@ qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes,
&data) < 0) &data) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(disks); return g_steal_pointer(&disks);
} }
@@ -380,7 +380,7 @@ qemuBlockGetNodeData(virJSONValuePtr data)
qemuBlockNamedNodesArrayToHash, nodedata) < 0) qemuBlockNamedNodesArrayToHash, nodedata) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(nodedata); return g_steal_pointer(&nodedata);
} }
@@ -449,7 +449,7 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
if (VIR_STRDUP(uri->server, src->hosts->name) < 0) if (VIR_STRDUP(uri->server, src->hosts->name) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(uri); return g_steal_pointer(&uri);
} }
@@ -514,7 +514,7 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDefPtr host,
return NULL; return NULL;
} }
VIR_RETURN_PTR(server); return g_steal_pointer(&server);
} }
@@ -550,7 +550,7 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src,
server = NULL; server = NULL;
} }
VIR_RETURN_PTR(servers); return g_steal_pointer(&servers);
} }
@@ -617,7 +617,7 @@ qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(virStorageSourcePtr src)
server = NULL; server = NULL;
} }
VIR_RETURN_PTR(servers); return g_steal_pointer(&servers);
} }
@@ -649,7 +649,7 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSourcePtr src,
virJSONValueObjectAdd(props, "u:debug", src->debugLevel, NULL) < 0) virJSONValueObjectAdd(props, "u:debug", src->debugLevel, NULL) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(props); return g_steal_pointer(&props);
} }
@@ -989,7 +989,7 @@ qemuBlockStorageSourceGetVvfatProps(virStorageSourcePtr src,
virJSONValueObjectAdd(ret, "b:rw", !src->readonly, NULL) < 0) virJSONValueObjectAdd(ret, "b:rw", !src->readonly, NULL) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(ret); return g_steal_pointer(&ret);
} }
@@ -1162,7 +1162,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
} }
} }
VIR_RETURN_PTR(fileprops); return g_steal_pointer(&fileprops);
} }
@@ -1315,7 +1315,7 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(virStorageSourcePtr src)
if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(props); return g_steal_pointer(&props);
} }
@@ -1387,7 +1387,7 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr src)
virJSONValueObjectAdd(props, "s:driver", driver, NULL) < 0) virJSONValueObjectAdd(props, "s:driver", driver, NULL) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(props); return g_steal_pointer(&props);
} }
@@ -1435,7 +1435,7 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src,
} }
} }
VIR_RETURN_PTR(props); return g_steal_pointer(&props);
} }
@@ -1496,7 +1496,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
data->storageNodeName = src->nodestorage; data->storageNodeName = src->nodestorage;
data->formatNodeName = src->nodeformat; data->formatNodeName = src->nodeformat;
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }
@@ -1753,7 +1753,7 @@ qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src)
return NULL; return NULL;
} }
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }
@@ -1781,7 +1781,7 @@ qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src,
if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, backend) < 0) if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, backend) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }

View File

@@ -118,7 +118,7 @@ qemuBlockJobDataNew(qemuBlockJobType type,
job->newstate = -1; job->newstate = -1;
job->type = type; job->type = type;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }
@@ -214,7 +214,7 @@ qemuBlockJobDiskNew(virDomainObjPtr vm,
if (qemuBlockJobRegister(job, vm, disk, true) < 0) if (qemuBlockJobRegister(job, vm, disk, true) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }
@@ -243,7 +243,7 @@ qemuBlockJobDiskNewPull(virDomainObjPtr vm,
if (qemuBlockJobRegister(job, vm, disk, true) < 0) if (qemuBlockJobRegister(job, vm, disk, true) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }
@@ -280,7 +280,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
if (qemuBlockJobRegister(job, vm, disk, true) < 0) if (qemuBlockJobRegister(job, vm, disk, true) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }
@@ -311,7 +311,7 @@ qemuBlockJobNewCreate(virDomainObjPtr vm,
if (qemuBlockJobRegister(job, vm, NULL, true) < 0) if (qemuBlockJobRegister(job, vm, NULL, true) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }
@@ -345,7 +345,7 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm,
if (qemuBlockJobRegister(job, vm, disk, true) < 0) if (qemuBlockJobRegister(job, vm, disk, true) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(job); return g_steal_pointer(&job);
} }

View File

@@ -10535,7 +10535,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
cfg->logTimestamp) cfg->logTimestamp)
virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL); virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL);
VIR_RETURN_PTR(cmd); return g_steal_pointer(&cmd);
} }
@@ -10724,7 +10724,7 @@ qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu)
virJSONValueObjectPrependString(ret, "driver", vcpupriv->type) < 0) virJSONValueObjectPrependString(ret, "driver", vcpupriv->type) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(ret); return g_steal_pointer(&ret);
} }
@@ -10824,7 +10824,7 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk,
if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem) < 0) if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }
@@ -10874,7 +10874,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top,
return NULL; return NULL;
} }
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }
@@ -10901,5 +10901,5 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top,
qemuCaps) < 0) qemuCaps) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(data); return g_steal_pointer(&data);
} }

View File

@@ -302,7 +302,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
&cfg->nfirmwares) < 0) &cfg->nfirmwares) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(cfg); return g_steal_pointer(&cfg);
} }
@@ -1292,7 +1292,7 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver)
"DOI \"%s\"", model, doi); "DOI \"%s\"", model, doi);
} }
VIR_RETURN_PTR(caps); return g_steal_pointer(&caps);
} }
@@ -1411,7 +1411,7 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver,
} }
virObjectRef(domCaps); virObjectRef(domCaps);
VIR_RETURN_PTR(domCaps); return g_steal_pointer(&domCaps);
} }

View File

@@ -48,7 +48,7 @@ qemuDBusVMStateNew(const char *id, const char *addr)
if (VIR_STRDUP(self->addr, addr) < 0) if (VIR_STRDUP(self->addr, addr) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(self); return g_steal_pointer(&self);
} }

View File

@@ -3039,7 +3039,7 @@ qemuDomainObjPrivateXMLParseBlockjobChain(xmlNodePtr node,
if (virDomainDiskBackingStoreParse(ctxt, src, xmlflags, xmlopt) < 0) if (virDomainDiskBackingStoreParse(ctxt, src, xmlflags, xmlopt) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(src); return g_steal_pointer(&src);
} }

View File

@@ -662,7 +662,7 @@ qemuInterfacePrepareSlirp(virQEMUDriverPtr driver,
return NULL; return NULL;
} }
VIR_RETURN_PTR(slirp); return g_steal_pointer(&slirp);
} }

View File

@@ -2568,7 +2568,7 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr dev,
bstats->wr_highest_offset_valid = true; bstats->wr_highest_offset_valid = true;
} }
VIR_RETURN_PTR(bstats); return g_steal_pointer(&bstats);
} }

View File

@@ -512,5 +512,5 @@ virQEMUQAPISchemaConvert(virJSONValuePtr schemareply)
schema) < 0) schema) < 0)
return NULL; return NULL;
VIR_RETURN_PTR(schema); return g_steal_pointer(&schema);
} }

View File

@@ -90,7 +90,7 @@ qemuSlirpNew(void)
slirp->pid = (pid_t)-1; slirp->pid = (pid_t)-1;
slirp->fd[0] = slirp->fd[1] = -1; slirp->fd[0] = slirp->fd[1] = -1;
VIR_RETURN_PTR(slirp); return g_steal_pointer(&slirp);
} }
@@ -141,7 +141,7 @@ qemuSlirpNewForHelper(const char *helper)
qemuSlirpSetFeature(slirp, tmp); qemuSlirpSetFeature(slirp, tmp);
} }
VIR_RETURN_PTR(slirp); return g_steal_pointer(&slirp);
} }

View File

@@ -200,7 +200,7 @@ virHostdevManagerNew(void)
umask(old_umask); umask(old_umask);
} }
VIR_RETURN_PTR(hostdevMgr); return g_steal_pointer(&hostdevMgr);
} }
virHostdevManagerPtr virHostdevManagerPtr
@@ -285,7 +285,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
pci = NULL; pci = NULL;
} }
VIR_RETURN_PTR(pcidevs); return g_steal_pointer(&pcidevs);
} }
static int static int

View File

@@ -1419,7 +1419,7 @@ virPCIDeviceNew(unsigned int domain,
VIR_DEBUG("%s %s: initialized", dev->id, dev->name); VIR_DEBUG("%s %s: initialized", dev->id, dev->name);
VIR_RETURN_PTR(dev); return g_steal_pointer(&dev);
} }

View File

@@ -126,5 +126,5 @@ virshCommaStringListComplete(const char *input,
nret++; nret++;
} }
VIR_RETURN_PTR(ret); return g_steal_pointer(&ret);
} }