[PATCH 1/1] qemu_capabilities.c: modernize virQEMUCapsCacheLookupDefault
by Daniel Henrique Barboza
Use g_autoptr() in qemuCaps to get rid of a virObjectUnref call,
a 'cleanup' label and the 'ret' pointer.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
Found this while reviewing a patch last week.
src/qemu/qemu_capabilities.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 484fff99e5..b46f3d8c2c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5735,8 +5735,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
virArch hostarch = virArchFromHost();
virArch arch = hostarch;
virDomainVirtType capsType;
- virQEMUCapsPtr qemuCaps = NULL;
- virQEMUCapsPtr ret = NULL;
+ g_autoptr(virQEMUCaps) qemuCaps = NULL;
virArch arch_from_caps;
g_autofree char *probedbinary = NULL;
@@ -5744,14 +5743,14 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
(virttype = virDomainVirtTypeFromString(virttypeStr)) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("unknown virttype: %s"), virttypeStr);
- goto cleanup;
+ return NULL;
}
if (archStr &&
(arch = virArchFromString(archStr)) == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INVALID_ARG,
_("unknown architecture: %s"), archStr);
- goto cleanup;
+ return NULL;
}
if (!binary) {
@@ -5760,7 +5759,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
}
if (!(qemuCaps = virQEMUCapsCacheLookup(cache, binary)))
- goto cleanup;
+ return NULL;
arch_from_caps = virQEMUCapsGetArch(qemuCaps);
@@ -5774,7 +5773,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
"match given architecture '%s'"),
virArchToString(arch_from_caps),
virArchToString(arch));
- goto cleanup;
+ return NULL;
}
capsType = virQEMUCapsGetVirtType(qemuCaps);
@@ -5786,7 +5785,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
virReportError(VIR_ERR_INVALID_ARG,
_("KVM is not supported by '%s' on this host"),
binary);
- goto cleanup;
+ return NULL;
}
if (machine) {
@@ -5797,7 +5796,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
virReportError(VIR_ERR_INVALID_ARG,
_("the machine '%s' is not supported by emulator '%s'"),
machine, binary);
- goto cleanup;
+ return NULL;
}
} else {
machine = virQEMUCapsGetPreferredMachine(qemuCaps, virttype);
@@ -5810,11 +5809,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
if (retMachine)
*retMachine = machine;
- ret = g_steal_pointer(&qemuCaps);
-
- cleanup:
- virObjectUnref(qemuCaps);
- return ret;
+ return g_steal_pointer(&qemuCaps);
}
bool
--
2.26.2
4 years, 6 months
[PATCH] qemu: Correct the log name for qemu_security.c
by Yi Wang
From: Liao Pingfang <liao.pingfang(a)zte.com.cn>
Correct the log name for qemu_security.c to qemu.qemu_security
instead of qemu.qemu_process.
Signed-off-by: Liao Pingfang <liao.pingfang(a)zte.com.cn>
---
src/qemu/qemu_security.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c
index f49c089..3b6d6e9 100644
--- a/src/qemu/qemu_security.c
+++ b/src/qemu/qemu_security.c
@@ -26,7 +26,7 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
-VIR_LOG_INIT("qemu.qemu_process");
+VIR_LOG_INIT("qemu.qemu_security");
int
--
2.9.5
4 years, 6 months
[libvirt PATCH v2] qemu: don't continue loading caps if outdated
by Daniel P. Berrangé
The XML format used for QEMU capabilities is not required to be
stable across releases, as we invalidate the cache whenever the
libvirt binary changes.
We none the less always try to parse te entire XML file before
we do any validity checks. Thus if we change the format of any
part of the data, or change permitted values for enums, then
libvirtd logs will be spammed with errors.
These are not in fact errors, but an expected scenario.
This change makes the loading code validate the cache timestamp
against the libvirtd timestamp immediately. If they don't match
then we stop loading the rest of the XML file.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 63 +++++++++++++++++++++++-------------
src/qemu/qemu_capspriv.h | 6 ++--
src/util/virfilecache.c | 11 ++++---
src/util/virfilecache.h | 11 +++++--
tests/testutilsqemu.c | 3 +-
tests/virfilecachetest.c | 3 +-
6 files changed, 61 insertions(+), 36 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 484fff99e5..3053aa31f9 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1807,14 +1807,6 @@ virQEMUCapsNewBinary(const char *binary)
}
-void
-virQEMUCapsSetInvalidation(virQEMUCapsPtr qemuCaps,
- bool enabled)
-{
- qemuCaps->invalidation = enabled;
-}
-
-
static int
virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst,
virQEMUCapsHostCPUDataPtr src)
@@ -4205,11 +4197,14 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt)
* <machine name='pc-1.0' alias='pc' hotplugCpus='yes' maxCpus='4' default='yes' numaMemSupported='yes'/>
* ...
* </qemuCaps>
+ *
+ * Returns 0 on success, 1 if outdated, -1 on error
*/
int
virQEMUCapsLoadCache(virArch hostArch,
virQEMUCapsPtr qemuCaps,
- const char *filename)
+ const char *filename,
+ bool skipInvalidation)
{
xmlDocPtr doc = NULL;
int ret = -1;
@@ -4237,6 +4232,31 @@ virQEMUCapsLoadCache(virArch hostArch,
goto cleanup;
}
+ if (virXPathLongLong("string(./selfctime)", ctxt, &l) < 0) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing selfctime in QEMU capabilities XML"));
+ goto cleanup;
+ }
+ qemuCaps->libvirtCtime = (time_t)l;
+
+ qemuCaps->libvirtVersion = 0;
+ if (virXPathULong("string(./selfvers)", ctxt, &lu) == 0)
+ qemuCaps->libvirtVersion = lu;
+
+ if (!skipInvalidation &&
+ (qemuCaps->libvirtCtime != virGetSelfLastChanged() ||
+ qemuCaps->libvirtVersion != LIBVIR_VERSION_NUMBER)) {
+ VIR_DEBUG("Outdated capabilities in %s: libvirt changed "
+ "(%lld vs %lld, %lu vs %lu), stopping load",
+ qemuCaps->binary,
+ (long long)qemuCaps->libvirtCtime,
+ (long long)virGetSelfLastChanged(),
+ (unsigned long)qemuCaps->libvirtVersion,
+ (unsigned long)LIBVIR_VERSION_NUMBER);
+ ret = 1;
+ goto cleanup;
+ }
+
if (!(str = virXPathString("string(./emulator)", ctxt))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing emulator in QEMU capabilities cache"));
@@ -4256,17 +4276,6 @@ virQEMUCapsLoadCache(virArch hostArch,
}
qemuCaps->ctime = (time_t)l;
- if (virXPathLongLong("string(./selfctime)", ctxt, &l) < 0) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("missing selfctime in QEMU capabilities XML"));
- goto cleanup;
- }
- qemuCaps->libvirtCtime = (time_t)l;
-
- qemuCaps->libvirtVersion = 0;
- if (virXPathULong("string(./selfvers)", ctxt, &lu) == 0)
- qemuCaps->libvirtVersion = lu;
-
if ((n = virXPathNodeSet("./flag", ctxt, &nodes)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to parse qemu capabilities flags"));
@@ -4418,6 +4427,9 @@ virQEMUCapsLoadCache(virArch hostArch,
if (virXPathBoolean("boolean(./kvmSupportsSecureGuest)", ctxt) > 0)
qemuCaps->kvmSupportsSecureGuest = true;
+ if (skipInvalidation)
+ qemuCaps->invalidation = false;
+
ret = 0;
cleanup:
VIR_FREE(str);
@@ -5489,16 +5501,23 @@ virQEMUCapsNewData(const char *binary,
static void *
virQEMUCapsLoadFile(const char *filename,
const char *binary,
- void *privData)
+ void *privData,
+ bool *outdated)
{
virQEMUCapsPtr qemuCaps = virQEMUCapsNewBinary(binary);
virQEMUCapsCachePrivPtr priv = privData;
+ int ret;
if (!qemuCaps)
return NULL;
- if (virQEMUCapsLoadCache(priv->hostArch, qemuCaps, filename) < 0)
+ ret = virQEMUCapsLoadCache(priv->hostArch, qemuCaps, filename, false);
+ if (ret < 0)
goto error;
+ if (ret == 1) {
+ *outdated = true;
+ goto error;
+ }
return qemuCaps;
diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h
index 5d2f448e41..f6c06ea008 100644
--- a/src/qemu/qemu_capspriv.h
+++ b/src/qemu/qemu_capspriv.h
@@ -37,12 +37,10 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch,
unsigned int microcodeVersion,
const char *kernelVersion);
-void virQEMUCapsSetInvalidation(virQEMUCapsPtr qemuCaps,
- bool enabled);
-
int virQEMUCapsLoadCache(virArch hostArch,
virQEMUCapsPtr qemuCaps,
- const char *filename);
+ const char *filename,
+ bool skipInvalidation);
char *virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps);
int
diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c
index aecabf173d..2162917b11 100644
--- a/src/util/virfilecache.c
+++ b/src/util/virfilecache.c
@@ -130,6 +130,7 @@ virFileCacheLoad(virFileCachePtr cache,
g_autofree char *file = NULL;
int ret = -1;
void *loadData = NULL;
+ bool outdated = false;
*data = NULL;
@@ -148,10 +149,12 @@ virFileCacheLoad(virFileCachePtr cache,
goto cleanup;
}
- if (!(loadData = cache->handlers.loadFile(file, name, cache->priv))) {
- VIR_WARN("Failed to load cached data from '%s' for '%s': %s",
- file, name, virGetLastErrorMessage());
- virResetLastError();
+ if (!(loadData = cache->handlers.loadFile(file, name, cache->priv, &outdated))) {
+ if (!outdated) {
+ VIR_WARN("Failed to load cached data from '%s' for '%s': %s",
+ file, name, virGetLastErrorMessage());
+ virResetLastError();
+ }
ret = 0;
goto cleanup;
}
diff --git a/src/util/virfilecache.h b/src/util/virfilecache.h
index 006a9717cb..9a7edf07e6 100644
--- a/src/util/virfilecache.h
+++ b/src/util/virfilecache.h
@@ -62,15 +62,20 @@ typedef void *
* @filename: name of a file with cached data
* @name: name of the cached data
* @priv: private data created together with cache
+ * @outdated: set to true if data was outdated
*
- * Loads the cached data from a file @filename.
+ * Loads the cached data from a file @filename. If
+ * NULL is returned, then @oudated indicates whether
+ * this was due to the data being outdated, or an
+ * error loading the cache.
*
- * Returns cached data object or NULL on error.
+ * Returns cached data object or NULL on outdated data or error.
*/
typedef void *
(*virFileCacheLoadFilePtr)(const char *filename,
const char *name,
- void *priv);
+ void *priv,
+ bool *outdated);
/**
* virFileCacheSaveFilePtr:
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 4dcc3089dd..e3b1e2813b 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -293,10 +293,9 @@ qemuTestParseCapabilitiesArch(virArch arch,
virArchToString(arch));
if (!(qemuCaps = virQEMUCapsNewBinary(binary)) ||
- virQEMUCapsLoadCache(arch, qemuCaps, capsFile) < 0)
+ virQEMUCapsLoadCache(arch, qemuCaps, capsFile, true) < 0)
goto error;
- virQEMUCapsSetInvalidation(qemuCaps, false);
return qemuCaps;
error:
diff --git a/tests/virfilecachetest.c b/tests/virfilecachetest.c
index 6d280b3bec..34e0d0ab2f 100644
--- a/tests/virfilecachetest.c
+++ b/tests/virfilecachetest.c
@@ -110,7 +110,8 @@ testFileCacheNewData(const char *name G_GNUC_UNUSED,
static void *
testFileCacheLoadFile(const char *filename,
const char *name G_GNUC_UNUSED,
- void *priv G_GNUC_UNUSED)
+ void *priv G_GNUC_UNUSED,
+ bool *outdated G_GNUC_UNUSED)
{
testFileCacheObjPtr obj;
char *data;
--
2.24.1
4 years, 6 months
[PATCH 00/12] qemuxml2*test: Improve testing of SCSI hostdevs
by Peter Krempa
Switch to qemu caps based testing to validate pre and post blockdev
configs.
This is split out from my unfinished series for switching hostdevs to
blockdev.
Peter Krempa (12):
qemuxml2argvtest: hostdev-scsi-lsi: Modernize to qemu-4.1
qemuxml2argvtest: hostdev-scsi-lsi: Add qemu-2.8 variant
qemuxml2argvtest: hostdev-scsi-lsi: Add "latest" caps version
qemuxml2argvtest: hostdev-scsi-lsi: Add test of readonly variant
qemuxml2argvtest: hostdev-scsi-lsi: Integrate 'hostdev-scsi-lsi-iscsi'
case
qemuxml2argvtest: hostdev-scsi-lsi: Integrate
'hostdev-scsi-lsi-iscsi-auth' case
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Modernize to qemu-4.1
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add "latest" caps version
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add qemu-2.8 variant
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Integrate
'hostdev-scsi-readonly'
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Integrate
'hostdev-scsi-virtio-iscsi' case
qemuxml2argvtest: hostdev-scsi-virtio-scsi: Integrate iSCSI
authentication cases
...sk-hostdev-scsi-virtio-iscsi-auth-AES.args | 49 ------------
...isk-hostdev-scsi-virtio-iscsi-auth-AES.xml | 43 -----------
.../hostdev-scsi-lsi-iscsi-auth.args | 37 ----------
.../hostdev-scsi-lsi-iscsi-auth.xml | 48 ------------
.../hostdev-scsi-lsi-iscsi.args | 37 ----------
.../hostdev-scsi-lsi-iscsi.xml | 42 -----------
tests/qemuxml2argvdata/hostdev-scsi-lsi.args | 33 ---------
.../hostdev-scsi-lsi.x86_64-2.8.0.args | 51 +++++++++++++
.../hostdev-scsi-lsi.x86_64-4.1.0.args | 64 ++++++++++++++++
.../hostdev-scsi-lsi.x86_64-latest.args | 68 +++++++++++++++++
tests/qemuxml2argvdata/hostdev-scsi-lsi.xml | 38 ++++++++++
.../hostdev-scsi-readonly.args | 34 ---------
.../hostdev-scsi-readonly.xml | 38 ----------
.../hostdev-scsi-virtio-iscsi-auth.xml | 48 ------------
.../hostdev-scsi-virtio-iscsi.args | 39 ----------
.../hostdev-scsi-virtio-iscsi.xml | 42 -----------
.../hostdev-scsi-virtio-scsi.args | 34 ---------
...ostdev-scsi-virtio-scsi.x86_64-2.8.0.args} | 40 +++++++---
...hostdev-scsi-virtio-scsi.x86_64-4.1.0.args | 70 ++++++++++++++++++
...ostdev-scsi-virtio-scsi.x86_64-latest.args | 74 +++++++++++++++++++
.../hostdev-scsi-virtio-scsi.xml | 38 ++++++++++
tests/qemuxml2argvtest.c | 36 ++-------
.../hostdev-scsi-lsi-iscsi-auth.xml | 57 --------------
.../hostdev-scsi-lsi-iscsi.xml | 51 -------------
tests/qemuxml2xmloutdata/hostdev-scsi-lsi.xml | 38 ++++++++++
.../hostdev-scsi-readonly.xml | 47 ------------
.../hostdev-scsi-virtio-iscsi-auth.xml | 57 --------------
.../hostdev-scsi-virtio-iscsi.xml | 51 -------------
.../hostdev-scsi-virtio-scsi.xml | 38 ++++++++++
tests/qemuxml2xmltest.c | 16 ----
30 files changed, 515 insertions(+), 843 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/disk-hostdev-scsi-virtio-iscsi-auth-AES.args
delete mode 100644 tests/qemuxml2argvdata/disk-hostdev-scsi-virtio-iscsi-auth-AES.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi-iscsi-auth.args
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi-iscsi-auth.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi-iscsi.args
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi-iscsi.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi.args
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-2.8.0.args
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-4.1.0.args
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-readonly.args
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-readonly.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-iscsi-auth.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-iscsi.args
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-iscsi.xml
delete mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.args
rename tests/qemuxml2argvdata/{hostdev-scsi-virtio-iscsi-auth.args => hostdev-scsi-virtio-scsi.x86_64-2.8.0.args} (52%)
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-4.1.0.args
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args
delete mode 100644 tests/qemuxml2xmloutdata/hostdev-scsi-lsi-iscsi-auth.xml
delete mode 100644 tests/qemuxml2xmloutdata/hostdev-scsi-lsi-iscsi.xml
delete mode 100644 tests/qemuxml2xmloutdata/hostdev-scsi-readonly.xml
delete mode 100644 tests/qemuxml2xmloutdata/hostdev-scsi-virtio-iscsi-auth.xml
delete mode 100644 tests/qemuxml2xmloutdata/hostdev-scsi-virtio-iscsi.xml
--
2.26.2
4 years, 6 months
[PATCH 0/2] Support hooks placed in several files
by Dmitry Nesterenko
Libvirt hook calls only one script (/etc/libvirt/hooks/<driver>) now.
This is not convenient if scripts for hook are provided by many vendors.
Script one vendor can replace previously installed script other vendor.
These patches are changing behaviour of hooks to usual linux scheme -
running all scripts from directory /etc/libvirt/hooks/<driver>.d in
alphabetical order. If we find script in old place we will execute it
as first for backward compatibility.
Dmitry Nesterenko (2):
virthook: refactoring for support hooks placed in several files
virhook: support hooks placed in several files
src/util/virhook.c | 168 +++++++++++++++++++++++++++++++++++++++------
1 file changed, 146 insertions(+), 22 deletions(-)
--
2.18.4
4 years, 6 months
[PATCH v5 for-5.0? 0/7] Tighten qemu-img rules on missing backing format
by Eric Blake
v4 was here:
https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg03775.html
In v5:
- fix 'qemu-img convert -B' to actually warn [Kashyap]
- squash in followups
- a couple more iotest improvements
If we decide this is not 5.0 material, then patches 4 and 7 need a
tweak to s/5.0/5.1/ as the start of the deprecation clock.
Eric Blake (7):
sheepdog: Add trivial backing_fmt support
vmdk: Add trivial backing_fmt support
qcow: Tolerate backing_fmt=, but warn on backing_fmt=raw
qcow2: Deprecate use of qemu-img amend to change backing file
iotests: Specify explicit backing format where sensible
block: Add support to warn on backing file change without format
qemu-img: Deprecate use of -b without -F
docs/system/deprecated.rst | 32 ++++++++++++++++
docs/tools/qemu-img.rst | 4 ++
include/block/block.h | 4 +-
block.c | 34 +++++++++++++++--
block/qcow.c | 16 +++++++-
block/qcow2.c | 7 +++-
block/sheepdog.c | 18 ++++++++-
block/stream.c | 2 +-
block/vmdk.c | 14 +++++++
blockdev.c | 3 +-
qemu-img.c | 11 +++++-
tests/qemu-iotests/017 | 2 +-
tests/qemu-iotests/017.out | 2 +-
tests/qemu-iotests/018 | 2 +-
tests/qemu-iotests/018.out | 2 +-
tests/qemu-iotests/019 | 5 ++-
tests/qemu-iotests/019.out | 2 +-
tests/qemu-iotests/020 | 4 +-
tests/qemu-iotests/020.out | 4 +-
tests/qemu-iotests/024 | 8 ++--
tests/qemu-iotests/024.out | 5 ++-
tests/qemu-iotests/028 | 4 +-
tests/qemu-iotests/028.out | 2 +-
tests/qemu-iotests/030 | 26 +++++++++----
tests/qemu-iotests/034 | 2 +-
tests/qemu-iotests/034.out | 2 +-
tests/qemu-iotests/037 | 2 +-
tests/qemu-iotests/037.out | 2 +-
tests/qemu-iotests/038 | 2 +-
tests/qemu-iotests/038.out | 2 +-
tests/qemu-iotests/039 | 3 +-
tests/qemu-iotests/039.out | 2 +-
tests/qemu-iotests/040 | 47 ++++++++++++++++-------
tests/qemu-iotests/041 | 37 ++++++++++++------
tests/qemu-iotests/042 | 4 +-
tests/qemu-iotests/043 | 18 ++++-----
tests/qemu-iotests/043.out | 16 +++++---
tests/qemu-iotests/046 | 2 +-
tests/qemu-iotests/046.out | 2 +-
tests/qemu-iotests/050 | 4 +-
tests/qemu-iotests/050.out | 2 +-
tests/qemu-iotests/051 | 2 +-
tests/qemu-iotests/051.out | 2 +-
tests/qemu-iotests/051.pc.out | 2 +-
tests/qemu-iotests/056 | 3 +-
tests/qemu-iotests/060 | 2 +-
tests/qemu-iotests/060.out | 2 +-
tests/qemu-iotests/061 | 10 ++---
tests/qemu-iotests/061.out | 11 +++---
tests/qemu-iotests/069 | 2 +-
tests/qemu-iotests/069.out | 2 +-
tests/qemu-iotests/073 | 2 +-
tests/qemu-iotests/073.out | 2 +-
tests/qemu-iotests/082 | 10 +++--
tests/qemu-iotests/082.out | 14 ++++---
tests/qemu-iotests/085 | 4 +-
tests/qemu-iotests/085.out | 6 +--
tests/qemu-iotests/089 | 2 +-
tests/qemu-iotests/089.out | 2 +-
tests/qemu-iotests/095 | 4 +-
tests/qemu-iotests/095.out | 4 +-
tests/qemu-iotests/097 | 4 +-
tests/qemu-iotests/097.out | 16 ++++----
tests/qemu-iotests/098 | 2 +-
tests/qemu-iotests/098.out | 8 ++--
tests/qemu-iotests/110 | 4 +-
tests/qemu-iotests/110.out | 4 +-
tests/qemu-iotests/114 | 12 ++++++
tests/qemu-iotests/114.out | 9 +++++
tests/qemu-iotests/122 | 27 +++++++------
tests/qemu-iotests/122.out | 8 ++--
tests/qemu-iotests/126 | 4 +-
tests/qemu-iotests/126.out | 4 +-
tests/qemu-iotests/127 | 4 +-
tests/qemu-iotests/127.out | 4 +-
tests/qemu-iotests/129 | 3 +-
tests/qemu-iotests/133 | 2 +-
tests/qemu-iotests/133.out | 2 +-
tests/qemu-iotests/139 | 2 +-
tests/qemu-iotests/141 | 4 +-
tests/qemu-iotests/141.out | 4 +-
tests/qemu-iotests/142 | 2 +-
tests/qemu-iotests/142.out | 2 +-
tests/qemu-iotests/153 | 14 +++----
tests/qemu-iotests/153.out | 35 +++++++++--------
tests/qemu-iotests/154 | 42 ++++++++++----------
tests/qemu-iotests/154.out | 42 ++++++++++----------
tests/qemu-iotests/155 | 12 ++++--
tests/qemu-iotests/156 | 9 +++--
tests/qemu-iotests/156.out | 6 +--
tests/qemu-iotests/158 | 2 +-
tests/qemu-iotests/158.out | 2 +-
tests/qemu-iotests/161 | 8 ++--
tests/qemu-iotests/161.out | 8 ++--
tests/qemu-iotests/176 | 4 +-
tests/qemu-iotests/176.out | 32 ++++++++--------
tests/qemu-iotests/177 | 2 +-
tests/qemu-iotests/177.out | 2 +-
tests/qemu-iotests/179 | 2 +-
tests/qemu-iotests/179.out | 2 +-
tests/qemu-iotests/189 | 2 +-
tests/qemu-iotests/189.out | 2 +-
tests/qemu-iotests/191 | 12 +++---
tests/qemu-iotests/191.out | 12 +++---
tests/qemu-iotests/195 | 6 +--
tests/qemu-iotests/195.out | 6 +--
tests/qemu-iotests/198 | 2 +-
tests/qemu-iotests/198.out | 3 +-
tests/qemu-iotests/204 | 2 +-
tests/qemu-iotests/204.out | 2 +-
tests/qemu-iotests/216 | 2 +-
tests/qemu-iotests/224 | 4 +-
tests/qemu-iotests/225 | 2 +-
tests/qemu-iotests/225.out | 2 +-
tests/qemu-iotests/228 | 5 ++-
tests/qemu-iotests/245 | 3 +-
tests/qemu-iotests/249 | 4 +-
tests/qemu-iotests/249.out | 4 +-
tests/qemu-iotests/252 | 2 +-
tests/qemu-iotests/257 | 3 +-
tests/qemu-iotests/267 | 4 +-
tests/qemu-iotests/267.out | 6 +--
tests/qemu-iotests/270 | 2 +-
tests/qemu-iotests/270.out | 2 +-
tests/qemu-iotests/273 | 4 +-
tests/qemu-iotests/273.out | 4 +-
tests/qemu-iotests/279 | 4 +-
tests/qemu-iotests/279.out | 4 +-
tests/qemu-iotests/290 | 72 +++++++++++++++++++++++++++++++++++
tests/qemu-iotests/290.out | 45 ++++++++++++++++++++++
tests/qemu-iotests/group | 1 +
131 files changed, 683 insertions(+), 350 deletions(-)
create mode 100755 tests/qemu-iotests/290
create mode 100644 tests/qemu-iotests/290.out
--
2.26.0.rc2
4 years, 6 months
[PATCH v4] numa: forbid '-numa node, mem' for 5.1 and newer machine types
by Igor Mammedov
Deprecation period is run out and it's a time to flip the switch
introduced by cd5ff8333a. Disable legacy option for new machine
types (since 5.1) and amend documentation.
'-numa node,memdev' shall be used instead of disabled option
with new machine types.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v1:
- rebased on top of current master
- move compat mode from 4.2 to 5.0
v2:
- move deprection text to recently removed section
v3:
- increase title line length for (deprecated.rst)
'``-numa node,mem=``\ *size* (removed in 5.1)'
v4:
- use error_append_hint() for suggesting valid CLI
CC: peter.maydell(a)linaro.org
CC: ehabkost(a)redhat.com
CC: marcel.apfelbaum(a)gmail.com
CC: mst(a)redhat.com
CC: pbonzini(a)redhat.com
CC: rth(a)twiddle.net
CC: david(a)gibson.dropbear.id.au
CC: libvir-list(a)redhat.com
CC: qemu-arm(a)nongnu.org
CC: qemu-ppc(a)nongnu.org
CC: eblake(a)redhat.com
CC: groug(a)kaod.org
---
docs/system/deprecated.rst | 37 ++++++++++++++++++++-----------------
hw/arm/virt.c | 2 +-
hw/core/numa.c | 7 +++++++
hw/i386/pc.c | 1 -
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
hw/ppc/spapr.c | 2 +-
qemu-options.hx | 9 +++++----
8 files changed, 36 insertions(+), 24 deletions(-)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 544ece0a45..e74a5717c8 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -101,23 +101,6 @@ error in the future.
The ``-realtime mlock=on|off`` argument has been replaced by the
``-overcommit mem-lock=on|off`` argument.
-``-numa node,mem=``\ *size* (since 4.1)
-'''''''''''''''''''''''''''''''''''''''
-
-The parameter ``mem`` of ``-numa node`` is used to assign a part of
-guest RAM to a NUMA node. But when using it, it's impossible to manage specified
-RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
-so guest end-ups with the fake NUMA configuration with suboptiomal performance.
-However since 2014 there is an alternative way to assign RAM to a NUMA node
-using parameter ``memdev``, which does the same as ``mem`` and adds
-means to actualy manage node RAM on the host side. Use parameter ``memdev``
-with *memory-backend-ram* backend as an replacement for parameter ``mem``
-to achieve the same fake NUMA effect or a properly configured
-*memory-backend-file* backend to actually benefit from NUMA configuration.
-In future new machine versions will not accept the option but it will still
-work with old machine types. User can check QAPI schema to see if the legacy
-option is supported by looking at MachineInfo::numa-mem-supported property.
-
``-numa`` node (without memory specified) (since 4.1)
'''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -516,3 +499,23 @@ long starting at 1MiB, the old command::
can be rewritten as::
qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2
+
+Command line options
+--------------------
+
+``-numa node,mem=``\ *size* (removed in 5.1)
+''''''''''''''''''''''''''''''''''''''''''''
+
+The parameter ``mem`` of ``-numa node`` is used to assign a part of
+guest RAM to a NUMA node. But when using it, it's impossible to manage specified
+RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
+so guest end-ups with the fake NUMA configuration with suboptiomal performance.
+However since 2014 there is an alternative way to assign RAM to a NUMA node
+using parameter ``memdev``, which does the same as ``mem`` and adds
+means to actualy manage node RAM on the host side. Use parameter ``memdev``
+with *memory-backend-ram* backend as an replacement for parameter ``mem``
+to achieve the same fake NUMA effect or a properly configured
+*memory-backend-file* backend to actually benefit from NUMA configuration.
+In future new machine versions will not accept the option but it will still
+work with old machine types. User can check QAPI schema to see if the legacy
+option is supported by looking at MachineInfo::numa-mem-supported property.
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 37462a6f78..063d4703f7 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2262,7 +2262,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
hc->pre_plug = virt_machine_device_pre_plug_cb;
hc->plug = virt_machine_device_plug_cb;
hc->unplug_request = virt_machine_device_unplug_request_cb;
- mc->numa_mem_supported = true;
mc->nvdimm_supported = true;
mc->auto_enable_numa_with_memhp = true;
mc->default_ram_id = "mach-virt.ram";
@@ -2375,6 +2374,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 1)
static void virt_machine_5_0_options(MachineClass *mc)
{
virt_machine_5_1_options(mc);
+ mc->numa_mem_supported = true;
}
DEFINE_VIRT_MACHINE(5, 0)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 316bc50d75..7814e646e4 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -117,6 +117,13 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
}
if (node->has_mem) {
+ if (!mc->numa_mem_supported) {
+ error_setg(errp, "Parameter -numa node,mem is not supported by this"
+ " machine type");
+ error_append_hint(errp, "Use -numa node,memdev instead");
+ return;
+ }
+
numa_info[nodenr].node_mem = node->mem;
if (!qtest_enabled()) {
warn_report("Parameter -numa node,mem is deprecated,"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2128f3d6fe..a86136069c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1960,7 +1960,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
hc->unplug = pc_machine_device_unplug_cb;
mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
mc->nvdimm_supported = true;
- mc->numa_mem_supported = true;
mc->default_ram_id = "pc.ram";
object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index f66e1d73ce..8955436efa 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -438,6 +438,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
pc_i440fx_5_1_machine_options(m);
m->alias = NULL;
m->is_default = false;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 4ba8ac8774..af6b32adb7 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -366,6 +366,7 @@ static void pc_q35_5_0_machine_options(MachineClass *m)
{
pc_q35_5_1_machine_options(m);
m->alias = NULL;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 3b1a5ed865..210d61d1b3 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4511,7 +4511,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
* in which LMBs are represented and hot-added
*/
mc->numa_mem_align_shift = 28;
- mc->numa_mem_supported = true;
mc->auto_enable_numa = true;
smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
@@ -4599,6 +4598,7 @@ static void spapr_machine_5_0_class_options(MachineClass *mc)
{
spapr_machine_5_1_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len);
+ mc->numa_mem_supported = true;
}
DEFINE_SPAPR_MACHINE(5_0, "5.0", false);
diff --git a/qemu-options.hx b/qemu-options.hx
index 93bde2bbc8..196f468786 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -239,10 +239,11 @@ SRST
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
- '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
- assigns RAM from a given memory backend device to a node. If
- '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
- split equally between them.
+ Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported
+ for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from
+ a given memory backend device to a node. If '\ ``mem``\ ' and
+ '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them.
+
'\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
--
2.26.2
4 years, 6 months
[libvirt PATCH] ci: Drop mips container for Debian sid
by Andrea Bolognani
The build job for this container has been failing every single
time, and as it turns out the explanation for that is very simple:
Debian is just not going to support the mips architecture going
forward.
Reported-by: Pino Toscano <ptoscano(a)redhat.com>
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.gitlab-ci.yml | 5 -
.../libvirt-debian-sid-cross-mips.Dockerfile | 121 ------------------
ci/containers/refresh | 3 +-
3 files changed, 2 insertions(+), 127 deletions(-)
delete mode 100644 ci/containers/libvirt-debian-sid-cross-mips.Dockerfile
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bfb66a652d..49f6d57a0a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -291,11 +291,6 @@ i686-debian-sid-container:
variables:
NAME: debian-sid-cross-i686
-mips-debian-sid-container:
- <<: *container_optional_job_definition
- variables:
- NAME: debian-sid-cross-mips
-
mips64el-debian-sid-container:
<<: *container_optional_job_definition
variables:
diff --git a/ci/containers/libvirt-debian-sid-cross-mips.Dockerfile b/ci/containers/libvirt-debian-sid-cross-mips.Dockerfile
deleted file mode 100644
index 4327b77e3b..0000000000
--- a/ci/containers/libvirt-debian-sid-cross-mips.Dockerfile
+++ /dev/null
@@ -1,121 +0,0 @@
-FROM debian:sid
-
-RUN export DEBIAN_FRONTEND=noninteractive && \
- apt-get update && \
- apt-get dist-upgrade -y && \
- apt-get install --no-install-recommends -y \
- augeas-lenses \
- augeas-tools \
- autoconf \
- automake \
- autopoint \
- bash \
- bash-completion \
- ca-certificates \
- ccache \
- chrony \
- dnsmasq-base \
- dwarves \
- ebtables \
- flake8 \
- gcc \
- gdb \
- gettext \
- git \
- iproute2 \
- kmod \
- libc-dev-bin \
- libtool \
- libtool-bin \
- libxml2-utils \
- locales \
- lsof \
- lvm2 \
- make \
- meson \
- net-tools \
- nfs-common \
- ninja-build \
- numad \
- open-iscsi \
- parted \
- patch \
- perl \
- pkgconf \
- policykit-1 \
- python3 \
- python3-docutils \
- python3-setuptools \
- python3-wheel \
- qemu-utils \
- radvd \
- screen \
- scrub \
- strace \
- sudo \
- vim \
- xsltproc \
- zfs-fuse && \
- apt-get autoremove -y && \
- apt-get autoclean -y && \
- sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
- dpkg-reconfigure locales && \
- mkdir -p /usr/libexec/ccache-wrappers && \
- ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips-linux-gnu-cc && \
- ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips-linux-gnu-$(basename /usr/bin/gcc)
-
-RUN export DEBIAN_FRONTEND=noninteractive && \
- dpkg --add-architecture mips && \
- apt-get update && \
- apt-get dist-upgrade -y && \
- apt-get install --no-install-recommends -y dpkg-dev && \
- apt-get install --no-install-recommends -y \
- gcc-mips-linux-gnu \
- libacl1-dev:mips \
- libapparmor-dev:mips \
- libattr1-dev:mips \
- libaudit-dev:mips \
- libavahi-client-dev:mips \
- libblkid-dev:mips \
- libc6-dev:mips \
- libcap-ng-dev:mips \
- libcurl4-gnutls-dev:mips \
- libdbus-1-dev:mips \
- libdevmapper-dev:mips \
- libfuse-dev:mips \
- libglib2.0-dev:mips \
- libglusterfs-dev:mips \
- libgnutls28-dev:mips \
- libiscsi-dev:mips \
- libncurses-dev:mips \
- libnl-3-dev:mips \
- libnl-route-3-dev:mips \
- libnuma-dev:mips \
- libparted-dev:mips \
- libpcap0.8-dev:mips \
- libpciaccess-dev:mips \
- librbd-dev:mips \
- libreadline-dev:mips \
- libsanlock-dev:mips \
- libsasl2-dev:mips \
- libselinux1-dev:mips \
- libssh-gcrypt-dev:mips \
- libssh2-1-dev:mips \
- libtirpc-dev:mips \
- libudev-dev:mips \
- libxml2-dev:mips \
- libyajl-dev:mips \
- xfslibs-dev:mips && \
- apt-get autoremove -y && \
- apt-get autoclean -y
-
-ENV LANG "en_US.UTF-8"
-
-ENV MAKE "/usr/bin/make"
-ENV NINJA "/usr/bin/ninja"
-ENV PYTHON "/usr/bin/python3"
-
-ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
-
-ENV ABI "mips-linux-gnu"
-ENV CONFIGURE_OPTS "--host=mips-linux-gnu"
diff --git a/ci/containers/refresh b/ci/containers/refresh
index f457f3bc23..3a3594caa4 100755
--- a/ci/containers/refresh
+++ b/ci/containers/refresh
@@ -28,7 +28,8 @@ do
libvirt-debian-*)
for cross in aarch64 armv6l armv7l i686 mips mips64el mipsel ppc64le s390x
do
- if test "$host" = "libvirt-debian-9" && test "$cross" = "i686"
+ if test "$host-cross-$cross" = "libvirt-debian-9-cross-i686" ||
+ test "$host-cross-$cross" = "libvirt-debian-sid-cross-mips"
then
continue
fi
--
2.25.4
4 years, 6 months
[PATCH v3] numa: forbid '-numa node, mem' for 5.1 and newer machine types
by Igor Mammedov
Deprecation period is run out and it's a time to flip the switch
introduced by cd5ff8333a. Disable legacy option for new machine
types (since 5.1) and amend documentation.
'-numa node,memdev' shall be used instead of disabled option
with new machine types.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v1:
- rebased on top of current master
- move compat mode from 4.2 to 5.0
v2:
- move deprection text to recently removed section
v3:
- increase title line length for (deprecated.rst)
'``-numa node,mem=``\ *size* (removed in 5.1)'
CC: peter.maydell(a)linaro.org
CC: ehabkost(a)redhat.com
CC: marcel.apfelbaum(a)gmail.com
CC: mst(a)redhat.com
CC: pbonzini(a)redhat.com
CC: rth(a)twiddle.net
CC: david(a)gibson.dropbear.id.au
CC: libvir-list(a)redhat.com
CC: qemu-arm(a)nongnu.org
CC: qemu-ppc(a)nongnu.org
---
docs/system/deprecated.rst | 37 ++++++++++++++++++++-----------------
hw/arm/virt.c | 2 +-
hw/core/numa.c | 6 ++++++
hw/i386/pc.c | 1 -
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
hw/ppc/spapr.c | 2 +-
qemu-options.hx | 9 +++++----
8 files changed, 35 insertions(+), 24 deletions(-)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index f0061f94aa..502e41ff35 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -101,23 +101,6 @@ error in the future.
The ``-realtime mlock=on|off`` argument has been replaced by the
``-overcommit mem-lock=on|off`` argument.
-``-numa node,mem=``\ *size* (since 4.1)
-'''''''''''''''''''''''''''''''''''''''
-
-The parameter ``mem`` of ``-numa node`` is used to assign a part of
-guest RAM to a NUMA node. But when using it, it's impossible to manage specified
-RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
-so guest end-ups with the fake NUMA configuration with suboptiomal performance.
-However since 2014 there is an alternative way to assign RAM to a NUMA node
-using parameter ``memdev``, which does the same as ``mem`` and adds
-means to actualy manage node RAM on the host side. Use parameter ``memdev``
-with *memory-backend-ram* backend as an replacement for parameter ``mem``
-to achieve the same fake NUMA effect or a properly configured
-*memory-backend-file* backend to actually benefit from NUMA configuration.
-In future new machine versions will not accept the option but it will still
-work with old machine types. User can check QAPI schema to see if the legacy
-option is supported by looking at MachineInfo::numa-mem-supported property.
-
``-numa`` node (without memory specified) (since 4.1)
'''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -512,3 +495,23 @@ long starting at 1MiB, the old command::
can be rewritten as::
qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2
+
+Command line options
+--------------------
+
+``-numa node,mem=``\ *size* (removed in 5.1)
+''''''''''''''''''''''''''''''''''''''''''''
+
+The parameter ``mem`` of ``-numa node`` is used to assign a part of
+guest RAM to a NUMA node. But when using it, it's impossible to manage specified
+RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
+so guest end-ups with the fake NUMA configuration with suboptiomal performance.
+However since 2014 there is an alternative way to assign RAM to a NUMA node
+using parameter ``memdev``, which does the same as ``mem`` and adds
+means to actualy manage node RAM on the host side. Use parameter ``memdev``
+with *memory-backend-ram* backend as an replacement for parameter ``mem``
+to achieve the same fake NUMA effect or a properly configured
+*memory-backend-file* backend to actually benefit from NUMA configuration.
+In future new machine versions will not accept the option but it will still
+work with old machine types. User can check QAPI schema to see if the legacy
+option is supported by looking at MachineInfo::numa-mem-supported property.
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 37462a6f78..063d4703f7 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2262,7 +2262,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
hc->pre_plug = virt_machine_device_pre_plug_cb;
hc->plug = virt_machine_device_plug_cb;
hc->unplug_request = virt_machine_device_unplug_request_cb;
- mc->numa_mem_supported = true;
mc->nvdimm_supported = true;
mc->auto_enable_numa_with_memhp = true;
mc->default_ram_id = "mach-virt.ram";
@@ -2375,6 +2374,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 1)
static void virt_machine_5_0_options(MachineClass *mc)
{
virt_machine_5_1_options(mc);
+ mc->numa_mem_supported = true;
}
DEFINE_VIRT_MACHINE(5, 0)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 316bc50d75..05be412e59 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
}
if (node->has_mem) {
+ if (!mc->numa_mem_supported) {
+ error_setg(errp, "Parameter -numa node,mem is not supported by this"
+ " machine type. Use -numa node,memdev instead");
+ return;
+ }
+
numa_info[nodenr].node_mem = node->mem;
if (!qtest_enabled()) {
warn_report("Parameter -numa node,mem is deprecated,"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2128f3d6fe..a86136069c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1960,7 +1960,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
hc->unplug = pc_machine_device_unplug_cb;
mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
mc->nvdimm_supported = true;
- mc->numa_mem_supported = true;
mc->default_ram_id = "pc.ram";
object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index f66e1d73ce..8955436efa 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -438,6 +438,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
pc_i440fx_5_1_machine_options(m);
m->alias = NULL;
m->is_default = false;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 4ba8ac8774..af6b32adb7 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -366,6 +366,7 @@ static void pc_q35_5_0_machine_options(MachineClass *m)
{
pc_q35_5_1_machine_options(m);
m->alias = NULL;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 3b1a5ed865..210d61d1b3 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4511,7 +4511,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
* in which LMBs are represented and hot-added
*/
mc->numa_mem_align_shift = 28;
- mc->numa_mem_supported = true;
mc->auto_enable_numa = true;
smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
@@ -4599,6 +4598,7 @@ static void spapr_machine_5_0_class_options(MachineClass *mc)
{
spapr_machine_5_1_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len);
+ mc->numa_mem_supported = true;
}
DEFINE_SPAPR_MACHINE(5_0, "5.0", false);
diff --git a/qemu-options.hx b/qemu-options.hx
index 93bde2bbc8..196f468786 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -239,10 +239,11 @@ SRST
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
- '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
- assigns RAM from a given memory backend device to a node. If
- '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
- split equally between them.
+ Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported
+ for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from
+ a given memory backend device to a node. If '\ ``mem``\ ' and
+ '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them.
+
'\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
--
2.26.2
4 years, 6 months
[PATCH v2] numa: forbid '-numa node, mem' for 5.1 and newer machine types
by Igor Mammedov
Deprecation period is run out and it's a time to flip the switch
introduced by cd5ff8333a. Disable legacy option for new machine
types (since 5.1) and amend documentation.
'-numa node,memdev' shall be used instead of disabled option
with new machine types.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v1:
- rebased on top of current master
- move compat mode from 4.2 to 5.0
v2:
- move deprection text to recently removed section
- pick up reviewed-bys
CC: peter.maydell(a)linaro.org
CC: ehabkost(a)redhat.com
CC: marcel.apfelbaum(a)gmail.com
CC: mst(a)redhat.com
CC: pbonzini(a)redhat.com
CC: rth(a)twiddle.net
CC: david(a)gibson.dropbear.id.au
CC: libvir-list(a)redhat.com
CC: qemu-arm(a)nongnu.org
CC: qemu-ppc(a)nongnu.org
CC: eblake(a)redhat.com
---
docs/system/deprecated.rst | 37 ++++++++++++++++++++-----------------
hw/arm/virt.c | 2 +-
hw/core/numa.c | 6 ++++++
hw/i386/pc.c | 1 -
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
hw/ppc/spapr.c | 2 +-
qemu-options.hx | 9 +++++----
8 files changed, 35 insertions(+), 24 deletions(-)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index f0061f94aa..6f717e4a1d 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -101,23 +101,6 @@ error in the future.
The ``-realtime mlock=on|off`` argument has been replaced by the
``-overcommit mem-lock=on|off`` argument.
-``-numa node,mem=``\ *size* (since 4.1)
-'''''''''''''''''''''''''''''''''''''''
-
-The parameter ``mem`` of ``-numa node`` is used to assign a part of
-guest RAM to a NUMA node. But when using it, it's impossible to manage specified
-RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
-so guest end-ups with the fake NUMA configuration with suboptiomal performance.
-However since 2014 there is an alternative way to assign RAM to a NUMA node
-using parameter ``memdev``, which does the same as ``mem`` and adds
-means to actualy manage node RAM on the host side. Use parameter ``memdev``
-with *memory-backend-ram* backend as an replacement for parameter ``mem``
-to achieve the same fake NUMA effect or a properly configured
-*memory-backend-file* backend to actually benefit from NUMA configuration.
-In future new machine versions will not accept the option but it will still
-work with old machine types. User can check QAPI schema to see if the legacy
-option is supported by looking at MachineInfo::numa-mem-supported property.
-
``-numa`` node (without memory specified) (since 4.1)
'''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -512,3 +495,23 @@ long starting at 1MiB, the old command::
can be rewritten as::
qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2
+
+Command line options
+--------------------
+
+``-numa node,mem=``\ *size* (removed in 5.1)
+'''''''''''''''''''''''''''''''''''''''
+
+The parameter ``mem`` of ``-numa node`` is used to assign a part of
+guest RAM to a NUMA node. But when using it, it's impossible to manage specified
+RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
+so guest end-ups with the fake NUMA configuration with suboptiomal performance.
+However since 2014 there is an alternative way to assign RAM to a NUMA node
+using parameter ``memdev``, which does the same as ``mem`` and adds
+means to actualy manage node RAM on the host side. Use parameter ``memdev``
+with *memory-backend-ram* backend as an replacement for parameter ``mem``
+to achieve the same fake NUMA effect or a properly configured
+*memory-backend-file* backend to actually benefit from NUMA configuration.
+In future new machine versions will not accept the option but it will still
+work with old machine types. User can check QAPI schema to see if the legacy
+option is supported by looking at MachineInfo::numa-mem-supported property.
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 37462a6f78..063d4703f7 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2262,7 +2262,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
hc->pre_plug = virt_machine_device_pre_plug_cb;
hc->plug = virt_machine_device_plug_cb;
hc->unplug_request = virt_machine_device_unplug_request_cb;
- mc->numa_mem_supported = true;
mc->nvdimm_supported = true;
mc->auto_enable_numa_with_memhp = true;
mc->default_ram_id = "mach-virt.ram";
@@ -2375,6 +2374,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 1)
static void virt_machine_5_0_options(MachineClass *mc)
{
virt_machine_5_1_options(mc);
+ mc->numa_mem_supported = true;
}
DEFINE_VIRT_MACHINE(5, 0)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 316bc50d75..05be412e59 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
}
if (node->has_mem) {
+ if (!mc->numa_mem_supported) {
+ error_setg(errp, "Parameter -numa node,mem is not supported by this"
+ " machine type. Use -numa node,memdev instead");
+ return;
+ }
+
numa_info[nodenr].node_mem = node->mem;
if (!qtest_enabled()) {
warn_report("Parameter -numa node,mem is deprecated,"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2128f3d6fe..a86136069c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1960,7 +1960,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
hc->unplug = pc_machine_device_unplug_cb;
mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
mc->nvdimm_supported = true;
- mc->numa_mem_supported = true;
mc->default_ram_id = "pc.ram";
object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index f66e1d73ce..8955436efa 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -438,6 +438,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
pc_i440fx_5_1_machine_options(m);
m->alias = NULL;
m->is_default = false;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 4ba8ac8774..af6b32adb7 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -366,6 +366,7 @@ static void pc_q35_5_0_machine_options(MachineClass *m)
{
pc_q35_5_1_machine_options(m);
m->alias = NULL;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len);
compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len);
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 3b1a5ed865..210d61d1b3 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4511,7 +4511,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
* in which LMBs are represented and hot-added
*/
mc->numa_mem_align_shift = 28;
- mc->numa_mem_supported = true;
mc->auto_enable_numa = true;
smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
@@ -4599,6 +4598,7 @@ static void spapr_machine_5_0_class_options(MachineClass *mc)
{
spapr_machine_5_1_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len);
+ mc->numa_mem_supported = true;
}
DEFINE_SPAPR_MACHINE(5_0, "5.0", false);
diff --git a/qemu-options.hx b/qemu-options.hx
index 93bde2bbc8..196f468786 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -239,10 +239,11 @@ SRST
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
- '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
- assigns RAM from a given memory backend device to a node. If
- '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
- split equally between them.
+ Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported
+ for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from
+ a given memory backend device to a node. If '\ ``mem``\ ' and
+ '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them.
+
'\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
--
2.18.4
4 years, 6 months