diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 4238d7014bc6c11b5a26650f8c9cd7327031ae54..f58e3364042ca24eb0e5f43236362bdab638c9d5 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1279,33 +1279,6 @@ virCgroupNewIgnoreError(void) } -/** - * virCgroupFree: - * - * @group: The group structure to free - */ -void -virCgroupFree(virCgroupPtr *group) -{ - size_t i; - - if (*group == NULL) - return; - - for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { - VIR_FREE((*group)->legacy[i].mountPoint); - VIR_FREE((*group)->legacy[i].linkPoint); - VIR_FREE((*group)->legacy[i].placement); - } - - VIR_FREE((*group)->unified.mountPoint); - VIR_FREE((*group)->unified.placement); - - VIR_FREE((*group)->path); - VIR_FREE(*group); -} - - /** * virCgroupHasController: query whether a cgroup controller is present * @@ -2917,14 +2890,6 @@ virCgroupNewIgnoreError(void) } -void -virCgroupFree(virCgroupPtr *group ATTRIBUTE_UNUSED) -{ - virReportSystemError(ENXIO, "%s", - _("Control groups not supported on this platform")); -} - - bool virCgroupHasController(virCgroupPtr cgroup ATTRIBUTE_UNUSED, int controller ATTRIBUTE_UNUSED) @@ -3565,6 +3530,33 @@ virCgroupControllerAvailable(int controller ATTRIBUTE_UNUSED) #endif /* !__linux__ */ +/** + * virCgroupFree: + * + * @group: The group structure to free + */ +void +virCgroupFree(virCgroupPtr *group) +{ + size_t i; + + if (*group == NULL) + return; + + for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { + VIR_FREE((*group)->legacy[i].mountPoint); + VIR_FREE((*group)->legacy[i].linkPoint); + VIR_FREE((*group)->legacy[i].placement); + } + + VIR_FREE((*group)->unified.mountPoint); + VIR_FREE((*group)->unified.placement); + + VIR_FREE((*group)->path); + VIR_FREE(*group); +} + + int virCgroupDelThread(virCgroupPtr cgroup, virCgroupThreadName nameval,