[PATCH] kvm-userspace: move x86 specific calls introduced by device assignement to x86 files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The device asignment patches added the x86 specific ioperm in qemu-kvm.
This patch moves
  qemu-kvm.c:kvm_do_ioperm()
to
  qemu-kvm-x86.c:kvm_arch_do_ioperm()
The patch also changes the qemu-kvm header and the includes according to that.

Signed-off-by: Christian Ehrhardt <ehrhardt@xxxxxxxxxxxxxxxxxx>
---

[diffstat]
 qemu-kvm-x86.c |    7 +++++++
 qemu-kvm.c     |   11 +++--------
 qemu-kvm.h     |    3 +++
 3 files changed, 13 insertions(+), 8 deletions(-)

[diff]

diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -11,6 +11,7 @@
 
 #include <string.h>
 #include "hw/hw.h"
+#include <sys/io.h>
 
 #include "qemu-kvm.h"
 #include <libkvm.h>
@@ -717,3 +718,9 @@
 	}
     }
 }
+
+void kvm_arch_do_ioperm(void *_data)
+{
+    struct ioperm_data *data = _data;
+    ioperm(data->start_port, data->num, data->turn_on);
+}
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -27,7 +27,6 @@
 #include <sys/utsname.h>
 #include <sys/syscall.h>
 #include <sys/mman.h>
-#include <sys/io.h>
 
 #define bool _Bool
 #define false 0
@@ -1049,14 +1048,10 @@
     return kvm_unregister_coalesced_mmio(kvm_context, addr, size);
 }
 
-static void kvm_do_ioperm(void *_data)
-{
-    struct ioperm_data *data = _data;
-    ioperm(data->start_port, data->num, data->turn_on);
-}
-
+#ifdef USE_KVM_DEVICE_ASSIGNMENT
 void kvm_ioperm(CPUState *env, void *data)
 {
     if (kvm_enabled() && qemu_system_ready)
-	on_vcpu(env, kvm_do_ioperm, data);
+	on_vcpu(env, kvm_arch_do_ioperm, data);
 }
+#endif
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -93,7 +93,10 @@
 
 void qemu_kvm_system_reset_request(void);
 
+#ifdef USE_KVM_DEVICE_ASSIGNMENT
 void kvm_ioperm(CPUState *env, void *data);
+void kvm_arch_do_ioperm(void *_data);
+#endif
 
 #ifdef TARGET_PPC
 int handle_powerpc_dcr_read(int vcpu, uint32_t dcrn, uint32_t *data);
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux