gasp_find_free()

Find a free region of a particular space type

Synopsis:

#include <qvm/gasp.h>
uint64_t gasp_find_free(unsigned qst,
                        uint64_t size,
                        uint64_t align)

Arguments:

qst
The type of the space being searched. This value should be either QST_MEMORY or QST_PCI_IO.
size
The number of bytes being requested.
align
The alignment being requested.

Description:

This function finds a free region of the specified space type in the guest address space.

CAUTION:
This function is not thread-safe. You must call gasp_lock() before calling this function, to ensure that no other vdev can claim the region you need, then call gasp_unlock() when work is complete.

Returns:

The starting location for the free space, or QSL_NO_LOCATION if nothing is available.

Page updated: