]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu_ppc64: Implement virCPUGetVendorForModel
authorJiri Denemark <jdenemar@redhat.com>
Thu, 29 Sep 2022 19:51:22 +0000 (21:51 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 10 Oct 2022 12:31:43 +0000 (14:31 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_ppc64.c
tests/domaincapsdata/qemu_4.2.0.ppc64.xml
tests/domaincapsdata/qemu_5.0.0.ppc64.xml
tests/domaincapsdata/qemu_5.2.0.ppc64.xml
tests/domaincapsdata/qemu_6.2.0.ppc64.xml
tests/domaincapsdata/qemu_7.0.0.ppc64.xml

index 9997e14a89a4057f5c4a1e2b2861dbd423c72b12..7da67ec94ade4cfe466ce53f2f323ecd97f83b38 100644 (file)
@@ -780,6 +780,25 @@ virCPUppc64DriverGetModels(char ***models)
     return map->nmodels;
 }
 
+
+static const char *
+virCPUppc64GetVendorForModel(const char *modelName)
+{
+    virCPUppc64Map *map = NULL;
+    virCPUppc64Model *model;
+
+    if (!(map = virCPUppc64GetMap()))
+        return NULL;
+
+    model = ppc64ModelFind(map, modelName);
+
+    if (!model || !model->vendor)
+        return NULL;
+
+    return model->vendor->name;
+}
+
+
 struct cpuArchDriver cpuDriverPPC64 = {
     .name       = "ppc64",
     .arch       = archs,
@@ -793,6 +812,7 @@ struct cpuArchDriver cpuDriverPPC64 = {
     .baseline   = virCPUppc64Baseline,
     .update     = virCPUppc64Update,
     .getModels  = virCPUppc64DriverGetModels,
+    .getVendorForModel = virCPUppc64GetVendorForModel,
     .convertLegacy = virCPUppc64ConvertLegacy,
     .dataIsIdentical = virCPUppc64DataIsIdentical,
 };
index 6d09c5ae4eff56486a7857bf432e4f828af64d8a..7093c35355349442461fa541d0804e670b8db2df 100644 (file)
@@ -40,9 +40,9 @@
       <model fallback='allow'>POWER8</model>
     </mode>
     <mode name='custom' supported='yes'>
-      <model usable='unknown' vendor='unknown'>POWER9</model>
-      <model usable='unknown' vendor='unknown'>POWER8</model>
-      <model usable='unknown' vendor='unknown'>POWER7</model>
+      <model usable='unknown' vendor='IBM'>POWER9</model>
+      <model usable='unknown' vendor='IBM'>POWER8</model>
+      <model usable='unknown' vendor='IBM'>POWER7</model>
     </mode>
   </cpu>
   <memoryBacking supported='yes'>
index 032a4f4e195c91f8b40072512a27173b6a6a6827..b94472388590701f885527fdb1b12bb8c476ba0f 100644 (file)
       <model fallback='allow'>POWER8</model>
     </mode>
     <mode name='custom' supported='yes'>
-      <model usable='unknown' vendor='unknown'>POWER10</model>
-      <model usable='unknown' vendor='unknown'>POWER9</model>
-      <model usable='unknown' vendor='unknown'>POWER8</model>
-      <model usable='unknown' vendor='unknown'>POWER7</model>
+      <model usable='unknown' vendor='IBM'>POWER10</model>
+      <model usable='unknown' vendor='IBM'>POWER9</model>
+      <model usable='unknown' vendor='IBM'>POWER8</model>
+      <model usable='unknown' vendor='IBM'>POWER7</model>
     </mode>
   </cpu>
   <memoryBacking supported='yes'>
index 570d88235b0e3f07556a65c899659b52b2cb7f08..71f47c87488ef78b7e7b08e3137c91055597d6b0 100644 (file)
       <model fallback='allow'>POWER8</model>
     </mode>
     <mode name='custom' supported='yes'>
-      <model usable='unknown' vendor='unknown'>POWER10</model>
-      <model usable='unknown' vendor='unknown'>POWER9</model>
-      <model usable='unknown' vendor='unknown'>POWER8</model>
-      <model usable='unknown' vendor='unknown'>POWER7</model>
+      <model usable='unknown' vendor='IBM'>POWER10</model>
+      <model usable='unknown' vendor='IBM'>POWER9</model>
+      <model usable='unknown' vendor='IBM'>POWER8</model>
+      <model usable='unknown' vendor='IBM'>POWER7</model>
     </mode>
   </cpu>
   <memoryBacking supported='yes'>
index c2fe03d2279b1e2fc3ae527060093aaa2841cd06..bf2c679c51a5326c7761d3fa1e3ed817b0209378 100644 (file)
       <model fallback='allow'>POWER8</model>
     </mode>
     <mode name='custom' supported='yes'>
-      <model usable='unknown' vendor='unknown'>POWER10</model>
-      <model usable='unknown' vendor='unknown'>POWER9</model>
-      <model usable='unknown' vendor='unknown'>POWER8</model>
-      <model usable='unknown' vendor='unknown'>POWER7</model>
+      <model usable='unknown' vendor='IBM'>POWER10</model>
+      <model usable='unknown' vendor='IBM'>POWER9</model>
+      <model usable='unknown' vendor='IBM'>POWER8</model>
+      <model usable='unknown' vendor='IBM'>POWER7</model>
     </mode>
   </cpu>
   <memoryBacking supported='yes'>
index 06e713373eae4b621e1975a343f23603357b5492..8f6f9f57e1e1043ac46a13cdcb8bb969d8e74196 100644 (file)
       <model fallback='allow'>POWER8</model>
     </mode>
     <mode name='custom' supported='yes'>
-      <model usable='unknown' vendor='unknown'>POWER10</model>
-      <model usable='unknown' vendor='unknown'>POWER9</model>
-      <model usable='unknown' vendor='unknown'>POWER8</model>
-      <model usable='unknown' vendor='unknown'>POWER7</model>
+      <model usable='unknown' vendor='IBM'>POWER10</model>
+      <model usable='unknown' vendor='IBM'>POWER9</model>
+      <model usable='unknown' vendor='IBM'>POWER8</model>
+      <model usable='unknown' vendor='IBM'>POWER7</model>
     </mode>
   </cpu>
   <memoryBacking supported='yes'>