diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index ac32fa1477..e423383e22 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2221,6 +2221,7 @@ static int virDomainMemoryDefValidate(const virDomainMemoryDef *mem, const virDomainDef *def) { + const long pagesize = virGetSystemPageSize(); unsigned long long thpSize; /* Guest NUMA nodes are continuous and indexed from zero. */ @@ -2295,6 +2296,14 @@ virDomainMemoryDefValidate(const virDomainMemoryDef *mem, _("virtio-pmem does not support NUMA nodes")); return -1; } + + if (pagesize > 0 && + mem->target.virtio_pmem.address % pagesize != 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("memory address must be aligned to %1$ld bytes"), + pagesize); + return -1; + } break; case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM: