On a Thursday in 2020, Michal Privoznik wrote:
There is 'numa-mem-supported' machine attribute which
specifies
whether '-numa mem=' is supported. Store it in our capabilities
as it will be used in later commits when building the command
line.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 44 ++-
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_capspriv.h | 3 +-
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 11 +
.../caps_1.5.3.x86_64.xml | 60 ++--
.../caps_1.6.0.x86_64.xml | 68 ++---
.../caps_1.7.0.x86_64.xml | 76 ++---
.../caps_2.1.1.x86_64.xml | 92 +++---
.../caps_2.10.0.aarch64.xml | 204 +++++++-------
.../caps_2.10.0.ppc64.xml | 84 +++---
.../caps_2.10.0.s390x.xml | 28 +-
.../caps_2.10.0.x86_64.xml | 140 +++++-----
.../caps_2.11.0.s390x.xml | 32 +--
.../caps_2.11.0.x86_64.xml | 140 +++++-----
.../caps_2.12.0.aarch64.xml | 228 +++++++--------
.../caps_2.12.0.ppc64.xml | 100 +++----
.../caps_2.12.0.s390x.xml | 36 +--
.../caps_2.12.0.x86_64.xml | 148 +++++-----
.../caps_2.4.0.x86_64.xml | 116 ++++----
.../caps_2.5.0.x86_64.xml | 124 ++++----
.../caps_2.6.0.aarch64.xml | 164 +++++------
.../qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 60 ++--
.../caps_2.6.0.x86_64.xml | 100 +++----
.../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 16 +-
.../caps_2.7.0.x86_64.xml | 108 +++----
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 20 +-
.../caps_2.8.0.x86_64.xml | 124 ++++----
.../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 80 +++---
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 24 +-
.../caps_2.9.0.x86_64.xml | 132 ++++-----
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 104 +++----
.../caps_3.0.0.riscv32.xml | 10 +-
.../caps_3.0.0.riscv64.xml | 10 +-
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 40 +--
.../caps_3.0.0.x86_64.xml | 156 +++++------
.../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 108 +++----
.../caps_3.1.0.x86_64.xml | 164 +++++------
.../caps_4.0.0.aarch64.xml | 264 +++++++++---------
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 112 ++++----
.../caps_4.0.0.riscv32.xml | 10 +-
.../caps_4.0.0.riscv64.xml | 10 +-
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 48 ++--
.../caps_4.0.0.x86_64.xml | 164 +++++------
.../caps_4.1.0.x86_64.xml | 176 ++++++------
.../caps_4.2.0.aarch64.xml | 52 ++--
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 72 ++---
.../caps_4.2.0.x86_64.xml | 184 ++++++------
.../caps_5.0.0.aarch64.xml | 52 ++--
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 76 ++---
.../caps_5.0.0.x86_64.xml | 176 ++++++------
.../caps_5.1.0.x86_64.xml | 176 ++++++------
tests/testutilsqemu.c | 6 +-
53 files changed, 2395 insertions(+), 2341 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7e711f22f8..2676fbab6f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -594,6 +594,7 @@ struct _virQEMUCapsMachineType {
bool hotplugCpus;
bool qemuDefault;
char *defaultCPU;
+ bool numaMemSupported;
};
typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData;
@@ -1869,6 +1870,7 @@ virQEMUCapsAccelCopyMachineTypes(virQEMUCapsAccelPtr dst,
dst->machineTypes[i].maxCpus = src->machineTypes[i].maxCpus;
dst->machineTypes[i].hotplugCpus = src->machineTypes[i].hotplugCpus;
dst->machineTypes[i].qemuDefault = src->machineTypes[i].qemuDefault;
+ dst->machineTypes[i].numaMemSupported =
src->machineTypes[i].numaMemSupported;
}
}
@@ -2510,6 +2512,28 @@ virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps,
}
+bool
+virQEMUCapsGetMachineNumaMemSupported(virQEMUCapsPtr qemuCaps,
+ virDomainVirtType virtType,
+ const char *name)
+{
+ virQEMUCapsAccelPtr accel;
+ size_t i;
+
+ if (!name)
+ return 0;
+
The function returns bool, not int. Is it even possible to call it with
a null machine name?
Jano
+ accel = virQEMUCapsGetAccel(qemuCaps, virtType);
+
+ for (i = 0; i < accel->nmachineTypes; i++) {
+ if (STREQ(accel->machineTypes[i].name, name))
+ return accel->machineTypes[i].numaMemSupported;
+ }
+
+ return false;
+}
+
+