summaryrefslogtreecommitdiff
path: root/libkvm
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2008-09-23 14:44:36 -0300
committerAvi Kivity <avi@redhat.com>2008-09-24 14:49:33 +0300
commit6c81146b4bf918ed1a0e7ab8adbd677ec8d185ff (patch)
tree6907108da8f982a04e5cb06d3c972e75896e1ec2 /libkvm
parente2d49aade432652c79f2141bf9d45a84e8bda290 (diff)
kvm: libkvm: add debuging facilities to memory registration at libkvm
Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'libkvm')
-rw-r--r--libkvm/libkvm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index 11a95292..f7a7fdd8 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -52,6 +52,15 @@
#include "kvm-s390.h"
#endif
+//#define DEBUG_MEMREG
+#ifdef DEBUG_MEMREG
+#define DPRINTF(fmt, args...) \
+ do { fprintf(stderr, "%s:%d " fmt , __func__, __LINE__, ##args); } while (0)
+#else
+#define DPRINTF(fmt, args...) do {} while (0)
+#endif
+
+
int kvm_abi = EXPECTED_KVM_API_VERSION;
int kvm_page_size;
@@ -445,6 +454,9 @@ int kvm_register_phys_mem(kvm_context_t kvm,
int r;
memory.slot = get_free_slot(kvm);
+ DPRINTF("memory: gpa: %llx, size: %llx, uaddr: %llx, slot: %x, flags: %lx\n",
+ memory.guest_phys_addr, memory.memory_size,
+ memory.userspace_addr, memory.slot, memory.flags);
r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &memory);
if (r == -1) {
fprintf(stderr, "create_userspace_phys_mem: %s\n", strerror(errno));
@@ -983,6 +995,7 @@ int kvm_unregister_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t siz
perror("kvm_unregister_coalesced_mmio_zone");
return -errno;
}
+ DPRINTF("Unregistered coalesced mmio region for %llx (%lx)\n", addr, size);
return 0;
}
#endif