This patch clarifies some "old version" error message, and deletes
some unused functions in userspace code.
Signed-off-by: Nguyen Anh Quynh <[EMAIL PROTECTED]>
diffstat patch1.patch
kvmctl.c | 36 +++---------------------------------
1 file changed, 3 insertions(+), 33 deletions(-)
diff --git a/user/kvmctl.c b/user/kvmctl.c
index d4f0eb3..487d88f 100644
--- a/user/kvmctl.c
+++ b/user/kvmctl.c
@@ -66,37 +66,6 @@ struct translation_cache {
void *physical;
};
-static void translation_cache_init(struct translation_cache *tr)
-{
- tr->physical = 0;
-}
-
-static int translate(kvm_context_t kvm, int vcpu, struct translation_cache *tr,
- unsigned long linear, void **physical)
-{
- unsigned long page = linear & ~(PAGE_SIZE-1);
- unsigned long offset = linear & (PAGE_SIZE-1);
-
- if (!(tr->physical && tr->linear == page)) {
- struct kvm_translation kvm_tr;
- int r;
-
- kvm_tr.linear_address = page;
-
- r = ioctl(kvm->vcpu_fd[vcpu], KVM_TRANSLATE, &kvm_tr);
- if (r == -1)
- return -errno;
-
- if (!kvm_tr.valid)
- return -EFAULT;
-
- tr->linear = page;
- tr->physical = kvm->physical_memory + kvm_tr.physical_address;
- }
- *physical = tr->physical + offset;
- return 0;
-}
-
/*
* memory regions parameters
*/
@@ -193,11 +162,12 @@ kvm_context_t kvm_init(struct kvm_callbacks *callbacks,
}
r = ioctl(fd, KVM_GET_API_VERSION, 0);
if (r == -1) {
- fprintf(stderr, "kvm kernel version too old\n");
+ fprintf(stderr, "kvm kernel version too old: KVM_GET_API_VERSION ioctl not supported\n");
goto out_close;
}
if (r < EXPECTED_KVM_API_VERSION && r != 10) {
- fprintf(stderr, "kvm kernel version too old\n");
+ fprintf(stderr, "kvm kernel version too old: We expect API version %d or newer, but got version %d\n",
+ EXPECTED_KVM_API_VERSION, r);
goto out_close;
}
if (r > EXPECTED_KVM_API_VERSION) {
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel