]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: add missing device types to virDomainDevice(Type|Def)
authorLaine Stump <laine@laine.org>
Wed, 22 Feb 2012 20:54:35 +0000 (15:54 -0500)
committerLaine Stump <laine@laine.org>
Tue, 6 Mar 2012 04:23:01 +0000 (23:23 -0500)
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.

src/conf/domain_conf.c
src/conf/domain_conf.h

index f9654f147151546e879354efbb208f84de7a9852..26190f138347d9d0c043f2bc43ec7fd38169ac61 100644 (file)
@@ -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",
index d98a5518183dcbd3d852e169a83440c4194d99b2..f5819ad8dbfdd53fcd185544a0d2f2b49fe3ffef 100644 (file)
@@ -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;
 };