vircgroup: Introduce standard set of typedefs and use them

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2018-06-12 13:47:10 +02:00
parent 70dc671a27
commit cd77242504
3 changed files with 6 additions and 3 deletions

View File

@ -385,7 +385,7 @@ virCgroupDetectMountsFromFile(virCgroupPtr group,
const char *typestr = virCgroupControllerTypeToString(i); const char *typestr = virCgroupControllerTypeToString(i);
int typelen = strlen(typestr); int typelen = strlen(typestr);
char *tmp = entry.mnt_opts; char *tmp = entry.mnt_opts;
struct _virCgroupController *controller = &group->controllers[i]; virCgroupControllerPtr controller = &group->controllers[i];
while (tmp) { while (tmp) {
char *next = strchr(tmp, ','); char *next = strchr(tmp, ',');
int len; int len;

View File

@ -29,7 +29,8 @@
# include "virbitmap.h" # include "virbitmap.h"
struct _virCgroup; struct _virCgroup;
typedef struct _virCgroup *virCgroupPtr; typedef struct _virCgroup virCgroup;
typedef virCgroup *virCgroupPtr;
enum { enum {
VIR_CGROUP_CONTROLLER_CPU, VIR_CGROUP_CONTROLLER_CPU,

View File

@ -41,11 +41,13 @@ struct _virCgroupController {
char *linkPoint; char *linkPoint;
char *placement; char *placement;
}; };
typedef struct _virCgroupController virCgroupController;
typedef virCgroupController *virCgroupControllerPtr;
struct _virCgroup { struct _virCgroup {
char *path; char *path;
struct _virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST]; virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
}; };
int virCgroupDetectMountsFromFile(virCgroupPtr group, int virCgroupDetectMountsFromFile(virCgroupPtr group,