This reverts commit 4da4a9fe0c0956feefe3d592b4ba2b92b2a9a2f9.
Turns out, our code relies on virCgroupFree(&var) setting
var = NULL.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/vircgroup.c | 1 +
src/util/vircgroup.h | 9 ++-------
src/util/vircgrouppriv.h | 2 +-
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 6f7b5b40f7..4e34bf5885 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -50,6 +50,7 @@
#include "vircgrouppriv.h"
#include "virutil.h"
+#include "viralloc.h"
#include "virerror.h"
#include "virlog.h"
#include "virfile.h"
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index 065861d700..e4ffd57b6b 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -27,11 +27,9 @@
# include "virutil.h"
# include "virbitmap.h"
-# include "viralloc.h"
-struct _virCgroup;
-typedef struct _virCgroup virCgroup;
-typedef virCgroup *virCgroupPtr;
+struct virCgroup;
+typedef struct virCgroup *virCgroupPtr;
enum {
VIR_CGROUP_CONTROLLER_CPU,
@@ -299,7 +297,4 @@ int virCgroupSetOwner(virCgroupPtr cgroup,
int virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller);
bool virCgroupControllerAvailable(int controller);
-
-VIR_DEFINE_AUTOPTR_FUNC(virCgroup, virCgroupFree)
-
#endif /* __VIR_CGROUP_H__ */
diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h
index a72bee1ef2..722863e5b6 100644
--- a/src/util/vircgrouppriv.h
+++ b/src/util/vircgrouppriv.h
@@ -42,7 +42,7 @@ struct virCgroupController {
char *placement;
};
-struct _virCgroup {
+struct virCgroup {
char *path;
struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
--
2.16.4