Re: [PATCH] provide a kvm_qemu_memory_alias() function

2008-10-01 Thread Avi Kivity

Glauber Costa wrote:

Following the pattern we already do, provide a qemu_kvm wrapper to
the memory aliases x86 functions. Reason is that we don't want to have
references to the context spread over qemu.

The destroy alias function is completely removed from libkvm/libkvm.c,
since no one in the code base uses it directly.

 
-int kvm_destroy_memory_alias(kvm_context_t kvm, uint64_t phys_start)

-{
-   return kvm_create_memory_alias(kvm, phys_start, 0, 0);
-}
-
  


This exists so that readers don't have to wander why you're calling 
kvm_create_memory_alias when you actually want to destroy one.


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


Re: [PATCH] provide a kvm_qemu_memory_alias() function

2008-10-01 Thread Glauber Costa
On Wed, Oct 1, 2008 at 4:38 AM, Avi Kivity [EMAIL PROTECTED] wrote:
 Glauber Costa wrote:

 Following the pattern we already do, provide a qemu_kvm wrapper to
 the memory aliases x86 functions. Reason is that we don't want to have
 references to the context spread over qemu.

 The destroy alias function is completely removed from libkvm/libkvm.c,
 since no one in the code base uses it directly.

  -int kvm_destroy_memory_alias(kvm_context_t kvm, uint64_t phys_start)
 -{
 -   return kvm_create_memory_alias(kvm, phys_start, 0, 0);
 -}
 -


 This exists so that readers don't have to wander why you're calling
 kvm_create_memory_alias when you actually want to destroy one.

So what? I'm replacing it with a kvm_qemu_destroy... that does the
very same thing, in the very same way.
only difference is the presence/absence of context.


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




-- 
Glauber  Costa.
Free as in Freedom
http://glommer.net

The less confident you are, the more serious you have to act.
--
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


[PATCH] provide a kvm_qemu_memory_alias() function

2008-09-30 Thread Glauber Costa
Following the pattern we already do, provide a qemu_kvm wrapper to
the memory aliases x86 functions. Reason is that we don't want to have
references to the context spread over qemu.

The destroy alias function is completely removed from libkvm/libkvm.c,
since no one in the code base uses it directly.

Signed-off-by: Glauber Costa [EMAIL PROTECTED]
---
 libkvm/libkvm-x86.c |5 -
 qemu/qemu-kvm-x86.c |   12 
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index a8cca15..f33038d 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -206,11 +206,6 @@ int kvm_create_memory_alias(kvm_context_t kvm,
return 0;
 }
 
-int kvm_destroy_memory_alias(kvm_context_t kvm, uint64_t phys_start)
-{
-   return kvm_create_memory_alias(kvm, phys_start, 0, 0);
-}
-
 #ifdef KVM_CAP_IRQCHIP
 
 int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index 5daedd1..55c520d 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -27,6 +27,18 @@ static int kvm_has_msr_star;
 
 static int lm_capable_kernel;
 
+int kvm_qemu_create_memory_alias(uint64_t phys_start,
+ uint64_t len,
+ uint64_t target_phys)
+{
+return kvm_create_memory_alias(kvm_context, phys_start, len, target_phys);
+}
+
+int kvm_qemu_destroy_memory_alias(uint64_t phys_start)
+{
+   return kvm_create_memory_alias(kvm_context, phys_start, 0, 0);
+}
+
 int kvm_arch_qemu_create_context(void)
 {
 int i;
-- 
1.5.5.1

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