mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
conf: add missing device types to virDomainDevice(Type|Def)
Not all device types were represented in virDomainDeviceType, so some types of devices couldn't be represented in a virDomainDeviceDef (which requires a different type of pointer in the union for each different kind of device). Since serial, parallel, channel, and console devices are all virDomainChrDef, and the virDomainDeviceType is never used to produce a string from the type (and only used in the other direction internally to code, never to produce XML), I only added one "CHR" type, which is associated with "virDomainChrDefPtr chr" in the union.
This commit is contained in:
parent
118cfc2535
commit
9890b318c8
@ -123,6 +123,7 @@ VIR_ENUM_IMPL(virDomainLifecycleCrash, VIR_DOMAIN_LIFECYCLE_CRASH_LAST,
|
||||
"coredump-restart")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainDevice, VIR_DOMAIN_DEVICE_LAST,
|
||||
"none",
|
||||
"disk",
|
||||
"lease",
|
||||
"filesystem",
|
||||
@ -135,7 +136,10 @@ VIR_ENUM_IMPL(virDomainDevice, VIR_DOMAIN_DEVICE_LAST,
|
||||
"controller",
|
||||
"graphics",
|
||||
"hub",
|
||||
"redirdev")
|
||||
"redirdev",
|
||||
"smartcard",
|
||||
"chr",
|
||||
"memballoon")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainDeviceAddress, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST,
|
||||
"none",
|
||||
|
@ -1179,7 +1179,8 @@ enum virDomainSmbiosMode {
|
||||
};
|
||||
|
||||
/* Flags for the 'type' field in next struct */
|
||||
enum virDomainDeviceType {
|
||||
typedef enum {
|
||||
VIR_DOMAIN_DEVICE_NONE = 0,
|
||||
VIR_DOMAIN_DEVICE_DISK,
|
||||
VIR_DOMAIN_DEVICE_LEASE,
|
||||
VIR_DOMAIN_DEVICE_FS,
|
||||
@ -1193,9 +1194,12 @@ enum virDomainDeviceType {
|
||||
VIR_DOMAIN_DEVICE_GRAPHICS,
|
||||
VIR_DOMAIN_DEVICE_HUB,
|
||||
VIR_DOMAIN_DEVICE_REDIRDEV,
|
||||
VIR_DOMAIN_DEVICE_SMARTCARD,
|
||||
VIR_DOMAIN_DEVICE_CHR,
|
||||
VIR_DOMAIN_DEVICE_MEMBALLOON,
|
||||
|
||||
VIR_DOMAIN_DEVICE_LAST,
|
||||
};
|
||||
} virDomainDeviceType;
|
||||
|
||||
typedef struct _virDomainDeviceDef virDomainDeviceDef;
|
||||
typedef virDomainDeviceDef *virDomainDeviceDefPtr;
|
||||
@ -1215,6 +1219,9 @@ struct _virDomainDeviceDef {
|
||||
virDomainGraphicsDefPtr graphics;
|
||||
virDomainHubDefPtr hub;
|
||||
virDomainRedirdevDefPtr redirdev;
|
||||
virDomainSmartcardDefPtr smartcard;
|
||||
virDomainChrDefPtr chr;
|
||||
virDomainMemballoonDefPtr memballoon;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user