mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
range: Introduce range_inverse_array()
This helper reverses a list of regions within a [low, high] span, turning original regions into holes and original holes into actual regions, covering the whole UINT64_MAX span. Signed-off-by: Eric Auger <eric.auger@redhat.com> Tested-by: Yanghang Liu <yanghliu@redhat.com> Reviewed-by: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
908cae0de4
commit
b439595a08
2 changed files with 63 additions and 0 deletions
|
@ -225,4 +225,12 @@ int range_compare(Range *a, Range *b);
|
|||
|
||||
GList *range_list_insert(GList *list, Range *data);
|
||||
|
||||
/*
|
||||
* Inverse an array of sorted ranges over the [low, high] span, ie.
|
||||
* original ranges becomes holes in the newly allocated inv_ranges
|
||||
*/
|
||||
void range_inverse_array(GList *in_ranges,
|
||||
GList **out_ranges,
|
||||
uint64_t low, uint64_t high);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue