mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
kvm: Consolidate must-have capability checks
Instead of splattering the code with #ifdefs and runtime checks for capabilities we cannot work without anyway, provide central test infrastructure for verifying their availability both at build and runtime. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
cad1e2827b
commit
94a8d39afd
6 changed files with 80 additions and 85 deletions
10
kvm.h
10
kvm.h
|
@ -32,6 +32,14 @@ extern int kvm_allowed;
|
|||
|
||||
struct kvm_run;
|
||||
|
||||
typedef struct KVMCapabilityInfo {
|
||||
const char *name;
|
||||
int value;
|
||||
} KVMCapabilityInfo;
|
||||
|
||||
#define KVM_CAP_INFO(CAP) { "KVM_CAP_" stringify(CAP), KVM_CAP_##CAP }
|
||||
#define KVM_CAP_LAST_INFO { NULL, 0 }
|
||||
|
||||
/* external API */
|
||||
|
||||
int kvm_init(void);
|
||||
|
@ -86,6 +94,8 @@ int kvm_vcpu_ioctl(CPUState *env, int type, ...);
|
|||
|
||||
/* Arch specific hooks */
|
||||
|
||||
extern const KVMCapabilityInfo kvm_arch_required_capabilities[];
|
||||
|
||||
int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
|
||||
|
||||
int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue