]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "util: cgroup: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC"
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 30 Jul 2018 09:04:26 +0000 (11:04 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 30 Jul 2018 11:28:20 +0000 (13:28 +0200)
This reverts commit 4da4a9fe0c0956feefe3d592b4ba2b92b2a9a2f9.

Turns out, our code relies on virCgroupFree(&var) setting
var = NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/util/vircgroup.c
src/util/vircgroup.h
src/util/vircgrouppriv.h

index 6f7b5b40f7a9904623d2fdd8654f64e2f55c51b5..4e34bf588587f2769d8d77c20bb6bd4e8073377d 100644 (file)
@@ -50,6 +50,7 @@
 #include "vircgrouppriv.h"
 
 #include "virutil.h"
+#include "viralloc.h"
 #include "virerror.h"
 #include "virlog.h"
 #include "virfile.h"
index 065861d7008252a4d3a2b4c779f1adc5e8bb04ea..e4ffd57b6bae35f4f7c12dcbf9b5db878f9a7402 100644 (file)
 
 # 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__ */
index a72bee1ef2686e21323157342124ad2f5c2e119f..722863e5b6410f424bb2c347c4128f683d228361 100644 (file)
@@ -42,7 +42,7 @@ struct virCgroupController {
     char *placement;
 };
 
-struct _virCgroup {
+struct virCgroup {
     char *path;
 
     struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];