Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Notes:
Version 2:
- no change
src/cpu/cpu_ppc64.c | 20 ++++++++++++++++++++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++---
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 8 ++++----
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 8 ++++----
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 8 ++++----
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 8 ++++----
6 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 9997e14a89..7da67ec94a 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -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,
};
diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
index 6d09c5ae4e..7093c35355 100644
--- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml
@@ -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'>
diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
index 032a4f4e19..b944723885 100644
--- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml
@@ -40,10 +40,10 @@
<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'>
diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
index 570d88235b..71f47c8748 100644
--- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml
@@ -40,10 +40,10 @@
<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'>
diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
index c2fe03d227..bf2c679c51 100644
--- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml
@@ -40,10 +40,10 @@
<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'>
diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
index 06e713373e..8f6f9f57e1 100644
--- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
+++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml
@@ -40,10 +40,10 @@
<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'>
--
2.38.0