On Tue, Mar 28, 2023 at 01:58:01PM +0200, Michal Privoznik wrote:
Both virtio-mem and virtio-pmem devices have '.memaddr'
attribute
which controls the address where they are mapped in the guest
memory. Ideally, users do not need to specify this as QEMU does
the right thing and computes addresses automatically on startup.
But soon, we will need to record this address as it is part of
guest ABI. And also, there might be some users that want to
control this value. Now, we are in a bit of a pickle, because
both these device types already have a PCI address, therefore we
can't just use <address/> blindly. But what we can do, is
introduce <address/> under the <target/> element. This is also
more conceptual, as knobs under <target/> control guest visible
config of memory device (and .memaddr surely falls into that
category).
NB, SgxEPCDeviceInfo struct in QMP definition also has .memaddr
attribute, but because of the way we build cmd line there's no
(easy) way to set the attribute. So ignore that for now.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/formatdomain.rst | 7 ++++++
src/conf/domain_conf.c | 24 ++++++++++++++++++-
src/conf/domain_conf.h | 2 ++
src/conf/domain_validate.c | 6 +++++
src/conf/schemas/domaincommon.rng | 7 ++++++
.../memory-hotplug-virtio-mem.xml | 1 +
.../memory-hotplug-virtio-pmem.xml | 1 +
7 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9f49c6e62d..bed6acac3a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -20996,6 +21008,13 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDef *src,
return false;
}
+ if (src->address != dst->address) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target memory device address '0x%llx' doesn't
match source memory device address '0x%llx'"),
This needs to use the new permutable format string. Other than that
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
and safe for freeze since this was posted long time ago and we want the
back-compat to be stronger sooner rather than later.