diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 6962fe76bf..bc3d00f89c 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2387,6 +2387,21 @@ virDomainMemoryDefValidate(const virDomainMemoryDef *mem, if (other == mem) continue; + /* In case we're updating an existing memory device (e.g. virtio-mem), + * then pointers will be different. But addresses and aliases are the + * same. However, STREQ_NULLABLE() returns true if both strings are + * NULL which is not what we want. */ + if (virDomainDeviceInfoAddressIsEqual(&other->info, + &mem->info)) { + continue; + } + + if (mem->info.alias && + STREQ_NULLABLE(other->info.alias, + mem->info.alias)) { + continue; + } + switch (other->model) { case VIR_DOMAIN_MEMORY_MODEL_NONE: case VIR_DOMAIN_MEMORY_MODEL_DIMM: