diff mbox

[2/4] cleanup mmio coalescing functions

Message ID 1244664293-9502-3-git-send-email-glommer@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Glauber Costa June 10, 2009, 8:04 p.m. UTC
remove wrappers that existed only due to qemu/libkvm separation.
Use qemu types for function definitions.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 qemu-kvm.c |   27 ++++-----------------------
 qemu-kvm.h |    5 -----
 2 files changed, 4 insertions(+), 28 deletions(-)

Comments

Avi Kivity June 11, 2009, 9:19 a.m. UTC | #1
Glauber Costa wrote:
> remove wrappers that existed only due to qemu/libkvm separation.
> Use qemu types for function definitions.
>
>  
> -int kvm_register_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
> +int kvm_coalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size)
>  {
>  #ifdef KVM_CAP_COALESCED_MMIO
> +    kvm_context_t kvm = kvm_context;
>   

While all this code is doomed, please maintain consistent indentation 
while it lives.

>  	struct kvm_coalesced_mmio_zone zone;
>  	int r;
>  
> @@ -1121,9 +1122,10 @@ int kvm_register_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
>  	return -ENOSYS;
>  }
>  
> -int kvm_unregister_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
> +int kvm_uncoalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size)
>  {
>  #ifdef KVM_CAP_COALESCED_MMIO
> +    kvm_context_t kvm = kvm_context;
>   

Here too.
diff mbox

Patch

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 2c2d46f..e01f8b0 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -1099,9 +1099,10 @@  int kvm_init_coalesced_mmio(kvm_context_t kvm)
 	return r;
 }
 
-int kvm_register_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
+int kvm_coalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size)
 {
 #ifdef KVM_CAP_COALESCED_MMIO
+    kvm_context_t kvm = kvm_context;
 	struct kvm_coalesced_mmio_zone zone;
 	int r;
 
@@ -1121,9 +1122,10 @@  int kvm_register_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
 	return -ENOSYS;
 }
 
-int kvm_unregister_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
+int kvm_uncoalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size)
 {
 #ifdef KVM_CAP_COALESCED_MMIO
+    kvm_context_t kvm = kvm_context;
 	struct kvm_coalesced_mmio_zone zone;
 	int r;
 
@@ -2773,27 +2775,6 @@  void kvm_mutex_lock(void)
     cpu_single_env = NULL;
 }
 
-int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr, unsigned int size)
-{
-    return kvm_register_coalesced_mmio(kvm_context, addr, size);
-}
-
-int qemu_kvm_unregister_coalesced_mmio(target_phys_addr_t addr,
-				       unsigned int size)
-{
-    return kvm_unregister_coalesced_mmio(kvm_context, addr, size);
-}
-
-int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
-{
-    return kvm_register_coalesced_mmio(kvm_context, start, size);
-}
-
-int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
-{
-    return kvm_unregister_coalesced_mmio(kvm_context, start, size);
-}
-
 #ifdef USE_KVM_DEVICE_ASSIGNMENT
 void kvm_add_ioperm_data(struct ioperm_data *data)
 {
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 0dfbcd1..4db1763 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -111,11 +111,6 @@  void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write);
 void kvm_tpr_vcpu_start(CPUState *env);
 
 int qemu_kvm_get_dirty_pages(unsigned long phys_addr, void *buf);
-int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr,
-				     unsigned int size);
-int qemu_kvm_unregister_coalesced_mmio(target_phys_addr_t addr,
-				       unsigned int size);
-
 int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
 int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);