]> git.proxmox.com Git - mirror_qemu.git/commit
util/reserved-region: Add new ReservedRegion helpers
authorEric Auger <eric.auger@redhat.com>
Thu, 19 Oct 2023 13:45:12 +0000 (15:45 +0200)
committerCédric Le Goater <clg@redhat.com>
Fri, 3 Nov 2023 08:20:31 +0000 (09:20 +0100)
commitc3104847363f4ac5d4e76e8ed637280f7be1ee68
treee3555ba3e3f18344219ce312181a6030e88b93bd
parent43f04cbeff863ae68b6ead432af5e771b92b934c
util/reserved-region: Add new ReservedRegion helpers

Introduce resv_region_list_insert() helper which inserts
a new ReservedRegion into a sorted list of reserved region.
In case of overlap, the new region has higher priority and
hides the existing overlapped segments. If the overlap is
partial, new regions are created for parts which are not
overlapped. The new region has higher priority independently
on the type of the regions.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Tested-by: Yanghang Liu <yanghliu@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
include/qemu/reserved-region.h [new file with mode: 0644]
util/meson.build
util/reserved-region.c [new file with mode: 0644]