From 660d661e8586846e9e12bf742e1766fbb14c904f Mon Sep 17 00:00:00 2001 From: Julio Faracco Date: Sun, 11 May 2014 12:08:51 -0300 Subject: [PATCH] conf: use typedefs for enums in "src/conf/snapshot_conf.h" In "src/conf/" there are many enumeration (enum) declarations. Similar to the recent cleanup to "src/util" directory, it's better to use a typedef for variable types, function types and other usages. Other enumeration and folders will be changed to typedef's in the future. Most of the files changed in this commit are related to snapshot (snapshot_conf) enums. Signed-off-by: Julio Faracco Signed-off-by: Eric Blake --- src/conf/domain_conf.h | 2 +- src/conf/snapshot_conf.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 63c4577ff6..9c80096ab7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -635,7 +635,7 @@ struct _virDomainDiskDef { int ioeventfd; /* enum virDomainIoEventFd */ int event_idx; /* enum virDomainVirtioEventIdx */ int copy_on_read; /* enum virDomainDiskCopyOnRead */ - int snapshot; /* enum virDomainSnapshotLocation, snapshot_conf.h */ + int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */ int startupPolicy; /* enum virDomainStartupPolicy */ bool readonly; bool shared; diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 5f74b62edc..1eb697fb4b 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -29,20 +29,20 @@ /* Items related to snapshot state */ -enum virDomainSnapshotLocation { +typedef enum { VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT = 0, VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL, VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL, VIR_DOMAIN_SNAPSHOT_LOCATION_LAST -}; +} virDomainSnapshotLocation; -enum virDomainSnapshotState { +typedef enum { /* Inherit the VIR_DOMAIN_* states from virDomainState. */ VIR_DOMAIN_DISK_SNAPSHOT = VIR_DOMAIN_LAST, VIR_DOMAIN_SNAPSHOT_STATE_LAST -}; +} virDomainSnapshotState; /* Stores disk-snapshot information */ typedef struct _virDomainSnapshotDiskDef virDomainSnapshotDiskDef; @@ -50,7 +50,7 @@ typedef virDomainSnapshotDiskDef *virDomainSnapshotDiskDefPtr; struct _virDomainSnapshotDiskDef { char *name; /* name matching the dom->disks that matches name */ - int snapshot; /* enum virDomainSnapshotLocation */ + int snapshot; /* virDomainSnapshotLocation */ virStorageSource src; /* new wrapper file when snapshot is external */ }; @@ -64,9 +64,9 @@ struct _virDomainSnapshotDef { char *description; char *parent; long long creationTime; /* in seconds */ - int state; /* enum virDomainSnapshotState */ + int state; /* virDomainSnapshotState */ - int memory; /* enum virDomainMemorySnapshot */ + int memory; /* virDomainMemorySnapshot */ char *file; /* memory state file when snapshot is external */ size_t ndisks; /* should not exceed dom->ndisks */ -- GitLab