[libvirt PATCH v4 10/25] nodedev: add helper functions to remove node devices

Erik Skultety eskultet at redhat.com
Tue Feb 16 15:16:18 UTC 2021


...
> +void
> +virNodeDeviceObjListForEachSafe(virNodeDeviceObjListPtr devs,
> +                                virNodeDeviceObjListIterator iter,
> +                                const void *opaque)
> +{
> +    struct _virNodeDeviceObjListForEachData data = {
> +        .iter = iter,
> +        .opaque = opaque
> +    };
> +
> +    virObjectRWLockWrite(devs);
> +    virHashForEachSafe(devs->objs, virNodeDeviceObjListForEachCb, &data);

I just checked out virHashForEachSafe and virHashForEach says the latter is
deprecated while the use of the former in new code should be rewritten with
GLib, which translates to the use of g_hash_table_foreach_remove().

Erik




More information about the libvir-list mailing list