get rid of libkvm-common.h
cover get rid of libkvm-common.h
There is no place in the world for this sad header.
This is part of the patch series I sent the other day (about KVMState), but it is an independent cleanup.
Since that was not merged, I'm sending this part separetedly.
PATCH 1/2 get rid of libkvm-common.h
This file has no purpose in life in new scheme of things. Move its contents to libkvm-all.h. There are some name clashes in qemu-kvm.c. Those function names are then changed.
--- kvm.h | 1 + libkvm-all.h | 82 ++++++++++++++++++++++++++++++++++++++++- libkvm-common.h | 100 -------------------------------------------------- qemu-kvm-x86.c | 2 + qemu-kvm.c | 12 +++--- target-i386/libkvm.h | 2 +- target-ia64/libkvm.h | 2 +- target-ppc/libkvm.h | 2 +- 8 files changed, 92 insertions(+), 111 deletions(-) delete mode 100644 libkvm-common.h
kvm.h +1 -0
@@ -16,6 +16,7 @@#include "config.h" #include "sys-queue.h" +#include "libkvm-all.h" #ifdef KVM_UPSTREAM
libkvm-all.h +80 -2
92 lines not on this page · raw message
libkvm-common.h deleted +0 -100
100 lines not on this page · raw message
qemu-kvm-x86.c +2 -0
@@ -20,6 +20,8 @@#include <sys/utsname.h> #include <linux/kvm_para.h> +#include "kvm.h" +#define MSR_IA32_TSC 0x10static struct kvm_msr_list *kvm_msr_list;
qemu-kvm.c +6 -6
@@ -149,12 +149,12 @@ void kvm_apic_init(CPUState *env)#include <signal.h> -static int try_push_interrupts (void *opaque) +static int kvm_try_push_interrupts (void *opaque) {return kvm_arch_try_push_interrupts (opaque); } -static void post_kvm_run (void *opaque,void *data) +static void kvm_post_run (void *opaque,void *data) {CPUState *env = (CPUState *)data;
@@ -162,7 +162,7 @@ static void post_kvm_run(void *opaque, void *data)kvm_arch_post_kvm_run (opaque, env); } -static int pre_kvm_run (void *opaque,void *data) +static int kvm_pre_run (void *opaque,void *data) {CPUState *env = (CPUState *)data;
@@ -761,12 +761,12 @@ static struct kvm_callbacks qemu_kvm_ops = { .halt = kvm_halt, .shutdown = kvm_shutdown, .io_window = kvm_io_window, - .try_push_interrupts = try_push_interrupts, + .try_push_interrupts = kvm_try_push_interrupts, #ifdef KVM_CAP_USER_NMI .push_nmi = kvm_arch_push_nmi, #endif - .post_kvm_run = post_kvm_run, - .pre_kvm_run = pre_kvm_run, + .post_kvm_run = kvm_post_run, + .pre_kvm_run = kvm_pre_run, #ifdef TARGET_I386 .tpr_access = handle_tpr_access, #endif
target-i386/libkvm.h +1 -1
@@ -18,7 +18,7 @@#ifndef KVM_X86_H #define KVM_X86_H -#include "libkvm-common.h" +#include "libkvm-all.h" #define PAGE_SIZE 4096ul#define PAGE_MASK (~(PAGE_SIZE - 1))
target-ia64/libkvm.h +1 -1
@@ -18,7 +18,7 @@#ifndef KVM_IA64_H #define KVM_IA64_H -#include "libkvm-common.h" +#include "libkvm-all.h" extern int kvm_page_size;
target-ppc/libkvm.h +1 -1
@@ -19,7 +19,7 @@#ifndef KVM_POWERPC_H #define KVM_POWERPC_H -#include "libkvm-common.h" +#include "libkvm-all.h" extern int kvm_page_size;
Signature · 1 line
1.5.6.6
PATCH 2/2 pull qemu headers into libkvm
Those headers define qemu specific things like ram_addr_t. This will allow us to start using them in libkvm.
--- libkvm-all.c | 2 +- libkvm-all.h | 1 + target-i386/libkvm.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletions(-)
libkvm-all.c +1 -1
@@ -26,6 +26,7 @@#error libkvm: userspace and kernel version mismatch#endif +#include "sysemu.h" #include <unistd.h> #include <fcntl.h> #include <stdio.h>
@@ -47,7 +48,6 @@ #define DPRINTF(fmt, args...) do {} while (0)#endif -#define MIN (x,y) ((x) < (y) ? (x) : (y))#define ALIGN (x, y) (((x)+(y)-1) & ~((y)-1))int kvm_abi =EXPECTED_KVM_API_VERSION ;
libkvm-all.h +1 -0
@@ -82,6 +82,7 @@ struct kvm_vcpu_contexttypedef struct kvm_context *kvm_context_t ;typedef struct kvm_vcpu_context *kvm_vcpu_context_t ; +#include "kvm.h" int kvm_alloc_kernel_memory (kvm_context_t kvm,unsigned long memory,void **vm_mem); int kvm_alloc_userspace_memory(kvm_context_t kvm, unsigned long memory,
target-i386/libkvm.c +2 -0
@@ -1,3 +1,5 @@ +#include "sysemu.h" +#include "libkvm-all.h" #include "libkvm.h" #include <errno.h>
Signature · 1 line
1.5.6.6
Avi Kivity
AppliedQuoted 6 lines · Glauber Costa
There is no place in the world for this sad header.
This is part of the patch series I sent the other day (about KVMState), but it is an independent cleanup.Since that was not merged, I'm sending this part separetedly.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function