repository: /home/avi/kvm
branch: (no branch)
commit 999b92a6dbf499e36aa59ce38901179fedc33db2
Author: Izik Eidus <[EMAIL PROTECTED]>
Date:   Wed Nov 7 19:20:51 2007 +0200

    export kvm_is_allocated_mem to other programs that user libkvm
    this function is used for to know if a given memory slot was already 
allocated
    in the past
    
    Signed-off-by: Izik Eidus <[EMAIL PROTECTED]>

diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index ff1338c..3b9ebde 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -466,6 +466,19 @@ int kvm_is_intersecting_mem(kvm_context_t kvm, unsigned 
long phys_start)
        return get_intersecting_slot(phys_start) != -1;
 }
 
+int kvm_is_allocated_mem(kvm_context_t kvm, unsigned long phys_start,
+                        unsigned long len)
+{
+       int slot;
+
+       slot = get_slot(phys_start);
+       if (slot == -1)
+               return 0;
+       if (slots[slot].len == len)
+               return 1;
+       return 0;
+}
+
 int kvm_create_mem_hole(kvm_context_t kvm, unsigned long phys_start,
                        unsigned long len)
 {
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 99ac7d9..987e642 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -412,6 +412,8 @@ void *kvm_create_phys_mem(kvm_context_t, unsigned long 
phys_start,
 void kvm_destroy_phys_mem(kvm_context_t, unsigned long phys_start, 
                          unsigned long len);
 int kvm_is_intersecting_mem(kvm_context_t kvm, unsigned long phys_start);
+int kvm_is_allocated_mem(kvm_context_t kvm, unsigned long phys_start,
+                        unsigned long len);
 int kvm_create_mem_hole(kvm_context_t kvm, unsigned long phys_start,
                        unsigned long len);
 int kvm_register_userspace_phys_mem(kvm_context_t kvm,

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to