Glauber Costa wrote:
Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- libkvm/libkvm.c | 34 +++++++++++++++++++++------------- libkvm/libkvm.h | 2 +- qemu/qemu-kvm.c | 2 +- 3 files changed, 23 insertions(+), 15 deletions(-)diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 33f00b7..c885dee 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -140,6 +140,27 @@ int get_intersecting_slot(unsigned long phys_addr) return -1; }+/* Returns -1 if this slot is not totally contained on any other,+ * and the number of the slot otherwise */ +int get_container_slot(uint64_t phys_addr, unsigned long size) +{ + int i; + + for (i = 0; i < KVM_MAX_NUM_MEM_REGIONS ; ++i) + if (slots[i].len && slots[i].phys_addr <= phys_addr && + (slots[i].phys_addr + slots[i].len) >= phys_addr + size) + return i; + return -1; +} +
What about partially containing (or: overlapping) slots? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
