diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index d23045331e59c94e36bc02da9e03ae15bd664a54..6ab79a1897bc08979e13e0945a3dcca921c385e5 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -264,7 +264,7 @@ virCgroupV1ResolveMountLink(const char *mntDir, VIR_WARN("Expecting a symlink at %s for controller %s", linkSrc, typeStr); } else { - VIR_STEAL_PTR(controller->linkPoint, linkSrc); + controller->linkPoint = g_steal_pointer(&linkSrc); } } @@ -412,7 +412,7 @@ virCgroupV1StealPlacement(virCgroupPtr group) { char *ret = NULL; - VIR_STEAL_PTR(ret, group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].placement); + ret = g_steal_pointer(&group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].placement); return ret; } diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 403b3b145e949af577d3fded03795066d0cb7ee7..621ab71eb55c9c90fda73e65009310ddd7bc6248 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -244,7 +244,7 @@ virCgroupV2StealPlacement(virCgroupPtr group) { char *ret; - VIR_STEAL_PTR(ret, group->unified.placement); + ret = g_steal_pointer(&group->unified.placement); return ret; } diff --git a/src/util/virdbus.c b/src/util/virdbus.c index f423305e1119939fdcdbb582e5651c26341acba7..f54c917c03e385db28f85dafd07c1e2d1b4cb333 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -762,7 +762,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, goto cleanup; } VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = t + 1; nstruct = skiplen; narray = (size_t)va_arg(args, int); @@ -788,7 +788,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, VIR_FREE(newiter); goto cleanup; } - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = vsig; nstruct = strlen(types); narray = (size_t)-1; @@ -819,7 +819,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, goto cleanup; } VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = t + 1; nstruct = skiplen - 2; narray = (size_t)-1; @@ -1056,7 +1056,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, nstruct, narray) < 0) goto cleanup; VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = t + 1; nstruct = skiplen; if (arrayref) { @@ -1086,7 +1086,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, VIR_DEBUG("Push failed"); goto cleanup; } - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = vsig; nstruct = strlen(types); narray = (size_t)-1; @@ -1113,7 +1113,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, nstruct, narray) < 0) goto cleanup; VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter = g_steal_pointer(&newiter); types = t + 1; nstruct = skiplen - 2; narray = (size_t)-1; diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index 1abd8044e7ba3bc7fe38888c66cc334c5056f09a..a9996b067cd5d2be1584c68d7c343ed80798dd31 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c @@ -150,7 +150,7 @@ virDevMapperGetTargetsImpl(const char *path, if (virStringListMerge(&devPaths, &recursiveDevPaths) < 0) goto cleanup; - VIR_STEAL_PTR(*devPaths_ret, devPaths); + *devPaths_ret = g_steal_pointer(&devPaths); ret = 0; cleanup: virStringListFree(recursiveDevPaths); diff --git a/src/util/virerror.c b/src/util/virerror.c index f02d6f3b8a76a9ac929870e36494ef0679a6e9b0..b45c53b7df5cf2c06f21aeae3289c3554776fead 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1497,7 +1497,7 @@ virLastErrorPrefixMessage(const char *fmt, ...) goto cleanup; VIR_FREE(err->message); - VIR_STEAL_PTR(err->message, newmsg); + err->message = g_steal_pointer(&newmsg); cleanup: va_end(args); diff --git a/src/util/virfile.c b/src/util/virfile.c index e0b63988236d2035dac5f57d2e19d8fb8a6a026e..2fb389eeb2078ddb293be55d806373efa2e7a179 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4437,7 +4437,7 @@ virFileGetXAttrQuiet(const char *path, break; } - VIR_STEAL_PTR(*value, buf); + *value = g_steal_pointer(&buf); ret = 0; cleanup: VIR_FREE(buf); diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c index 823d5e15e0c94761cd49b5952e679ec002229ae8..3a99dc210b303283d64a6a157596df0452dc10ab 100644 --- a/src/util/virfilecache.c +++ b/src/util/virfilecache.c @@ -169,7 +169,7 @@ virFileCacheLoad(virFileCachePtr cache, VIR_DEBUG("Loaded cached data '%s' for '%s'", file, name); ret = 1; - VIR_STEAL_PTR(*data, loadData); + *data = g_steal_pointer(&loadData); cleanup: virObjectUnref(loadData); diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 2a4a09534756055b4ebd99d197f1dc38c549a7ca..6b29bb1a736392460644f5c511d8315588fc9124 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -257,7 +257,7 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev, return -1; } - VIR_STEAL_PTR(*pci, actual); + *pci = g_steal_pointer(&actual); return 0; } diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index 50e8e7afc506cc1324bb213a1713ddf8b272ef93..dc553e775239d4f65d65ecf5e76f3291ab248749 100644 --- a/src/util/viriscsi.c +++ b/src/util/viriscsi.c @@ -178,7 +178,7 @@ virStorageBackendIQNFound(const char *initiatoriqn, goto cleanup; if (STREQ(iqn, initiatoriqn)) { - VIR_STEAL_PTR(*ifacename, iface); + *ifacename = g_steal_pointer(&iface); VIR_DEBUG("Found interface '%s' with IQN '%s'", *ifacename, iqn); break; @@ -266,7 +266,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn, iface_name, initiatoriqn); } - VIR_STEAL_PTR(*ifacename, iface_name); + *ifacename = g_steal_pointer(&iface_name); return 0; } diff --git a/src/util/virjson.c b/src/util/virjson.c index c1476bfbbe3c64e208a75a0c5d028a5ab721c63f..d3e6c9e41d2c034b684c8e30075e4578ab78034f 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -880,7 +880,7 @@ virJSONValueObjectSteal(virJSONValuePtr object, for (i = 0; i < object->data.object.npairs; i++) { if (STREQ(object->data.object.pairs[i].key, key)) { - VIR_STEAL_PTR(obj, object->data.object.pairs[i].value); + obj = g_steal_pointer(&object->data.object.pairs[i].value); VIR_FREE(object->data.object.pairs[i].key); VIR_DELETE_ELEMENT(object->data.object.pairs, i, object->data.object.npairs); @@ -2155,7 +2155,7 @@ virJSONValueObjectDeflatten(virJSONValuePtr json) deflattened) < 0) return NULL; - VIR_STEAL_PTR(ret, deflattened); + ret = g_steal_pointer(&deflattened); return ret; } diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 31fd9612776854824cb5dc94e6bd725899f88fc9..7e70ceb658606e6afdffc1cdaf0ff76e96b6f982 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -156,7 +156,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) if (VIR_ALLOC(dev) < 0) return NULL; - VIR_STEAL_PTR(dev->path, sysfspath); + dev->path = g_steal_pointer(&sysfspath); /* Check whether the user-provided model corresponds with the actually * supported mediated device's API. @@ -165,7 +165,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) return NULL; dev->model = model; - VIR_STEAL_PTR(ret, dev); + ret = g_steal_pointer(&dev); return ret; } @@ -521,7 +521,7 @@ virMediatedDeviceTypeReadAttrs(const char *sysfspath, #undef MDEV_GET_SYSFS_ATTR - VIR_STEAL_PTR(*type, tmp); + *type = g_steal_pointer(&tmp); return 0; } diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index b4637a91f9903deb4c2433a5365ecdc58978303c..8ca4626a902da84bf242a03c6dde05f5eb2de80a 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -399,7 +399,7 @@ int virNetDevTapCreate(char **ifname, goto cleanup; if (virNetDevExists(newname) == 0) { - VIR_STEAL_PTR(newifname, newname); + newifname = g_steal_pointer(&newname); break; } } diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 90049b58a1198b7f1e5da4e6984cac3e6e183670..ab41b57672733d056b8a65b35120b0d3a011de80 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -317,7 +317,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg, return -1; } - VIR_STEAL_PTR(*resp, temp_resp); + *resp = g_steal_pointer(&temp_resp); *respbuflen = len; return 0; } @@ -466,7 +466,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, goto malformed_resp; } - VIR_STEAL_PTR(*nlData, resp); + *nlData = g_steal_pointer(&resp); return 0; malformed_resp: @@ -737,7 +737,7 @@ virNetlinkGetNeighbor(void **nlData, uint32_t src_pid, uint32_t dst_pid) goto malformed_resp; } - VIR_STEAL_PTR(*nlData, resp); + *nlData = g_steal_pointer(&resp); return recvbuflen; malformed_resp: diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 6f3f0420d2bdfda7015537a7b820271106403af0..8f50634c2a06a55f7b28f7dbbb38f7b0f2aae3e2 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -293,7 +293,7 @@ virNumaGetNodeCPUs(int node, } } - VIR_STEAL_PTR(*cpus, cpumap); + *cpus = g_steal_pointer(&cpumap); return ncpus; } # undef MASK_CPU_ISSET @@ -337,7 +337,7 @@ virNumaNodesetToCPUset(virBitmapPtr nodeset, return -1; } - VIR_STEAL_PTR(*cpuset, allNodesCPUs); + *cpuset = g_steal_pointer(&allNodesCPUs); return 0; } diff --git a/src/util/virpci.c b/src/util/virpci.c index d173b29476184040e3fb6b2c11e67d705dca697b..2c54c8baa1af7ddb6c9fda9f59b2bed72ddf39f6 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -489,7 +489,7 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predicate, break; } else if (rc == 1) { VIR_DEBUG("%s %s: iter matched on %s", dev->id, dev->name, check->name); - VIR_STEAL_PTR(*matched, check); + *matched = g_steal_pointer(&check); ret = 1; break; } @@ -2648,7 +2648,7 @@ virPCIGetMdevTypes(const char *sysfspath, if (dirret < 0) goto cleanup; - VIR_STEAL_PTR(*types, mdev_types); + *types = g_steal_pointer(&mdev_types); ret = ntypes; ntypes = 0; cleanup: diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 9b50c092217a2ff1245917a415e57c8fa558e85a..ab650b59b9afbd5c5f2b1b9b75266222e6a8585c 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -610,7 +610,7 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, goto cleanup; } - VIR_STEAL_PTR(i_level->types[type], i_type); + i_level->types[type] = g_steal_pointer(&i_type); } ret = 0; @@ -666,7 +666,7 @@ virResctrlGetMemoryBandwidthInfo(virResctrlInfoPtr resctrl) if (rv < 0) goto cleanup; - VIR_STEAL_PTR(resctrl->membw_info, i_membw); + resctrl->membw_info = g_steal_pointer(&i_membw); ret = 0; cleanup: VIR_FREE(i_membw); @@ -748,8 +748,8 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl) VIR_DEBUG("Resctrl supported %zd monitoring features", nfeatures); info_monitor->nfeatures = nfeatures; - VIR_STEAL_PTR(info_monitor->features, features); - VIR_STEAL_PTR(resctrl->monitor_info, info_monitor); + info_monitor->features = g_steal_pointer(&features); + resctrl->monitor_info = g_steal_pointer(&info_monitor); ret = 0; cleanup: @@ -1025,7 +1025,7 @@ virResctrlInfoGetMonitorPrefix(virResctrlInfoPtr resctrl, goto cleanup; } - VIR_STEAL_PTR(*monitor, mon); + *monitor = g_steal_pointer(&mon); cleanup: virResctrlInfoMonFree(mon); return ret; diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c index 7a268319a6f717151ba60fa5532b57ebf9904e88..1171d3b153926ee587eb8d5c3d21a05e11f7b8e8 100644 --- a/src/util/virrotatingfile.c +++ b/src/util/virrotatingfile.c @@ -406,7 +406,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) } VIR_FREE(nextpath); - VIR_STEAL_PTR(nextpath, thispath); + nextpath = g_steal_pointer(&thispath); } } diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 425d7adfe99881de1ff2f3f4bc7c0ade974187f8..17e8aa1daa932214a42f8745e71d79dd72c814d6 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -238,7 +238,7 @@ virSCSIDeviceNew(const char *sysfs_prefix, if (virAsprintf(&dev->id, "%s:%s", vendor, model) < 0) return NULL; - VIR_STEAL_PTR(ret, dev); + ret = g_steal_pointer(&dev); return ret; } diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index 9ba0d3f2a04420bcb872e10012a0d81521dbbc6c..0bcd8902a4b62db31d104217f2658b67b6fe919d 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -269,7 +269,7 @@ virSCSIVHostDeviceNew(const char *name) VIR_DEBUG("%s: initialized", dev->name); - VIR_STEAL_PTR(ret, dev); + ret = g_steal_pointer(&dev); return ret; } diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryption.c index 49df7fddd8d58a2c469886f672a3cd1cbbf73793..14d7dc26e2f7cdf6dff46929d69502d222910977 100644 --- a/src/util/virstorageencryption.c +++ b/src/util/virstorageencryption.c @@ -310,7 +310,7 @@ virStorageEncryptionParseNode(xmlNodePtr node, } } - VIR_STEAL_PTR(ret, encdef); + ret = g_steal_pointer(&encdef); cleanup: VIR_FREE(format_str); diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index ac0c70b21e110d0a0073c99d3e2a88e05c9bcf3a..e04cc413a4e78952701c54381de801577242e908 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1141,7 +1141,7 @@ virStorageFileMetadataNew(const char *path, if (VIR_STRDUP(def->path, path) < 0) return NULL; - VIR_STEAL_PTR(ret, def); + ret = g_steal_pointer(&def); return ret; } @@ -1240,7 +1240,7 @@ virStorageFileGetMetadataFromFD(const char *path, * update the metadata.*/ meta->type = VIR_STORAGE_TYPE_DIR; meta->format = VIR_STORAGE_FILE_DIR; - VIR_STEAL_PTR(ret, meta); + ret = g_steal_pointer(&meta); return ret; } @@ -1262,7 +1262,7 @@ virStorageFileGetMetadataFromFD(const char *path, else if (S_ISBLK(sb.st_mode)) meta->type = VIR_STORAGE_TYPE_BLOCK; - VIR_STEAL_PTR(ret, meta); + ret = g_steal_pointer(&meta); return ret; } @@ -1867,7 +1867,7 @@ virStorageAuthDefCopy(const virStorageAuthDef *src) if (virSecretLookupDefCopy(&authdef->seclookupdef, &src->seclookupdef) < 0) return NULL; - VIR_STEAL_PTR(ret, authdef); + ret = g_steal_pointer(&authdef); return ret; } @@ -1924,7 +1924,7 @@ virStorageAuthDefParse(xmlNodePtr node, if (virSecretLookupParseSecret(secretnode, &authdef->seclookupdef) < 0) goto cleanup; - VIR_STEAL_PTR(ret, authdef); + ret = g_steal_pointer(&authdef); cleanup: ctxt->node = saveNode; @@ -2028,8 +2028,8 @@ virStoragePRDefParseXML(xmlXPathContextPtr ctxt) goto cleanup; } - VIR_STEAL_PTR(prd->path, path); - VIR_STEAL_PTR(ret, prd); + prd->path = g_steal_pointer(&path); + ret = g_steal_pointer(&prd); cleanup: virStoragePRDefFree(prd); @@ -2113,7 +2113,7 @@ virStoragePRDefCopy(virStoragePRDefPtr src) VIR_STRDUP(copy->mgralias, src->mgralias) < 0) goto cleanup; - VIR_STEAL_PTR(ret, copy); + ret = g_steal_pointer(©); cleanup: virStoragePRDefFree(copy); @@ -2346,7 +2346,7 @@ virStorageSourceCopy(const virStorageSource *src, return NULL; } - VIR_STEAL_PTR(ret, def); + ret = g_steal_pointer(&def); return ret; } @@ -2671,7 +2671,7 @@ virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent, def->type = VIR_STORAGE_TYPE_FILE; } - VIR_STEAL_PTR(ret, def); + ret = g_steal_pointer(&def); return ret; } @@ -2854,7 +2854,7 @@ virStorageSourceParseRBDColonString(const char *rbdstr, /* pool vs. image name */ if ((p = strchr(src->path, '/'))) { - VIR_STEAL_PTR(src->volume, src->path); + src->volume = g_steal_pointer(&src->path); if (VIR_STRDUP(src->path, p + 1) < 0) return -1; *p = '\0'; @@ -2897,7 +2897,7 @@ virStorageSourceParseRBDColonString(const char *rbdstr, if (VIR_STRDUP(authdef->secrettype, virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_CEPH)) < 0) return -1; - VIR_STEAL_PTR(src->auth, authdef); + src->auth = g_steal_pointer(&authdef); src->authInherited = true; /* Cannot formulate a secretType (eg, usage or uuid) given @@ -3720,7 +3720,7 @@ virStorageSourceNewFromBackingAbsolute(const char *path, } } - VIR_STEAL_PTR(*src, def); + *src = g_steal_pointer(&def); return rc; } @@ -3779,7 +3779,7 @@ virStorageSourceNewFromChild(virStorageSourcePtr parent, def->detected = true; - VIR_STEAL_PTR(*child, def); + *child = g_steal_pointer(&def); return rc; } @@ -4266,7 +4266,7 @@ virStorageFileGetRelativeBackingPath(virStorageSourcePtr top, return -1; } - VIR_STEAL_PTR(*relpath, path); + *relpath = g_steal_pointer(&path); return 0; } @@ -5025,7 +5025,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, goto cleanup; } - VIR_STEAL_PTR(src->backingStore, backingStore); + src->backingStore = g_steal_pointer(&backingStore); if (src->externalDataStoreRaw) { g_autoptr(virStorageSource) externalDataStore = NULL; @@ -5040,7 +5040,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, goto cleanup; } - VIR_STEAL_PTR(src->externalDataStore, externalDataStore); + src->externalDataStore = g_steal_pointer(&externalDataStore); } ret = 0; @@ -5150,6 +5150,6 @@ virStorageFileGetBackingStoreStr(virStorageSourcePtr src, if (virStorageFileGetMetadataInternal(tmp, buf, headerLen, NULL) < 0) return -1; - VIR_STEAL_PTR(*backing, tmp->backingStoreRaw); + *backing = g_steal_pointer(&tmp->backingStoreRaw); return 0; } diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index a9dfa85be293390dc41114a9058815889d830cbe..2cd7e81bdd9925486f1e4c5ee95a970e33cf2c40 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -761,7 +761,7 @@ virTypedParamListStealParams(virTypedParamListPtr list, { size_t ret = list->npar; - VIR_STEAL_PTR(*params, list->par); + *params = g_steal_pointer(&list->par); list->npar = 0; list->par_alloc = 0;