On Fri, Jan 19, 2024 at 04:25:11PM +0100, Michal Privoznik wrote:
+++ b/src/conf/domain_validate.c
@@ -2315,7 +2316,10 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
if (thisStart == 0 || otherStart == 0)
continue;
- if (thisStart <= otherStart && thisEnd > otherStart) {
+ otherEnd = otherStart + other->size;
Shouldn't you multiply other->size by 1024? That's what happens
earlier with mem->size.
I'm also curious about the zero check on thisStart and otherStart
right above that. It looks like it would allow two overlapping memory
devices to exists as long as either of them starts at zero, but I've
certainly missed something in related code that makes that scenario
impossible.
--
Andrea Bolognani / Red Hat / Virtualization