提交 60c4ae45 编写于 作者: P Pavel Hrdina

domain_conf: separate structures from virDomainDef

Cleanup virDomanDef structure from other nested structure and create
separate type definition for them.

Fix a typo in virDomainHugePage.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 c46fa72e
......@@ -1890,38 +1890,45 @@ struct _virDomainResourceDef {
char *partition;
};
typedef struct _virDomaiHugePage virDomainHugePage;
typedef struct _virDomainHugePage virDomainHugePage;
typedef virDomainHugePage *virDomainHugePagePtr;
struct _virDomaiHugePage {
struct _virDomainHugePage {
virBitmapPtr nodemask; /* guest's NUMA node mask */
unsigned long long size; /* hugepage size in KiB */
};
/*
* Guest VM main configuration
*
* NB: if adding to this struct, virDomainDefCheckABIStability
* may well need an update
*/
typedef struct _virDomainDef virDomainDef;
typedef virDomainDef *virDomainDefPtr;
struct _virDomainDef {
int virtType;
int id;
unsigned char uuid[VIR_UUID_BUFLEN];
char *name;
char *title;
char *description;
typedef struct _virDomainCputune virDomainCputune;
typedef virDomainCputune *virDomainCputunePtr;
struct {
struct _virDomainCputune {
unsigned long shares;
bool sharesSpecified;
unsigned long long period;
long long quota;
unsigned long long emulator_period;
long long emulator_quota;
size_t nvcpupin;
virDomainVcpuPinDefPtr *vcpupin;
virDomainVcpuPinDefPtr emulatorpin;
size_t niothreadspin;
virDomainVcpuPinDefPtr *iothreadspin;
};
typedef struct _virDomainBlkiotune virDomainBlkiotune;
typedef virDomainBlkiotune *virDomainBlkiotunePtr;
struct _virDomainBlkiotune {
unsigned int weight;
size_t ndevices;
virBlkioDevicePtr devices;
} blkio;
};
struct {
typedef struct _virDomainMemtune virDomainMemtune;
typedef virDomainMemtune *virDomainMemtunePtr;
struct _virDomainMemtune {
unsigned long long max_balloon; /* in kibibytes */
unsigned long long cur_balloon; /* in kibibytes */
......@@ -1935,7 +1942,36 @@ struct _virDomainDef {
unsigned long long soft_limit; /* in kibibytes */
unsigned long long min_guarantee; /* in kibibytes */
unsigned long long swap_hard_limit; /* in kibibytes */
} mem;
};
typedef struct _virDomainPowerManagement virDomainPowerManagement;
typedef virDomainPowerManagement *virDomainPowerManagementPtr;
struct _virDomainPowerManagement {
/* These options are of type enum virTristateBool */
int s3;
int s4;
};
/*
* Guest VM main configuration
*
* NB: if adding to this struct, virDomainDefCheckABIStability
* may well need an update
*/
typedef struct _virDomainDef virDomainDef;
typedef virDomainDef *virDomainDefPtr;
struct _virDomainDef {
int virtType;
int id;
unsigned char uuid[VIR_UUID_BUFLEN];
char *name;
char *title;
char *description;
virDomainBlkiotune blkio;
virDomainMemtune mem;
unsigned short vcpus;
unsigned short maxvcpus;
int placement_mode;
......@@ -1943,19 +1979,7 @@ struct _virDomainDef {
unsigned int iothreads;
struct {
unsigned long shares;
bool sharesSpecified;
unsigned long long period;
long long quota;
unsigned long long emulator_period;
long long emulator_quota;
size_t nvcpupin;
virDomainVcpuPinDefPtr *vcpupin;
virDomainVcpuPinDefPtr emulatorpin;
size_t niothreadspin;
virDomainVcpuPinDefPtr *iothreadspin;
} cputune;
virDomainCputune cputune;
virDomainNumatunePtr numatune;
virDomainResourceDefPtr resource;
......@@ -1968,11 +1992,7 @@ struct _virDomainDef {
int onLockFailure; /* enum virDomainLockFailureAction */
struct {
/* These options are of type enum virTristateBool */
int s3;
int s4;
} pm;
virDomainPowerManagement pm;
virDomainOSDef os;
char *emulator;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册