mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
qemu: use g_steal_pointer instead of VIR_STEAL_PTR
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
efc266883f
commit
72a1bb8e4c
@ -2163,7 +2163,7 @@ qemuAgentGetFSInfoInternal(qemuAgentPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*info, info_ret);
|
*info = g_steal_pointer(&info_ret);
|
||||||
ret = ndata;
|
ret = ndata;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -2200,7 +2200,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*info, info_ret);
|
*info = g_steal_pointer(&info_ret);
|
||||||
ret = nfs;
|
ret = nfs;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -2485,7 +2485,7 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
|
|||||||
iface->naddrs = addrs_count;
|
iface->naddrs = addrs_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*ifaces, ifaces_ret);
|
*ifaces = g_steal_pointer(&ifaces_ret);
|
||||||
ret = ifaces_count;
|
ret = ifaces_count;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -184,8 +184,8 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next,
|
|||||||
&backingdata) < 0)
|
&backingdata) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(data->backing, backingdata);
|
data->backing = g_steal_pointer(&backingdata);
|
||||||
VIR_STEAL_PTR(*nodenamedata, data);
|
*nodenamedata = g_steal_pointer(&data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1675,7 +1675,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (driveAlias) {
|
if (driveAlias) {
|
||||||
VIR_STEAL_PTR(data->driveAlias, driveAlias);
|
data->driveAlias = g_steal_pointer(&driveAlias);
|
||||||
data->driveAdded = true;
|
data->driveAdded = true;
|
||||||
} else {
|
} else {
|
||||||
data->formatNodeName = src->nodeformat;
|
data->formatNodeName = src->nodeformat;
|
||||||
@ -1704,7 +1704,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, data);
|
ret = g_steal_pointer(&data);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(driveAlias);
|
VIR_FREE(driveAlias);
|
||||||
@ -2035,7 +2035,7 @@ qemuBlockStorageSourceCreateGetFormatPropsGeneric(virStorageSourcePtr src,
|
|||||||
qemuBlockStorageSourceCreateAddBacking(backing, props, false) < 0)
|
qemuBlockStorageSourceCreateAddBacking(backing, props, false) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*retprops, props);
|
*retprops = g_steal_pointer(&props);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2076,7 +2076,7 @@ qemuBlockStorageSourceCreateGetEncryptionLUKS(virStorageSourcePtr src,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*luksProps, props);
|
*luksProps = g_steal_pointer(&props);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2097,7 +2097,7 @@ qemuBlockStorageSourceCreateGetFormatPropsLUKS(virStorageSourcePtr src,
|
|||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*props, luksprops);
|
*props = g_steal_pointer(&luksprops);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2155,7 +2155,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSourcePtr src,
|
|||||||
qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcow2props) < 0)
|
qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcow2props) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*props, qcow2props);
|
*props = g_steal_pointer(&qcow2props);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2178,7 +2178,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow(virStorageSourcePtr src,
|
|||||||
qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcowprops) < 0)
|
qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcowprops) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*props, qcowprops);
|
*props = g_steal_pointer(&qcowprops);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2200,7 +2200,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQed(virStorageSourcePtr src,
|
|||||||
if (qemuBlockStorageSourceCreateAddBacking(backing, qedprops, true) < 0)
|
if (qemuBlockStorageSourceCreateAddBacking(backing, qedprops, true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*props, qedprops);
|
*props = g_steal_pointer(&qedprops);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,7 +627,7 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnref(persistDisk->src);
|
virObjectUnref(persistDisk->src);
|
||||||
VIR_STEAL_PTR(persistDisk->src, copy);
|
persistDisk->src = g_steal_pointer(©);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1148,13 +1148,13 @@ qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDriverPtr driver,
|
|||||||
* inherit the rest of the chain */
|
* inherit the rest of the chain */
|
||||||
if (job->data.copy.shallownew &&
|
if (job->data.copy.shallownew &&
|
||||||
!virStorageSourceIsBacking(job->disk->mirror->backingStore))
|
!virStorageSourceIsBacking(job->disk->mirror->backingStore))
|
||||||
VIR_STEAL_PTR(job->disk->mirror->backingStore, job->disk->src->backingStore);
|
job->disk->mirror->backingStore = g_steal_pointer(&job->disk->src->backingStore);
|
||||||
|
|
||||||
qemuBlockJobRewriteConfigDiskSource(vm, job->disk, job->disk->mirror);
|
qemuBlockJobRewriteConfigDiskSource(vm, job->disk, job->disk->mirror);
|
||||||
|
|
||||||
qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job->disk->src);
|
qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job->disk->src);
|
||||||
virObjectUnref(job->disk->src);
|
virObjectUnref(job->disk->src);
|
||||||
VIR_STEAL_PTR(job->disk->src, job->disk->mirror);
|
job->disk->src = g_steal_pointer(&job->disk->mirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1590,7 +1590,7 @@ virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst,
|
|||||||
tmp->cbitpos = src->cbitpos;
|
tmp->cbitpos = src->cbitpos;
|
||||||
tmp->reduced_phys_bits = src->reduced_phys_bits;
|
tmp->reduced_phys_bits = src->reduced_phys_bits;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*dst, tmp);
|
*dst = g_steal_pointer(&tmp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2666,7 +2666,7 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*features, list);
|
*features = g_steal_pointer(&list);
|
||||||
if (migratable && !modelInfo->migratability)
|
if (migratable && !modelInfo->migratability)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
else
|
else
|
||||||
@ -3105,7 +3105,7 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCapsPtr qemuCaps,
|
|||||||
if (virCPUx86DataSetSignature(data, sigFamily, sigModel, sigStepping) < 0)
|
if (virCPUx86DataSetSignature(data, sigFamily, sigModel, sigStepping) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, data);
|
ret = g_steal_pointer(&data);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCPUDataFree(data);
|
virCPUDataFree(data);
|
||||||
@ -3620,7 +3620,7 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(qemuCaps->sevCapabilities, sev);
|
qemuCaps->sevCapabilities = g_steal_pointer(&sev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4561,7 +4561,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
qemuCaps->version = major * 1000000 + minor * 1000 + micro;
|
qemuCaps->version = major * 1000000 + minor * 1000 + micro;
|
||||||
VIR_STEAL_PTR(qemuCaps->package, package);
|
qemuCaps->package = g_steal_pointer(&package);
|
||||||
qemuCaps->usedQMP = true;
|
qemuCaps->usedQMP = true;
|
||||||
|
|
||||||
if (virQEMUCapsInitQMPArch(qemuCaps, mon) < 0)
|
if (virQEMUCapsInitQMPArch(qemuCaps, mon) < 0)
|
||||||
@ -5112,7 +5112,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
|
|||||||
if (retMachine)
|
if (retMachine)
|
||||||
*retMachine = machine;
|
*retMachine = machine;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, qemuCaps);
|
ret = g_steal_pointer(&qemuCaps);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnref(qemuCaps);
|
virObjectUnref(qemuCaps);
|
||||||
@ -5599,7 +5599,7 @@ virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCapsPtr qemuCaps,
|
|||||||
|
|
||||||
sev->cbitpos = cap->cbitpos;
|
sev->cbitpos = cap->cbitpos;
|
||||||
sev->reduced_phys_bits = cap->reduced_phys_bits;
|
sev->reduced_phys_bits = cap->reduced_phys_bits;
|
||||||
VIR_STEAL_PTR(domCaps->sev, sev);
|
domCaps->sev = g_steal_pointer(&sev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1335,7 +1335,7 @@ qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup,
|
|||||||
virCgroupSetCpusetMems(data->emulatorCgroup, all_nodes_str) < 0)
|
virCgroupSetCpusetMems(data->emulatorCgroup, all_nodes_str) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*retData, data);
|
*retData = g_steal_pointer(&data);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -10751,7 +10751,7 @@ qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
|
|||||||
!(data->driveAlias = qemuAliasDiskDriveFromDisk(disk)))
|
!(data->driveAlias = qemuAliasDiskDriveFromDisk(disk)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, data);
|
ret = g_steal_pointer(&data);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj,
|
|||||||
job->asyncJob = priv->job.asyncJob;
|
job->asyncJob = priv->job.asyncJob;
|
||||||
job->asyncOwner = priv->job.asyncOwner;
|
job->asyncOwner = priv->job.asyncOwner;
|
||||||
job->phase = priv->job.phase;
|
job->phase = priv->job.phase;
|
||||||
VIR_STEAL_PTR(job->migParams, priv->job.migParams);
|
job->migParams = g_steal_pointer(&priv->job.migParams);
|
||||||
job->apiFlags = priv->job.apiFlags;
|
job->apiFlags = priv->job.apiFlags;
|
||||||
|
|
||||||
qemuDomainObjResetJob(priv);
|
qemuDomainObjResetJob(priv);
|
||||||
@ -2230,7 +2230,7 @@ qemuStorageSourcePrivateDataAssignSecinfo(qemuDomainSecretInfoPtr *secinfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((*secinfo)->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES)
|
if ((*secinfo)->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES)
|
||||||
VIR_STEAL_PTR((*secinfo)->s.aes.alias, *alias);
|
(*secinfo)->s.aes.alias = g_steal_pointer(&*alias);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3345,7 +3345,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
|
|||||||
VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) < 0)
|
VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(diskPriv->migrSource, migrSource);
|
diskPriv->migrSource = g_steal_pointer(&migrSource);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3608,7 +3608,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(priv->qemuCaps, qemuCaps);
|
priv->qemuCaps = g_steal_pointer(&qemuCaps);
|
||||||
}
|
}
|
||||||
VIR_FREE(nodes);
|
VIR_FREE(nodes);
|
||||||
|
|
||||||
@ -3665,7 +3665,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
|||||||
if (qemuDomainObjPrivateXMLParseSlirpFeatures(nodes[i], ctxt, slirp) < 0)
|
if (qemuDomainObjPrivateXMLParseSlirpFeatures(nodes[i], ctxt, slirp) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
VIR_STEAL_PTR(QEMU_DOMAIN_NETWORK_PRIVATE(dev.data.net)->slirp, slirp);
|
QEMU_DOMAIN_NETWORK_PRIVATE(dev.data.net)->slirp = g_steal_pointer(&slirp);
|
||||||
}
|
}
|
||||||
VIR_FREE(nodes);
|
VIR_FREE(nodes);
|
||||||
|
|
||||||
@ -3920,7 +3920,7 @@ qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
|
|||||||
|
|
||||||
if (nsdata->num_args > 0 || nsdata->num_env > 0 ||
|
if (nsdata->num_args > 0 || nsdata->num_env > 0 ||
|
||||||
nsdata->ncapsadd > 0 || nsdata->ncapsdel > 0)
|
nsdata->ncapsadd > 0 || nsdata->ncapsdel > 0)
|
||||||
VIR_STEAL_PTR(*data, nsdata);
|
*data = g_steal_pointer(&nsdata);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -12206,11 +12206,11 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
|
|||||||
vcpupriv->node_id = info[i].node_id;
|
vcpupriv->node_id = info[i].node_id;
|
||||||
vcpupriv->vcpus = info[i].vcpus;
|
vcpupriv->vcpus = info[i].vcpus;
|
||||||
VIR_FREE(vcpupriv->type);
|
VIR_FREE(vcpupriv->type);
|
||||||
VIR_STEAL_PTR(vcpupriv->type, info[i].type);
|
vcpupriv->type = g_steal_pointer(&info[i].type);
|
||||||
VIR_FREE(vcpupriv->alias);
|
VIR_FREE(vcpupriv->alias);
|
||||||
VIR_STEAL_PTR(vcpupriv->alias, info[i].alias);
|
vcpupriv->alias = g_steal_pointer(&info[i].alias);
|
||||||
virJSONValueFree(vcpupriv->props);
|
virJSONValueFree(vcpupriv->props);
|
||||||
VIR_STEAL_PTR(vcpupriv->props, info[i].props);
|
vcpupriv->props = g_steal_pointer(&info[i].props);
|
||||||
vcpupriv->enable_id = info[i].id;
|
vcpupriv->enable_id = info[i].id;
|
||||||
vcpupriv->qemu_id = info[i].qemu_id;
|
vcpupriv->qemu_id = info[i].qemu_id;
|
||||||
|
|
||||||
@ -13178,7 +13178,7 @@ qemuDomainCreateDeviceRecursive(const char *device,
|
|||||||
}
|
}
|
||||||
VIR_FREE(devTmp);
|
VIR_FREE(devTmp);
|
||||||
VIR_FREE(target);
|
VIR_FREE(target);
|
||||||
VIR_STEAL_PTR(target, tmp);
|
target = g_steal_pointer(&tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuDomainCreateDeviceRecursive(target, data,
|
if (qemuDomainCreateDeviceRecursive(target, data,
|
||||||
@ -14157,7 +14157,7 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
VIR_FREE(fileTmp);
|
VIR_FREE(fileTmp);
|
||||||
VIR_FREE(target);
|
VIR_FREE(target);
|
||||||
VIR_STEAL_PTR(target, tmp);
|
target = g_steal_pointer(&tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.target = target;
|
data.target = target;
|
||||||
@ -14944,12 +14944,12 @@ qemuDomainFixupCPUs(virDomainObjPtr vm,
|
|||||||
|
|
||||||
if (fixedCPU) {
|
if (fixedCPU) {
|
||||||
virCPUDefFree(vm->def->cpu);
|
virCPUDefFree(vm->def->cpu);
|
||||||
VIR_STEAL_PTR(vm->def->cpu, fixedCPU);
|
vm->def->cpu = g_steal_pointer(&fixedCPU);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fixedOrig) {
|
if (fixedOrig) {
|
||||||
virCPUDefFree(*origCPU);
|
virCPUDefFree(*origCPU);
|
||||||
VIR_STEAL_PTR(*origCPU, fixedOrig);
|
*origCPU = g_steal_pointer(&fixedOrig);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -2903,7 +2903,7 @@ virQEMUSaveDataNew(char *domXML,
|
|||||||
if (VIR_ALLOC(data) < 0)
|
if (VIR_ALLOC(data) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(data->xml, domXML);
|
data->xml = g_steal_pointer(&domXML);
|
||||||
|
|
||||||
if (cookieObj &&
|
if (cookieObj &&
|
||||||
!(data->cookie = virSaveCookieFormat((virObjectPtr) cookieObj,
|
!(data->cookie = virSaveCookieFormat((virObjectPtr) cookieObj,
|
||||||
@ -5732,7 +5732,7 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver,
|
|||||||
virBitmapFree(map);
|
virBitmapFree(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*info, info_ret);
|
*info = g_steal_pointer(&info_ret);
|
||||||
ret = niothreads;
|
ret = niothreads;
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
@ -6745,9 +6745,9 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
|
|||||||
virFreeError(err);
|
virFreeError(err);
|
||||||
|
|
||||||
/* use the user provided XML */
|
/* use the user provided XML */
|
||||||
VIR_STEAL_PTR(ret, newdef);
|
ret = g_steal_pointer(&newdef);
|
||||||
} else {
|
} else {
|
||||||
VIR_STEAL_PTR(ret, newdef_migr);
|
ret = g_steal_pointer(&newdef_migr);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -8425,7 +8425,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
|
|||||||
_("domain already has a watchdog"));
|
_("domain already has a watchdog"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
VIR_STEAL_PTR(vmdef->watchdog, dev->data.watchdog);
|
vmdef->watchdog = g_steal_pointer(&dev->data.watchdog);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_INPUT:
|
case VIR_DOMAIN_DEVICE_INPUT:
|
||||||
@ -8439,7 +8439,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
|
|||||||
_("domain already has a vsock device"));
|
_("domain already has a vsock device"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
VIR_STEAL_PTR(vmdef->vsock, dev->data.vsock);
|
vmdef->vsock = g_steal_pointer(&dev->data.vsock);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_SOUND:
|
case VIR_DOMAIN_DEVICE_SOUND:
|
||||||
@ -12765,7 +12765,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (flags & VIR_MIGRATE_PEER2PEER)
|
if (flags & VIR_MIGRATE_PEER2PEER)
|
||||||
VIR_STEAL_PTR(dconnuri, uri);
|
dconnuri = g_steal_pointer(&uri);
|
||||||
|
|
||||||
/* Do not output cookies in v2 protocol, since the cookie
|
/* Do not output cookies in v2 protocol, since the cookie
|
||||||
* length was not sufficiently large, causing failures
|
* length was not sufficiently large, causing failures
|
||||||
@ -13819,8 +13819,8 @@ qemuConnectStealCPUModelFromInfo(virCPUDefPtr dst,
|
|||||||
|
|
||||||
virCPUDefFreeModel(dst);
|
virCPUDefFreeModel(dst);
|
||||||
|
|
||||||
VIR_STEAL_PTR(info, *src);
|
info = g_steal_pointer(&*src);
|
||||||
VIR_STEAL_PTR(dst->model, info->name);
|
dst->model = g_steal_pointer(&info->name);
|
||||||
|
|
||||||
for (i = 0; i < info->nprops; i++) {
|
for (i = 0; i < info->nprops; i++) {
|
||||||
char *name = info->props[i].name;
|
char *name = info->props[i].name;
|
||||||
@ -13888,7 +13888,7 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, baseline);
|
ret = g_steal_pointer(&baseline);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
qemuProcessQMPFree(proc);
|
qemuProcessQMPFree(proc);
|
||||||
@ -15506,7 +15506,7 @@ qemuDomainSnapshotDiskPrepareOne(virQEMUDriverPtr driver,
|
|||||||
return -1;
|
return -1;
|
||||||
if (backingStoreStr != NULL) {
|
if (backingStoreStr != NULL) {
|
||||||
if (virStorageIsRelative(backingStoreStr))
|
if (virStorageIsRelative(backingStoreStr))
|
||||||
VIR_STEAL_PTR(dd->relPath, backingStoreStr);
|
dd->relPath = g_steal_pointer(&backingStoreStr);
|
||||||
else
|
else
|
||||||
VIR_FREE(backingStoreStr);
|
VIR_FREE(backingStoreStr);
|
||||||
}
|
}
|
||||||
@ -15609,7 +15609,7 @@ qemuDomainSnapshotDiskPrepare(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*rdata, data);
|
*rdata = g_steal_pointer(&data);
|
||||||
*rndata = ndata;
|
*rndata = ndata;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -15662,17 +15662,17 @@ qemuDomainSnapshotDiskUpdateSource(virQEMUDriverPtr driver,
|
|||||||
/* the old disk image is now readonly */
|
/* the old disk image is now readonly */
|
||||||
dd->disk->src->readonly = true;
|
dd->disk->src->readonly = true;
|
||||||
|
|
||||||
VIR_STEAL_PTR(dd->disk->src->relPath, dd->relPath);
|
dd->disk->src->relPath = g_steal_pointer(&dd->relPath);
|
||||||
VIR_STEAL_PTR(dd->src->backingStore, dd->disk->src);
|
dd->src->backingStore = g_steal_pointer(&dd->disk->src);
|
||||||
VIR_STEAL_PTR(dd->disk->src, dd->src);
|
dd->disk->src = g_steal_pointer(&dd->src);
|
||||||
|
|
||||||
/* fix numbering of disks */
|
/* fix numbering of disks */
|
||||||
if (!blockdev)
|
if (!blockdev)
|
||||||
qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src);
|
qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src);
|
||||||
|
|
||||||
if (dd->persistdisk) {
|
if (dd->persistdisk) {
|
||||||
VIR_STEAL_PTR(dd->persistsrc->backingStore, dd->persistdisk->src);
|
dd->persistsrc->backingStore = g_steal_pointer(&dd->persistdisk->src);
|
||||||
VIR_STEAL_PTR(dd->persistdisk->src, dd->persistsrc);
|
dd->persistdisk->src = g_steal_pointer(&dd->persistsrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16765,7 +16765,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
if (!inactiveConfig)
|
if (!inactiveConfig)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
} else {
|
} else {
|
||||||
VIR_STEAL_PTR(inactiveConfig, config);
|
inactiveConfig = g_steal_pointer(&config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16872,7 +16872,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
}
|
}
|
||||||
if (config) {
|
if (config) {
|
||||||
virCPUDefFree(priv->origCPU);
|
virCPUDefFree(priv->origCPU);
|
||||||
VIR_STEAL_PTR(priv->origCPU, origCPU);
|
priv->origCPU = g_steal_pointer(&origCPU);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cookie && !cookie->slirpHelper)
|
if (cookie && !cookie->slirpHelper)
|
||||||
@ -18462,7 +18462,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
|
|||||||
/* Update vm in place to match changes. */
|
/* Update vm in place to match changes. */
|
||||||
need_unlink = false;
|
need_unlink = false;
|
||||||
virStorageFileDeinit(mirror);
|
virStorageFileDeinit(mirror);
|
||||||
VIR_STEAL_PTR(disk->mirror, mirror);
|
disk->mirror = g_steal_pointer(&mirror);
|
||||||
disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY;
|
disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY;
|
||||||
qemuBlockJobStarted(job, vm);
|
qemuBlockJobStarted(job, vm);
|
||||||
|
|
||||||
@ -18634,7 +18634,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml,
|
|||||||
VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)))
|
VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(dest, diskdef->src);
|
dest = g_steal_pointer(&diskdef->src);
|
||||||
|
|
||||||
ret = qemuDomainBlockCopyCommon(vm, dom->conn, disk, dest, bandwidth,
|
ret = qemuDomainBlockCopyCommon(vm, dom->conn, disk, dest, bandwidth,
|
||||||
granularity, buf_size, flags, false);
|
granularity, buf_size, flags, false);
|
||||||
@ -18890,7 +18890,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mirror) {
|
if (mirror) {
|
||||||
VIR_STEAL_PTR(disk->mirror, mirror);
|
disk->mirror = g_steal_pointer(&mirror);
|
||||||
disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT;
|
disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT;
|
||||||
}
|
}
|
||||||
qemuBlockJobStarted(job, vm);
|
qemuBlockJobStarted(job, vm);
|
||||||
@ -21608,7 +21608,7 @@ qemuDomainGetStats(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
tmp->nparams = virTypedParamListStealParams(params, &tmp->params);
|
tmp->nparams = virTypedParamListStealParams(params, &tmp->params);
|
||||||
VIR_STEAL_PTR(*record, tmp);
|
*record = g_steal_pointer(&tmp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21916,7 +21916,7 @@ qemuGetDHCPInterfaces(virDomainPtr dom,
|
|||||||
VIR_FREE(leases);
|
VIR_FREE(leases);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*ifaces, ifaces_ret);
|
*ifaces = g_steal_pointer(&ifaces_ret);
|
||||||
rv = ifaces_count;
|
rv = ifaces_count;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -21984,7 +21984,7 @@ qemuARPGetInterfaces(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*ifaces, ifaces_ret);
|
*ifaces = g_steal_pointer(&ifaces_ret);
|
||||||
ret = ifaces_count;
|
ret = ifaces_count;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -22700,7 +22700,7 @@ qemuGetSEVInfoToParams(virQEMUCapsPtr qemuCaps,
|
|||||||
sev->reduced_phys_bits) < 0)
|
sev->reduced_phys_bits) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*params, sevParams);
|
*params = g_steal_pointer(&sevParams);
|
||||||
*nparams = n;
|
*nparams = n;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ qemuFirmwareInterfaceParse(const char *path,
|
|||||||
VIR_DEBUG("firmware description path '%s' supported interfaces: %s",
|
VIR_DEBUG("firmware description path '%s' supported interfaces: %s",
|
||||||
path, NULLSTR_MINUS(virBufferCurrentContent(&buf)));
|
path, NULLSTR_MINUS(virBufferCurrentContent(&buf)));
|
||||||
|
|
||||||
VIR_STEAL_PTR(fw->interfaces, interfaces);
|
fw->interfaces = g_steal_pointer(&interfaces);
|
||||||
fw->ninterfaces = ninterfaces;
|
fw->ninterfaces = ninterfaces;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -553,10 +553,10 @@ qemuFirmwareTargetParse(const char *path,
|
|||||||
VIR_APPEND_ELEMENT_INPLACE(t->machines, t->nmachines, machineStr);
|
VIR_APPEND_ELEMENT_INPLACE(t->machines, t->nmachines, machineStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(targets[i], t);
|
targets[i] = g_steal_pointer(&t);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(fw->targets, targets);
|
fw->targets = g_steal_pointer(&targets);
|
||||||
fw->ntargets = ntargets;
|
fw->ntargets = ntargets;
|
||||||
ntargets = 0;
|
ntargets = 0;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -606,7 +606,7 @@ qemuFirmwareFeatureParse(const char *path,
|
|||||||
features[i] = tmp;
|
features[i] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(fw->features, features);
|
fw->features = g_steal_pointer(&features);
|
||||||
fw->nfeatures = nfeatures;
|
fw->nfeatures = nfeatures;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ qemuFirmwareParse(const char *path)
|
|||||||
if (qemuFirmwareFeatureParse(path, doc, fw) < 0)
|
if (qemuFirmwareFeatureParse(path, doc, fw) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, fw);
|
ret = g_steal_pointer(&fw);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,7 +698,7 @@ qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash)
|
|||||||
flash.format) < 0)
|
flash.format) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, json);
|
ret = g_steal_pointer(&json);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1203,9 +1203,9 @@ qemuFirmwareFetchParsedConfigs(bool privileged,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*firmwaresRet, firmwares);
|
*firmwaresRet = g_steal_pointer(&firmwares);
|
||||||
if (pathsRet)
|
if (pathsRet)
|
||||||
VIR_STEAL_PTR(*pathsRet, paths);
|
*pathsRet = g_steal_pointer(&paths);
|
||||||
return npaths;
|
return npaths;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -3274,7 +3274,7 @@ qemuDomainAttachVsockDevice(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(vm->def->vsock, vsock);
|
vm->def->vsock = g_steal_pointer(&vsock);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -6444,7 +6444,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, map);
|
ret = g_steal_pointer(&map);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virBitmapFree(map);
|
virBitmapFree(map);
|
||||||
|
@ -854,7 +854,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver,
|
|||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_STEAL_PTR(diskPriv->migrSource, copysrc);
|
diskPriv->migrSource = g_steal_pointer(©src);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3671,7 +3671,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
|||||||
if (iothread) {
|
if (iothread) {
|
||||||
qemuMigrationIOThreadPtr io;
|
qemuMigrationIOThreadPtr io;
|
||||||
|
|
||||||
VIR_STEAL_PTR(io, iothread);
|
io = g_steal_pointer(&iothread);
|
||||||
if (qemuMigrationSrcStopTunnel(io, false) < 0)
|
if (qemuMigrationSrcStopTunnel(io, false) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -4150,7 +4150,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
|
|||||||
VIR_MIGRATE_AUTO_CONVERGE);
|
VIR_MIGRATE_AUTO_CONVERGE);
|
||||||
|
|
||||||
VIR_DEBUG("Prepare3 %p", dconn);
|
VIR_DEBUG("Prepare3 %p", dconn);
|
||||||
VIR_STEAL_PTR(cookiein, cookieout);
|
cookiein = g_steal_pointer(&cookieout);
|
||||||
cookieinlen = cookieoutlen;
|
cookieinlen = cookieoutlen;
|
||||||
cookieoutlen = 0;
|
cookieoutlen = 0;
|
||||||
if (flags & VIR_MIGRATE_TUNNELLED) {
|
if (flags & VIR_MIGRATE_TUNNELLED) {
|
||||||
@ -4218,7 +4218,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
|
|||||||
VIR_DEBUG("Perform3 %p uri=%s", sconn, NULLSTR(uri));
|
VIR_DEBUG("Perform3 %p uri=%s", sconn, NULLSTR(uri));
|
||||||
qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3);
|
qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3);
|
||||||
VIR_FREE(cookiein);
|
VIR_FREE(cookiein);
|
||||||
VIR_STEAL_PTR(cookiein, cookieout);
|
cookiein = g_steal_pointer(&cookieout);
|
||||||
cookieinlen = cookieoutlen;
|
cookieinlen = cookieoutlen;
|
||||||
cookieoutlen = 0;
|
cookieoutlen = 0;
|
||||||
if (flags & VIR_MIGRATE_TUNNELLED) {
|
if (flags & VIR_MIGRATE_TUNNELLED) {
|
||||||
@ -4259,7 +4259,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
|
|||||||
*/
|
*/
|
||||||
VIR_DEBUG("Finish3 %p ret=%d", dconn, ret);
|
VIR_DEBUG("Finish3 %p ret=%d", dconn, ret);
|
||||||
VIR_FREE(cookiein);
|
VIR_FREE(cookiein);
|
||||||
VIR_STEAL_PTR(cookiein, cookieout);
|
cookiein = g_steal_pointer(&cookieout);
|
||||||
cookieinlen = cookieoutlen;
|
cookieinlen = cookieoutlen;
|
||||||
cookieoutlen = 0;
|
cookieoutlen = 0;
|
||||||
|
|
||||||
@ -4339,7 +4339,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
|
|||||||
*/
|
*/
|
||||||
VIR_DEBUG("Confirm3 %p cancelled=%d vm=%p", sconn, cancelled, vm);
|
VIR_DEBUG("Confirm3 %p cancelled=%d vm=%p", sconn, cancelled, vm);
|
||||||
VIR_FREE(cookiein);
|
VIR_FREE(cookiein);
|
||||||
VIR_STEAL_PTR(cookiein, cookieout);
|
cookiein = g_steal_pointer(&cookieout);
|
||||||
cookieinlen = cookieoutlen;
|
cookieinlen = cookieoutlen;
|
||||||
cookieoutlen = 0;
|
cookieoutlen = 0;
|
||||||
ret = qemuMigrationSrcConfirmPhase(driver, vm,
|
ret = qemuMigrationSrcConfirmPhase(driver, vm,
|
||||||
@ -5170,7 +5170,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
if (dom) {
|
if (dom) {
|
||||||
if (jobInfo) {
|
if (jobInfo) {
|
||||||
VIR_STEAL_PTR(priv->job.completed, jobInfo);
|
priv->job.completed = g_steal_pointer(&jobInfo);
|
||||||
priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
|
priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
|
||||||
priv->job.completed->statsType = QEMU_DOMAIN_JOB_STATS_TYPE_MIGRATION;
|
priv->job.completed->statsType = QEMU_DOMAIN_JOB_STATS_TYPE_MIGRATION;
|
||||||
}
|
}
|
||||||
|
@ -1183,7 +1183,7 @@ qemuMigrationCookieCapsXMLParse(xmlXPathContextPtr ctxt)
|
|||||||
VIR_FREE(automatic);
|
VIR_FREE(automatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, caps);
|
ret = g_steal_pointer(&caps);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
qemuMigrationCookieCapsFree(caps);
|
qemuMigrationCookieCapsFree(caps);
|
||||||
|
@ -1335,7 +1335,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MIGRATION_PARAM_TYPE_STRING:
|
case QEMU_MIGRATION_PARAM_TYPE_STRING:
|
||||||
VIR_STEAL_PTR(pv->value.s, value);
|
pv->value.s = g_steal_pointer(&value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1351,7 +1351,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
|
|||||||
VIR_FREE(value);
|
VIR_FREE(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*migParams, params);
|
*migParams = g_steal_pointer(¶ms);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -1826,10 +1826,10 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
|
|||||||
vcpus[mastervcpu].thread_id = hotplugvcpus[i].thread_id;
|
vcpus[mastervcpu].thread_id = hotplugvcpus[i].thread_id;
|
||||||
vcpus[mastervcpu].node_id = hotplugvcpus[i].node_id;
|
vcpus[mastervcpu].node_id = hotplugvcpus[i].node_id;
|
||||||
vcpus[mastervcpu].vcpus = hotplugvcpus[i].vcpus;
|
vcpus[mastervcpu].vcpus = hotplugvcpus[i].vcpus;
|
||||||
VIR_STEAL_PTR(vcpus[mastervcpu].qom_path, hotplugvcpus[i].qom_path);
|
vcpus[mastervcpu].qom_path = g_steal_pointer(&hotplugvcpus[i].qom_path);
|
||||||
VIR_STEAL_PTR(vcpus[mastervcpu].alias, hotplugvcpus[i].alias);
|
vcpus[mastervcpu].alias = g_steal_pointer(&hotplugvcpus[i].alias);
|
||||||
VIR_STEAL_PTR(vcpus[mastervcpu].type, hotplugvcpus[i].type);
|
vcpus[mastervcpu].type = g_steal_pointer(&hotplugvcpus[i].type);
|
||||||
VIR_STEAL_PTR(vcpus[mastervcpu].props, hotplugvcpus[i].props);
|
vcpus[mastervcpu].props = g_steal_pointer(&hotplugvcpus[i].props);
|
||||||
vcpus[mastervcpu].id = hotplugvcpus[i].enable_id;
|
vcpus[mastervcpu].id = hotplugvcpus[i].enable_id;
|
||||||
|
|
||||||
/* copy state information to slave vcpus */
|
/* copy state information to slave vcpus */
|
||||||
@ -1922,7 +1922,7 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
if (!hotplug && rc == -2) {
|
if (!hotplug && rc == -2) {
|
||||||
VIR_STEAL_PTR(*vcpus, info);
|
*vcpus = g_steal_pointer(&info);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1939,7 +1939,7 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
|
|||||||
qemuMonitorGetCPUInfoLegacy(cpuentries, ncpuentries, info, maxvcpus);
|
qemuMonitorGetCPUInfoLegacy(cpuentries, ncpuentries, info, maxvcpus);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*vcpus, info);
|
*vcpus = g_steal_pointer(&info);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -2997,7 +2997,7 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
|
|||||||
*props = NULL;
|
*props = NULL;
|
||||||
|
|
||||||
if (alias)
|
if (alias)
|
||||||
VIR_STEAL_PTR(*alias, tmp);
|
*alias = g_steal_pointer(&tmp);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
@ -4447,7 +4447,7 @@ qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon,
|
|||||||
if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0)
|
if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*retinfo, info);
|
*retinfo = g_steal_pointer(&info);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virHashFree(info);
|
virHashFree(info);
|
||||||
|
@ -1940,7 +1940,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
|
|||||||
qemuMonitorJSONExtractCPUS390Info(entry, cpus + i);
|
qemuMonitorJSONExtractCPUS390Info(entry, cpus + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*entries, cpus);
|
*entries = g_steal_pointer(&cpus);
|
||||||
*nentries = ncpus;
|
*nentries = ncpus;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -5791,7 +5791,7 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*model_info, machine_model);
|
*model_info = g_steal_pointer(&machine_model);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -6508,7 +6508,7 @@ qemuMonitorJSONGetStringListProperty(qemuMonitorPtr mon,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*strList, list);
|
*strList = g_steal_pointer(&list);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7021,7 +7021,7 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
capability->cbitpos = cbitpos;
|
capability->cbitpos = cbitpos;
|
||||||
capability->reduced_phys_bits = reduced_phys_bits;
|
capability->reduced_phys_bits = reduced_phys_bits;
|
||||||
VIR_STEAL_PTR(*capabilities, capability);
|
*capabilities = g_steal_pointer(&capability);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
cleanup:
|
cleanup:
|
||||||
virJSONValueFree(cmd);
|
virJSONValueFree(cmd);
|
||||||
@ -7867,9 +7867,9 @@ qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
|
|||||||
qemuMonitorJSONGetCPUDataDisabled(mon, translate, opaque, cpuDisabled) < 0)
|
qemuMonitorJSONGetCPUDataDisabled(mon, translate, opaque, cpuDisabled) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_STEAL_PTR(*enabled, cpuEnabled);
|
*enabled = g_steal_pointer(&cpuEnabled);
|
||||||
if (disabled)
|
if (disabled)
|
||||||
VIR_STEAL_PTR(*disabled, cpuDisabled);
|
*disabled = g_steal_pointer(&cpuDisabled);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -8571,7 +8571,7 @@ qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
qsort(info, ninfo, sizeof(*info), qemuMonitorQueryHotpluggableCpusEntrySort);
|
qsort(info, ninfo, sizeof(*info), qemuMonitorQueryHotpluggableCpusEntrySort);
|
||||||
|
|
||||||
VIR_STEAL_PTR(*entries, info);
|
*entries = g_steal_pointer(&info);
|
||||||
*nentries = ninfo;
|
*nentries = ninfo;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -9312,7 +9312,7 @@ qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data)
|
|||||||
VIR_STRDUP(job->error, errmsg) < 0)
|
VIR_STRDUP(job->error, errmsg) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, job);
|
ret = g_steal_pointer(&job);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,7 +1852,7 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
|
|
||||||
processEvent->eventType = QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED;
|
processEvent->eventType = QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED;
|
||||||
processEvent->vm = virObjectRef(vm);
|
processEvent->vm = virObjectRef(vm);
|
||||||
VIR_STEAL_PTR(processEvent->data, info);
|
processEvent->data = g_steal_pointer(&info);
|
||||||
|
|
||||||
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
|
||||||
qemuProcessEventFree(processEvent);
|
qemuProcessEventFree(processEvent);
|
||||||
@ -4313,7 +4313,7 @@ qemuProcessUpdateLiveGuestCPU(virDomainObjPtr vm,
|
|||||||
* get the original CPU via migration, restore, or snapshot revert.
|
* get the original CPU via migration, restore, or snapshot revert.
|
||||||
*/
|
*/
|
||||||
if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false))
|
if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false))
|
||||||
VIR_STEAL_PTR(priv->origCPU, orig);
|
priv->origCPU = g_steal_pointer(&orig);
|
||||||
|
|
||||||
def->cpu->check = VIR_CPU_CHECK_FULL;
|
def->cpu->check = VIR_CPU_CHECK_FULL;
|
||||||
}
|
}
|
||||||
@ -5680,7 +5680,7 @@ qemuProcessInit(virQEMUDriverPtr driver,
|
|||||||
if (qemuDomainSetPrivatePaths(driver, vm) < 0)
|
if (qemuDomainSetPrivatePaths(driver, vm) < 0)
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
||||||
VIR_STEAL_PTR(priv->origCPU, origCPU);
|
priv->origCPU = g_steal_pointer(&origCPU);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -6187,7 +6187,7 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm,
|
|||||||
|
|
||||||
virBitmapIntersect(numadNodeset, hostMemoryNodeset);
|
virBitmapIntersect(numadNodeset, hostMemoryNodeset);
|
||||||
|
|
||||||
VIR_STEAL_PTR(priv->autoNodeset, numadNodeset);
|
priv->autoNodeset = g_steal_pointer(&numadNodeset);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -8488,7 +8488,7 @@ qemuProcessQMPNew(const char *binary,
|
|||||||
proc->runGid = runGid;
|
proc->runGid = runGid;
|
||||||
proc->forceTCG = forceTCG;
|
proc->forceTCG = forceTCG;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, proc);
|
ret = g_steal_pointer(&proc);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
qemuProcessQMPFree(proc);
|
qemuProcessQMPFree(proc);
|
||||||
|
@ -206,7 +206,7 @@ qemuVhostUserParse(const char *path)
|
|||||||
if (qemuVhostUserBinaryParse(path, doc, vu) < 0)
|
if (qemuVhostUserBinaryParse(path, doc, vu) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, vu);
|
ret = g_steal_pointer(&vu);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,9 +264,9 @@ qemuVhostUserFetchParsedConfigs(bool privileged,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(*vhostuserRet, vus);
|
*vhostuserRet = g_steal_pointer(&vus);
|
||||||
if (pathsRet)
|
if (pathsRet)
|
||||||
VIR_STEAL_PTR(*pathsRet, paths);
|
*pathsRet = g_steal_pointer(&paths);
|
||||||
return npaths;
|
return npaths;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@ -313,7 +313,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUserPtr vu,
|
|||||||
features[i] = tmp;
|
features[i] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(gpu->features, features);
|
gpu->features = g_steal_pointer(&features);
|
||||||
gpu->nfeatures = nfeatures;
|
gpu->nfeatures = nfeatures;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user