Introduced in QEMU's commit of v2.1.0-rc0~41^2~104 the
memory-backend-ram is going to be present for all QEMU versions
we support (4.2.0, currently). Therefore, we can assume the
capability is always set and thus doesn't need to be checked for.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 27 +++++-----------
src/qemu/qemu_validate.c | 34 ---------------------
tests/qemuxml2argvdata/numatune-memnode.err | 2 +-
tests/qemuxml2argvtest.c | 22 +++++--------
tests/qemuxml2xmltest.c | 5 ++-
5 files changed, 17 insertions(+), 73 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 372f088850..2a7146e6df 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3478,12 +3478,6 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
_("this qemu doesn't support the "
"memory-backend-file object"));
return -1;
- } else if (STREQ(backendType, "memory-backend-ram") &&
- !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("this qemu doesn't support the "
- "memory-backend-ram object"));
- return -1;
} else if (STREQ(backendType, "memory-backend-memfd") &&
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -7223,6 +7217,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
int ret = -1;
size_t ncells = virDomainNumaGetNodeCount(def->numa);
ssize_t masterInitiator = -1;
+ int rc;
if (!virDomainNumatuneNodesetIsAvailable(def->numa, priv->autoNodeset))
goto cleanup;
@@ -7239,21 +7234,13 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
nodeBackends = g_new0(virJSONValue *, ncells);
- /* using of -numa memdev= cannot be combined with -numa mem=, thus we
- * need to check which approach to use */
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) ||
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE) ||
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) {
- int rc;
+ for (i = 0; i < ncells; i++) {
+ if ((rc = qemuBuildMemoryCellBackendProps(def, cfg, i, priv,
+ &nodeBackends[i])) < 0)
+ goto cleanup;
- for (i = 0; i < ncells; i++) {
- if ((rc = qemuBuildMemoryCellBackendProps(def, cfg, i, priv,
- &nodeBackends[i])) < 0)
- goto cleanup;
-
- if (rc == 0)
- needBackend = true;
- }
+ if (rc == 0)
+ needBackend = true;
}
if (!needBackend &&
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 1456a69351..5963442397 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -969,17 +969,6 @@ qemuValidateDomainDefNuma(const virDomainDef *def,
const long system_page_size = virGetSystemPageSizeKB();
size_t ncells = virDomainNumaGetNodeCount(def->numa);
size_t i;
- bool hasMemoryCap = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) ||
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE) ||
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD);
- bool needBacking = false;
-
- if (virDomainNumatuneHasPerNodeBinding(def->numa) && !hasMemoryCap) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Per-node memory binding is not supported "
- "with this QEMU"));
- return -1;
- }
if (def->mem.nhugepages &&
def->mem.hugepages[0].size != system_page_size &&
@@ -993,14 +982,6 @@ qemuValidateDomainDefNuma(const virDomainDef *def,
for (i = 0; i < ncells; i++) {
virBitmap *cpumask = virDomainNumaGetNodeCpumask(def->numa, i);
- if (!hasMemoryCap &&
- virDomainNumaGetNodeMemoryAccessMode(def->numa, i)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Shared memory mapping is not supported "
- "with this QEMU"));
- return -1;
- }
-
if (cpumask) {
g_autofree char * cpumaskStr = NULL;
if (!(cpumaskStr = virBitmapFormat(cpumask)))
@@ -1016,15 +997,7 @@ qemuValidateDomainDefNuma(const virDomainDef *def,
}
}
- if (!virQEMUCapsGetMachineNumaMemSupported(qemuCaps,
- def->virtType,
- def->os.machine)) {
- needBacking = true;
- }
-
if (virDomainNumaHasHMAT(def->numa)) {
- needBacking = true;
-
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NUMA_HMAT)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("HMAT is not supported with this QEMU"));
@@ -1032,13 +1005,6 @@ qemuValidateDomainDefNuma(const virDomainDef *def,
}
}
- if (needBacking && !hasMemoryCap) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("NUMA without specified memory backing is not "
- "supported with this QEMU binary"));
- return -1;
- }
-
return 0;
}
diff --git a/tests/qemuxml2argvdata/numatune-memnode.err
b/tests/qemuxml2argvdata/numatune-memnode.err
index 1d5e57f996..ff4b1cce2e 100644
--- a/tests/qemuxml2argvdata/numatune-memnode.err
+++ b/tests/qemuxml2argvdata/numatune-memnode.err
@@ -1 +1 @@
-unsupported configuration: Per-node memory binding is not supported with this QEMU
+unsupported configuration: disjoint NUMA cpu ranges are not supported with this QEMU
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 148d6b439e..4d02b0f97c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1235,7 +1235,6 @@ mymain(void)
DO_TEST_CAPS_LATEST("hugepages-memaccess");
DO_TEST_CAPS_LATEST("hugepages-memaccess2");
DO_TEST_PARSE_ERROR("hugepages-memaccess3",
- QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST_CAPS_LATEST("hugepages-memaccess3");
DO_TEST_CAPS_LATEST("hugepages-nvdimm");
@@ -1869,7 +1868,6 @@ mymain(void)
ARG_MIGRATE_FD, 7,
ARG_QEMU_CAPS,
QEMU_CAPS_NUMA,
- QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_LAST,
ARG_END);
@@ -1909,7 +1907,7 @@ mymain(void)
DO_TEST_PARSE_ERROR_NOCAPS("cpu-numa3");
DO_TEST_PARSE_ERROR_NOCAPS("cpu-numa-disjoint");
DO_TEST("cpu-numa-disjoint", QEMU_CAPS_NUMA);
- DO_TEST_FAILURE("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_RAM);
+ DO_TEST_FAILURE_NOCAPS("cpu-numa-memshared");
DO_TEST("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("cpu-host-model",
QEMU_CAPS_DEVICE_PCI_BRIDGE,
@@ -1968,7 +1966,6 @@ mymain(void)
DO_TEST("cputune-numatune",
QEMU_CAPS_KVM,
QEMU_CAPS_OBJECT_IOTHREAD,
- QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("vcpu-placement-static",
QEMU_CAPS_KVM,
@@ -1978,8 +1975,7 @@ mymain(void)
DO_TEST_NOCAPS("numatune-memory");
DO_TEST_PARSE_ERROR_NOCAPS("numatune-memory-invalid-nodeset");
DO_TEST("numatune-memnode",
- QEMU_CAPS_NUMA,
- QEMU_CAPS_OBJECT_MEMORY_RAM);
+ QEMU_CAPS_NUMA);
DO_TEST_PARSE_ERROR_NOCAPS("numatune-memnode");
DO_TEST_CAPS_VER("numatune-memnode", "5.2.0");
DO_TEST_CAPS_LATEST("numatune-memnode");
@@ -1988,19 +1984,16 @@ mymain(void)
DO_TEST_CAPS_LATEST("numatune-system-memory");
DO_TEST("numatune-memnode-no-memory",
- QEMU_CAPS_NUMA,
- QEMU_CAPS_OBJECT_MEMORY_RAM);
- DO_TEST_PARSE_ERROR_NOCAPS("numatune-memnode-no-memory");
+ QEMU_CAPS_NUMA);
DO_TEST("numatune-distances", QEMU_CAPS_NUMA);
DO_TEST_NOCAPS("numatune-no-vcpu");
DO_TEST_CAPS_LATEST("numatune-hmat");
DO_TEST_NOCAPS("numatune-auto-nodeset-invalid");
- DO_TEST("numatune-auto-prefer", QEMU_CAPS_OBJECT_MEMORY_RAM,
+ DO_TEST("numatune-auto-prefer",
QEMU_CAPS_OBJECT_MEMORY_FILE);
- DO_TEST_FAILURE("numatune-static-nodeset-exceed-hostnode",
- QEMU_CAPS_OBJECT_MEMORY_RAM);
+ DO_TEST_FAILURE_NOCAPS("numatune-static-nodeset-exceed-hostnode");
DO_TEST_PARSE_ERROR_NOCAPS("numatune-memnode-nocpu");
DO_TEST_PARSE_ERROR_NOCAPS("numatune-memnodes-problematic");
DO_TEST_NOCAPS("numad");
@@ -2645,17 +2638,16 @@ mymain(void)
DO_TEST_NOCAPS("memory-hotplug");
DO_TEST("memory-hotplug", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA);
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
- QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
+ QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST_CAPS_LATEST("memory-hotplug-dimm-addr");
DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM,
QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
- QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
+ QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update", "",
ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
ARG_QEMU_CAPS,
QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM,
QEMU_CAPS_NUMA, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
- QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_OBJECT_MEMORY_FILE,
QEMU_CAPS_LAST,
ARG_END);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 966496604d..7c2f525c68 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -933,7 +933,7 @@ mymain(void)
DO_TEST("numatune-memnode-no-memory", QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("numatune-distances", QEMU_CAPS_NUMA);
DO_TEST("numatune-no-vcpu", QEMU_CAPS_NUMA);
- DO_TEST("numatune-hmat", QEMU_CAPS_NUMA_HMAT,
QEMU_CAPS_OBJECT_MEMORY_RAM);
+ DO_TEST("numatune-hmat", QEMU_CAPS_NUMA_HMAT);
DO_TEST_CAPS_LATEST("numatune-memnode-restrictive-mode");
DO_TEST_NOCAPS("firmware-manual-bios");
@@ -1026,13 +1026,12 @@ mymain(void)
DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM,
QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
- QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
+ QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update", "",
WHEN_BOTH,
ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
ARG_QEMU_CAPS,
QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM,
QEMU_CAPS_NUMA, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
- QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_LAST, ARG_END);
DO_TEST_NOCAPS("memory-hotplug");
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM);
--
2.37.4