提交 660d661e 编写于 作者: J Julio Faracco 提交者: Eric Blake

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: NJulio Faracco <jcfaracco@gmail.com>
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 1ce86e62
......@@ -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;
......
......@@ -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 <target dev='...' of the domain */
int index; /* index within snapshot->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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册