From: Laine Stump Date: Wed, 22 Feb 2012 20:54:35 +0000 (-0500) Subject: conf: add missing device types to virDomainDevice(Type|Def) X-Git-Tag: v0.9.11-rc1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9890b318c879171f4ea9bfc99401ebfc78cd4b00;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f9654f1471..26190f1383 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index d98a551818..f5819ad8db 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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; };