diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a233c0c4208a268e60c35a22a2480142e11ff65e..74efe8c8a1855ff48d703d3c230051d3ed220ec1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5007,7 +5007,8 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM:
virBufferAsprintf(buf, " slot='%u'", info->addr.dimm.slot);
- virBufferAsprintf(buf, " base='0x%llx'", info->addr.dimm.base);
+ if (info->addr.dimm.base)
+ virBufferAsprintf(buf, " base='0x%llx'", info->addr.dimm.base);
break;
@@ -5408,14 +5409,15 @@ virDomainDeviceDimmAddressParseXML(xmlNodePtr node,
}
VIR_FREE(tmp);
- if (!(tmp = virXMLPropString(node, "base")) ||
- virStrToLong_ullp(tmp, NULL, 16, &addr->base) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("invalid or missing dimm base address '%s'"),
- NULLSTR(tmp));
- goto cleanup;
+ if ((tmp = virXMLPropString(node, "base"))) {
+ if (virStrToLong_ullp(tmp, NULL, 16, &addr->base) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid dimm base address '%s'"), tmp);
+ goto cleanup;
+ }
+
+ VIR_FREE(tmp);
}
- VIR_FREE(tmp);
ret = 0;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d3f99d34c67f4ad448b134c84455fa46a60960f5..4a5fce3e1035e6bc2ccb470dc198d32898ca2d05 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3497,7 +3497,8 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem)
if (mem->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) {
virBufferAsprintf(&buf, ",slot=%d", mem->info.addr.dimm.slot);
- virBufferAsprintf(&buf, ",addr=%llu", mem->info.addr.dimm.base);
+ if (mem->info.addr.dimm.base)
+ virBufferAsprintf(&buf, ",addr=%llu", mem->info.addr.dimm.base);
}
break;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args
index 1c881c65419128a42323b6bc71b9479082395126..23403df5eb44340ce2ebe915f86f7261639a968f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args
@@ -15,6 +15,8 @@ QEMU_AUDIO_DRV=none \
mem-path=/dev/hugepages2M/libvirt/qemu,size=536870912,host-nodes=1-3,\
policy=bind \
-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
+-object memory-backend-ram,id=memdimm1,size=536870912 \
+-device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=2 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-nographic \
-nodefaults \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.xml
index 49f2f107f18d3186894efed2dc3590302c628697..fc21dc43c261570dbdca94e27a944e28c30218ef 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.xml
@@ -2,8 +2,8 @@
QEMUGuest1
c7a5fdbd-edaf-9455-926a-d65c16db1809
1099511627776
- 743423
- 743423
+ 7434230
+ 7434230
2
hvm
@@ -41,5 +41,12 @@
+
+
+ 524287
+ 0
+
+
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 22a12e67a713db2eb70b2589dde119abacbc3994..1ee84025ea73c092403a0834f72acd49c6cf8149 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2096,7 +2096,7 @@ mymain(void)
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("memory-hotplug-dimm-addr", QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
- QEMU_CAPS_OBJECT_MEMORY_FILE);
+ QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);