Glauber Costa wrote:
Signed-off-by: Glauber Costa <[EMAIL PROTECTED]>
---
 libkvm/libkvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index e768e44..fa65c30 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -130,8 +130,8 @@ int get_intersecting_slot(unsigned long phys_addr)
        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)
+               if (slots[i].len && slots[i].phys_addr <= phys_addr &&
+                   (slots[i].phys_addr + slots[i].len) >= phys_addr)
                        return i;
        return -1;
consider

 slots[i].phys_addr = 0
 slots[i].len = 1
 phys_addr = 1

with the new calculation, i (well, not me personally) will be considered an intersecting slot.

Not that I (me this time) can understand how you can calculate interval intersection without the entire interval.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
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

Reply via email to