]> xenbits.xensource.com Git - libvirt.git/commit
domain_validate: Check for domain address conflicts fully
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 19 Jan 2024 07:22:13 +0000 (08:22 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Jan 2024 16:32:10 +0000 (17:32 +0100)
commit91f9a9fb4fc0d34ed8d7a869de3d9f87687c3618
tree18779fb0eb2fffb1f72d981cd5d91df1fef48fe3
parent642af05e3e58b90cb9d15936678f16bd7e454d26
domain_validate: Check for domain address conflicts fully

Current implementation of virDomainMemoryDefCheckConflict() does
only a one way comparison, i.e. if there's a memory device within
def->mems[] which address falls in [mem->address, mem->address +
mem->size] range (mem is basically an iterator within
def->mems[]). And for static XML this works just fine. Problem is
with hot/cold plugging of a memory device. Then mem points to
freshly parsed memory device and these half checks are
insufficient. Not only we must check whether an existing memory
device doesn't clash with freshly parsed memory device, but also
whether freshly parsed memory device does not fall into range of
already existing memory device.

Resolves: https://issues.redhat.com/browse/RHEL-4452
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/conf/domain_validate.c