]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domcaps: Add CPU usable flag
authorJiri Denemark <jdenemar@redhat.com>
Wed, 15 Jun 2016 14:15:44 +0000 (16:15 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 22 Sep 2016 13:40:08 +0000 (15:40 +0200)
In case a hypervisor is able to tell us a list of supported CPU models
and whether each CPU models can be used on the current host, we can
propagate this to domain capabilities. This is a better alternative
to calling virConnectCompareCPU for each supported CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
14 files changed:
docs/formatdomaincaps.html.in
docs/schemas/domaincaps.rng
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h
src/libvirt_private.syms
src/qemu/qemu_capabilities.c
tests/domaincapsschemadata/full.xml
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
tests/domaincapstest.c

index ce43658e06b66c0d976f3ef60576ec09e238a57a..045ba939fe06f6a9ac1b2e6cae00a4aeb4c4ea96 100644 (file)
     &lt;mode name='host-passthrough' supported='yes'/&gt;
     &lt;mode name='host-model' supported='yes'/&gt;
     &lt;mode name='custom' supported='yes'&gt;
-      &lt;model&gt;Broadwell&lt;/model&gt;
-      &lt;model&gt;Broadwell-noTSX&lt;/model&gt;
-      &lt;model&gt;Haswell&lt;/model&gt;
+      &lt;model usable='no'&gt;Broadwell&lt;/model&gt;
+      &lt;model usable='yes'&gt;Broadwell-noTSX&lt;/model&gt;
+      &lt;model usable='no'&gt;Haswell&lt;/model&gt;
       ...
     &lt;/mode&gt;
   &lt;/cpu&gt;
       <dd>
         The <code>mode</code> element contains a list of supported CPU
         models, each described by a dedicated <code>model</code> element.
+        The <code>usable</code> attribute specifies whether the model can
+        be used on the host. A special value <code>unknown</code> indicates
+        libvirt does not have enough information to provide the usability
+        data.
       </dd>
     </dl>
 
index 9f3d225b5e3209e4c3c97a2b7fd2a98a246259e9..5a605a7e1a853a5b7d0ffeaa379c9aef393814c1 100644 (file)
       <ref name='supported'/>
       <zeroOrMore>
         <element name='model'>
+          <attribute name='usable'>
+            <choice>
+              <value>yes</value>
+              <value>no</value>
+              <value>unknown</value>
+            </choice>
+          </attribute>
           <text/>
         </element>
       </zeroOrMore>
index 828fa707cac6f1115b90024baa853cb742796e5e..9ec416e3b091e3fbe67cbd62f57edec82450577c 100644 (file)
@@ -29,6 +29,9 @@
 
 #define VIR_FROM_THIS VIR_FROM_CAPABILITIES
 
+VIR_ENUM_IMPL(virDomainCapsCPUUsable, VIR_DOMCAPS_CPU_USABLE_LAST,
+              "unknown", "yes", "no");
+
 static virClassPtr virDomainCapsClass;
 static virClassPtr virDomainCapsCPUModelsClass;
 
@@ -157,7 +160,9 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
         return NULL;
 
     for (i = 0; i < old->nmodels; i++) {
-        if (virDomainCapsCPUModelsAdd(cpuModels, old->models[i].name, -1) < 0)
+        if (virDomainCapsCPUModelsAdd(cpuModels,
+                                      old->models[i].name, -1,
+                                      old->models[i].usable) < 0)
             goto error;
     }
 
@@ -184,7 +189,8 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
             continue;
 
         if (virDomainCapsCPUModelsAdd(cpuModels,
-                                      old->models[i].name, -1) < 0)
+                                      old->models[i].name, -1,
+                                      old->models[i].usable) < 0)
             goto error;
     }
 
@@ -198,13 +204,16 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
 
 int
 virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
-                               char **name)
+                               char **name,
+                               virDomainCapsCPUUsable usable)
 {
     if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max,
                      cpuModels->nmodels, 1) < 0)
         return -1;
 
-    VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels++].name, *name);
+    cpuModels->models[cpuModels->nmodels].usable = usable;
+    VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name);
+    cpuModels->nmodels++;
     return 0;
 }
 
@@ -212,14 +221,15 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
 int
 virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
                           const char *name,
-                          ssize_t nameLen)
+                          ssize_t nameLen,
+                          virDomainCapsCPUUsable usable)
 {
     char *copy = NULL;
 
     if (VIR_STRNDUP(copy, name, nameLen) < 0)
         goto error;
 
-    if (virDomainCapsCPUModelsAddSteal(cpuModels, &copy) < 0)
+    if (virDomainCapsCPUModelsAddSteal(cpuModels, &copy, usable) < 0)
         goto error;
 
     return 0;
@@ -372,8 +382,10 @@ virDomainCapsCPUCustomFormat(virBufferPtr buf,
     virBufferAdjustIndent(buf, 2);
 
     for (i = 0; i < custom->nmodels; i++) {
-        virBufferAsprintf(buf, "<model>%s</model>\n",
-                          custom->models[i].name);
+        virDomainCapsCPUModelPtr model = custom->models + i;
+        virBufferAsprintf(buf, "<model usable='%s'>%s</model>\n",
+                          virDomainCapsCPUUsableTypeToString(model->usable),
+                          model->name);
     }
 
     virBufferAdjustIndent(buf, -2);
index 57f0161be895899a495b1d620f4364c8791f745a..3ec05dc07dba28fc7e61f90839d1c6a5fb1e52a9 100644 (file)
@@ -102,10 +102,20 @@ struct _virDomainCapsFeatureGIC {
     virDomainCapsEnum version; /* Info about virGICVersion */
 };
 
+typedef enum {
+    VIR_DOMCAPS_CPU_USABLE_UNKNOWN,
+    VIR_DOMCAPS_CPU_USABLE_YES,
+    VIR_DOMCAPS_CPU_USABLE_NO,
+
+    VIR_DOMCAPS_CPU_USABLE_LAST
+} virDomainCapsCPUUsable;
+VIR_ENUM_DECL(virDomainCapsCPUUsable);
+
 typedef struct _virDomainCapsCPUModel virDomainCapsCPUModel;
 typedef virDomainCapsCPUModel *virDomainCapsCPUModelPtr;
 struct _virDomainCapsCPUModel {
     char *name;
+    virDomainCapsCPUUsable usable;
 };
 
 typedef struct _virDomainCapsCPUModels virDomainCapsCPUModels;
@@ -159,10 +169,12 @@ virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o
 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
                                                        const char **models);
 int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
-                                   char **name);
+                                   char **name,
+                                   virDomainCapsCPUUsable usable);
 int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
                               const char *name,
-                              ssize_t nameLen);
+                              ssize_t nameLen,
+                              virDomainCapsCPUUsable usable);
 
 # define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...)            \
     do {                                                    \
index dc4bba71f3b9bd0710be510dfe03d1a38ce04289..b6561e803ad9ae22b1fffd19106a2860c637ecae 100644 (file)
@@ -158,6 +158,8 @@ virDomainCapsCPUModelsAddSteal;
 virDomainCapsCPUModelsCopy;
 virDomainCapsCPUModelsFilter;
 virDomainCapsCPUModelsNew;
+virDomainCapsCPUUsableTypeFromString;
+virDomainCapsCPUUsableTypeToString;
 virDomainCapsEnumClear;
 virDomainCapsEnumSet;
 virDomainCapsFormat;
index 92b8b026de9e320af9c24ad4d27a976161b9d639..86e40ba4fe976265326f6ca4ba22804849941f90 100644 (file)
@@ -671,7 +671,8 @@ virQEMUCapsParseX86Models(const char *output,
             len -= 2;
         }
 
-        if (virDomainCapsCPUModelsAdd(cpus, p, len) < 0)
+        if (virDomainCapsCPUModelsAdd(cpus, p, len,
+                                      VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
             goto error;
     } while ((p = next));
 
@@ -719,7 +720,8 @@ virQEMUCapsParsePPCModels(const char *output,
         if (*p == '\n')
             continue;
 
-        if (virDomainCapsCPUModelsAdd(cpus, p, t - p - 1) < 0)
+        if (virDomainCapsCPUModelsAdd(cpus, p, t - p - 1,
+                                      VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
             goto error;
     } while ((p = next));
 
@@ -2306,7 +2308,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
         return -1;
 
     for (i = 0; i < count; i++) {
-        if (virDomainCapsCPUModelsAdd(qemuCaps->cpuDefinitions, name[i], -1) < 0)
+        if (virDomainCapsCPUModelsAdd(qemuCaps->cpuDefinitions, name[i], -1,
+                                      VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
             return -1;
     }
 
@@ -2674,7 +2677,8 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps,
 
     for (i = 0; i < ncpus; i++) {
         if (virDomainCapsCPUModelsAddSteal(qemuCaps->cpuDefinitions,
-                                           &cpus[i]->name) < 0)
+                                           &cpus[i]->name,
+                                           VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
             goto cleanup;
     }
 
@@ -3041,7 +3045,8 @@ virQEMUCapsLoadCache(virQEMUCapsPtr qemuCaps, const char *filename,
             }
 
             if (virDomainCapsCPUModelsAddSteal(qemuCaps->cpuDefinitions,
-                                               &str) < 0)
+                                               &str,
+                                               VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
                 goto cleanup;
         }
     }
index 80fd1f0bc29d46ade82aa673181dc754ee1dacae..b75e86ce5da86515db9c2b5d8e212075dc52daab 100644 (file)
@@ -23,9 +23,9 @@
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>Model1</model>
-      <model>Model2</model>
-      <model>Model3</model>
+      <model usable='unknown'>Model1</model>
+      <model usable='no'>Model2</model>
+      <model usable='yes'>Model3</model>
     </mode>
   </cpu>
   <devices>
index 4ee2f9586d8dc367b17ff6bf740f716e31011bf7..2b17dd0f744349aa378e3dd129e974f3a042a345 100644 (file)
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>Opteron_G5</model>
-      <model>Opteron_G4</model>
-      <model>Opteron_G3</model>
-      <model>Opteron_G2</model>
-      <model>Opteron_G1</model>
-      <model>Haswell</model>
-      <model>SandyBridge</model>
-      <model>Westmere</model>
-      <model>Nehalem</model>
-      <model>Penryn</model>
-      <model>Conroe</model>
-      <model>n270</model>
-      <model>athlon</model>
-      <model>pentium3</model>
-      <model>pentium2</model>
-      <model>pentium</model>
-      <model>486</model>
-      <model>coreduo</model>
-      <model>kvm32</model>
-      <model>qemu32</model>
-      <model>kvm64</model>
-      <model>core2duo</model>
-      <model>phenom</model>
-      <model>qemu64</model>
+      <model usable='unknown'>Opteron_G5</model>
+      <model usable='unknown'>Opteron_G4</model>
+      <model usable='unknown'>Opteron_G3</model>
+      <model usable='unknown'>Opteron_G2</model>
+      <model usable='unknown'>Opteron_G1</model>
+      <model usable='unknown'>Haswell</model>
+      <model usable='unknown'>SandyBridge</model>
+      <model usable='unknown'>Westmere</model>
+      <model usable='unknown'>Nehalem</model>
+      <model usable='unknown'>Penryn</model>
+      <model usable='unknown'>Conroe</model>
+      <model usable='unknown'>n270</model>
+      <model usable='unknown'>athlon</model>
+      <model usable='unknown'>pentium3</model>
+      <model usable='unknown'>pentium2</model>
+      <model usable='unknown'>pentium</model>
+      <model usable='unknown'>486</model>
+      <model usable='unknown'>coreduo</model>
+      <model usable='unknown'>kvm32</model>
+      <model usable='unknown'>qemu32</model>
+      <model usable='unknown'>kvm64</model>
+      <model usable='unknown'>core2duo</model>
+      <model usable='unknown'>phenom</model>
+      <model usable='unknown'>qemu64</model>
     </mode>
   </cpu>
   <devices>
index 9e96f47d807c962b27b625e1adec5ce870366cd3..8a54f9e3fd395667b61ee1ec3775f98d3e003f14 100644 (file)
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>pxa262</model>
-      <model>pxa270-a0</model>
-      <model>arm1136</model>
-      <model>cortex-a15</model>
-      <model>pxa260</model>
-      <model>arm1136-r2</model>
-      <model>pxa261</model>
-      <model>pxa255</model>
-      <model>arm926</model>
-      <model>arm11mpcore</model>
-      <model>pxa250</model>
-      <model>ti925t</model>
-      <model>cortex-a57</model>
-      <model>sa1110</model>
-      <model>arm1176</model>
-      <model>cortex-a53</model>
-      <model>sa1100</model>
-      <model>pxa270-c5</model>
-      <model>cortex-a9</model>
-      <model>cortex-a8</model>
-      <model>pxa270-c0</model>
-      <model>arm1026</model>
-      <model>pxa270-b1</model>
-      <model>cortex-m3</model>
-      <model>cortex-m4</model>
-      <model>pxa270-b0</model>
-      <model>arm946</model>
-      <model>cortex-r5</model>
-      <model>pxa270-a1</model>
-      <model>pxa270</model>
+      <model usable='unknown'>pxa262</model>
+      <model usable='unknown'>pxa270-a0</model>
+      <model usable='unknown'>arm1136</model>
+      <model usable='unknown'>cortex-a15</model>
+      <model usable='unknown'>pxa260</model>
+      <model usable='unknown'>arm1136-r2</model>
+      <model usable='unknown'>pxa261</model>
+      <model usable='unknown'>pxa255</model>
+      <model usable='unknown'>arm926</model>
+      <model usable='unknown'>arm11mpcore</model>
+      <model usable='unknown'>pxa250</model>
+      <model usable='unknown'>ti925t</model>
+      <model usable='unknown'>cortex-a57</model>
+      <model usable='unknown'>sa1110</model>
+      <model usable='unknown'>arm1176</model>
+      <model usable='unknown'>cortex-a53</model>
+      <model usable='unknown'>sa1100</model>
+      <model usable='unknown'>pxa270-c5</model>
+      <model usable='unknown'>cortex-a9</model>
+      <model usable='unknown'>cortex-a8</model>
+      <model usable='unknown'>pxa270-c0</model>
+      <model usable='unknown'>arm1026</model>
+      <model usable='unknown'>pxa270-b1</model>
+      <model usable='unknown'>cortex-m3</model>
+      <model usable='unknown'>cortex-m4</model>
+      <model usable='unknown'>pxa270-b0</model>
+      <model usable='unknown'>arm946</model>
+      <model usable='unknown'>cortex-r5</model>
+      <model usable='unknown'>pxa270-a1</model>
+      <model usable='unknown'>pxa270</model>
     </mode>
   </cpu>
   <devices>
index c081b35992bbb2d65168152f4d261c36dd11403b..8d8087fb7cfedba9be1063cf6d73000a2e183423 100644 (file)
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>pxa262</model>
-      <model>pxa270-a0</model>
-      <model>arm1136</model>
-      <model>cortex-a15</model>
-      <model>pxa260</model>
-      <model>arm1136-r2</model>
-      <model>pxa261</model>
-      <model>pxa255</model>
-      <model>arm926</model>
-      <model>arm11mpcore</model>
-      <model>pxa250</model>
-      <model>ti925t</model>
-      <model>cortex-a57</model>
-      <model>sa1110</model>
-      <model>arm1176</model>
-      <model>cortex-a53</model>
-      <model>sa1100</model>
-      <model>pxa270-c5</model>
-      <model>cortex-a9</model>
-      <model>cortex-a8</model>
-      <model>pxa270-c0</model>
-      <model>arm1026</model>
-      <model>pxa270-b1</model>
-      <model>cortex-m3</model>
-      <model>cortex-m4</model>
-      <model>pxa270-b0</model>
-      <model>arm946</model>
-      <model>cortex-r5</model>
-      <model>pxa270-a1</model>
-      <model>pxa270</model>
+      <model usable='unknown'>pxa262</model>
+      <model usable='unknown'>pxa270-a0</model>
+      <model usable='unknown'>arm1136</model>
+      <model usable='unknown'>cortex-a15</model>
+      <model usable='unknown'>pxa260</model>
+      <model usable='unknown'>arm1136-r2</model>
+      <model usable='unknown'>pxa261</model>
+      <model usable='unknown'>pxa255</model>
+      <model usable='unknown'>arm926</model>
+      <model usable='unknown'>arm11mpcore</model>
+      <model usable='unknown'>pxa250</model>
+      <model usable='unknown'>ti925t</model>
+      <model usable='unknown'>cortex-a57</model>
+      <model usable='unknown'>sa1110</model>
+      <model usable='unknown'>arm1176</model>
+      <model usable='unknown'>cortex-a53</model>
+      <model usable='unknown'>sa1100</model>
+      <model usable='unknown'>pxa270-c5</model>
+      <model usable='unknown'>cortex-a9</model>
+      <model usable='unknown'>cortex-a8</model>
+      <model usable='unknown'>pxa270-c0</model>
+      <model usable='unknown'>arm1026</model>
+      <model usable='unknown'>pxa270-b1</model>
+      <model usable='unknown'>cortex-m3</model>
+      <model usable='unknown'>cortex-m4</model>
+      <model usable='unknown'>pxa270-b0</model>
+      <model usable='unknown'>arm946</model>
+      <model usable='unknown'>cortex-r5</model>
+      <model usable='unknown'>pxa270-a1</model>
+      <model usable='unknown'>pxa270</model>
     </mode>
   </cpu>
   <devices>
index 811d2b7246caf47049d38d653d5c2cb28d2eaa22..83c03db465c5202a495100bdfe436c503ac0a03b 100644 (file)
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>pxa262</model>
-      <model>pxa270-a0</model>
-      <model>arm1136</model>
-      <model>cortex-a15</model>
-      <model>pxa260</model>
-      <model>arm1136-r2</model>
-      <model>pxa261</model>
-      <model>pxa255</model>
-      <model>arm926</model>
-      <model>arm11mpcore</model>
-      <model>pxa250</model>
-      <model>ti925t</model>
-      <model>cortex-a57</model>
-      <model>sa1110</model>
-      <model>arm1176</model>
-      <model>cortex-a53</model>
-      <model>sa1100</model>
-      <model>pxa270-c5</model>
-      <model>cortex-a9</model>
-      <model>cortex-a8</model>
-      <model>pxa270-c0</model>
-      <model>arm1026</model>
-      <model>pxa270-b1</model>
-      <model>cortex-m3</model>
-      <model>cortex-m4</model>
-      <model>pxa270-b0</model>
-      <model>arm946</model>
-      <model>cortex-r5</model>
-      <model>pxa270-a1</model>
-      <model>pxa270</model>
+      <model usable='unknown'>pxa262</model>
+      <model usable='unknown'>pxa270-a0</model>
+      <model usable='unknown'>arm1136</model>
+      <model usable='unknown'>cortex-a15</model>
+      <model usable='unknown'>pxa260</model>
+      <model usable='unknown'>arm1136-r2</model>
+      <model usable='unknown'>pxa261</model>
+      <model usable='unknown'>pxa255</model>
+      <model usable='unknown'>arm926</model>
+      <model usable='unknown'>arm11mpcore</model>
+      <model usable='unknown'>pxa250</model>
+      <model usable='unknown'>ti925t</model>
+      <model usable='unknown'>cortex-a57</model>
+      <model usable='unknown'>sa1110</model>
+      <model usable='unknown'>arm1176</model>
+      <model usable='unknown'>cortex-a53</model>
+      <model usable='unknown'>sa1100</model>
+      <model usable='unknown'>pxa270-c5</model>
+      <model usable='unknown'>cortex-a9</model>
+      <model usable='unknown'>cortex-a8</model>
+      <model usable='unknown'>pxa270-c0</model>
+      <model usable='unknown'>arm1026</model>
+      <model usable='unknown'>pxa270-b1</model>
+      <model usable='unknown'>cortex-m3</model>
+      <model usable='unknown'>cortex-m4</model>
+      <model usable='unknown'>pxa270-b0</model>
+      <model usable='unknown'>arm946</model>
+      <model usable='unknown'>cortex-r5</model>
+      <model usable='unknown'>pxa270-a1</model>
+      <model usable='unknown'>pxa270</model>
     </mode>
   </cpu>
   <devices>
index d96927438eee0e87eb56ad307f305fa0a41a7c25..14a087bc1a3f3f07013f8d629151fc984cfd6d58 100644 (file)
@@ -22,8 +22,8 @@
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>POWER8</model>
-      <model>POWER7</model>
+      <model usable='unknown'>POWER8</model>
+      <model usable='unknown'>POWER7</model>
     </mode>
   </cpu>
   <devices>
index 80101a401ded1f5e65c39897b3e12a131cb66e08..4294c64c595e534e513bdab8a568538f9e9fb65e 100644 (file)
     <mode name='host-passthrough' supported='yes'/>
     <mode name='host-model' supported='yes'/>
     <mode name='custom' supported='yes'>
-      <model>Opteron_G5</model>
-      <model>Opteron_G4</model>
-      <model>Opteron_G3</model>
-      <model>Opteron_G2</model>
-      <model>Opteron_G1</model>
-      <model>Broadwell</model>
-      <model>Broadwell-noTSX</model>
-      <model>Haswell</model>
-      <model>Haswell-noTSX</model>
-      <model>IvyBridge</model>
-      <model>SandyBridge</model>
-      <model>Westmere</model>
-      <model>Nehalem</model>
-      <model>Penryn</model>
-      <model>Conroe</model>
-      <model>n270</model>
-      <model>athlon</model>
-      <model>pentium3</model>
-      <model>pentium2</model>
-      <model>pentium</model>
-      <model>486</model>
-      <model>coreduo</model>
-      <model>kvm32</model>
-      <model>qemu32</model>
-      <model>kvm64</model>
-      <model>core2duo</model>
-      <model>phenom</model>
-      <model>qemu64</model>
+      <model usable='unknown'>Opteron_G5</model>
+      <model usable='unknown'>Opteron_G4</model>
+      <model usable='unknown'>Opteron_G3</model>
+      <model usable='unknown'>Opteron_G2</model>
+      <model usable='unknown'>Opteron_G1</model>
+      <model usable='unknown'>Broadwell</model>
+      <model usable='unknown'>Broadwell-noTSX</model>
+      <model usable='unknown'>Haswell</model>
+      <model usable='unknown'>Haswell-noTSX</model>
+      <model usable='unknown'>IvyBridge</model>
+      <model usable='unknown'>SandyBridge</model>
+      <model usable='unknown'>Westmere</model>
+      <model usable='unknown'>Nehalem</model>
+      <model usable='unknown'>Penryn</model>
+      <model usable='unknown'>Conroe</model>
+      <model usable='unknown'>n270</model>
+      <model usable='unknown'>athlon</model>
+      <model usable='unknown'>pentium3</model>
+      <model usable='unknown'>pentium2</model>
+      <model usable='unknown'>pentium</model>
+      <model usable='unknown'>486</model>
+      <model usable='unknown'>coreduo</model>
+      <model usable='unknown'>kvm32</model>
+      <model usable='unknown'>qemu32</model>
+      <model usable='unknown'>kvm64</model>
+      <model usable='unknown'>core2duo</model>
+      <model usable='unknown'>phenom</model>
+      <model usable='unknown'>qemu64</model>
     </mode>
   </cpu>
   <devices>
index 10b745209d1f20f65f01d49e436b510720d18981..511066d9ab1a2b3d89d9223f9c2da355c598e286 100644 (file)
@@ -81,9 +81,12 @@ fillAllCaps(virDomainCapsPtr domCaps)
     cpu->hostPassthrough = true;
     cpu->hostModel = true;
     if (!(cpu->custom = virDomainCapsCPUModelsNew(3)) ||
-        virDomainCapsCPUModelsAdd(cpu->custom, "Model1", -1) < 0 ||
-        virDomainCapsCPUModelsAdd(cpu->custom, "Model2", -1) < 0 ||
-        virDomainCapsCPUModelsAdd(cpu->custom, "Model3", -1) < 0)
+        virDomainCapsCPUModelsAdd(cpu->custom, "Model1", -1,
+                                  VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0 ||
+        virDomainCapsCPUModelsAdd(cpu->custom, "Model2", -1,
+                                  VIR_DOMCAPS_CPU_USABLE_NO) < 0 ||
+        virDomainCapsCPUModelsAdd(cpu->custom, "Model3", -1,
+                                  VIR_DOMCAPS_CPU_USABLE_YES) < 0)
         return -1;
 
     disk->supported = true;