提交 784aa3d7 编写于 作者: A Alexander Graf

KVM: Rename and add argument to check_extension

In preparation to make the check_extension function available to VM scope
we add a struct kvm * argument to the function header and rename the function
accordingly. It will still be called from the /dev/kvm fd, but with a NULL
argument for struct kvm *.
Signed-off-by: NAlexander Graf <agraf@suse.de>
Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 9678cdaa
...@@ -184,7 +184,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) ...@@ -184,7 +184,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
} }
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
switch (ext) { switch (ext) {
......
...@@ -190,7 +190,7 @@ void kvm_arch_check_processor_compat(void *rtn) ...@@ -190,7 +190,7 @@ void kvm_arch_check_processor_compat(void *rtn)
*(int *)rtn = 0; *(int *)rtn = 0;
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
......
...@@ -885,7 +885,7 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) ...@@ -885,7 +885,7 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
return VM_FAULT_SIGBUS; return VM_FAULT_SIGBUS;
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
......
...@@ -391,7 +391,7 @@ void kvm_arch_sync_events(struct kvm *kvm) ...@@ -391,7 +391,7 @@ void kvm_arch_sync_events(struct kvm *kvm)
{ {
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
/* FIXME!! /* FIXME!!
......
...@@ -146,7 +146,7 @@ long kvm_arch_dev_ioctl(struct file *filp, ...@@ -146,7 +146,7 @@ long kvm_arch_dev_ioctl(struct file *filp,
return -EINVAL; return -EINVAL;
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
......
...@@ -2616,7 +2616,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, ...@@ -2616,7 +2616,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
return r; return r;
} }
int kvm_dev_ioctl_check_extension(long ext) int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
{ {
int r; int r;
......
...@@ -602,7 +602,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, ...@@ -602,7 +602,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg); unsigned int ioctl, unsigned long arg);
int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf);
int kvm_dev_ioctl_check_extension(long ext); int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext);
int kvm_get_dirty_log(struct kvm *kvm, int kvm_get_dirty_log(struct kvm *kvm,
struct kvm_dirty_log *log, int *is_dirty); struct kvm_dirty_log *log, int *is_dirty);
......
...@@ -2571,7 +2571,7 @@ static int kvm_dev_ioctl_create_vm(unsigned long type) ...@@ -2571,7 +2571,7 @@ static int kvm_dev_ioctl_create_vm(unsigned long type)
return r; return r;
} }
static long kvm_dev_ioctl_check_extension_generic(long arg) static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
{ {
switch (arg) { switch (arg) {
case KVM_CAP_USER_MEMORY: case KVM_CAP_USER_MEMORY:
...@@ -2595,7 +2595,7 @@ static long kvm_dev_ioctl_check_extension_generic(long arg) ...@@ -2595,7 +2595,7 @@ static long kvm_dev_ioctl_check_extension_generic(long arg)
default: default:
break; break;
} }
return kvm_dev_ioctl_check_extension(arg); return kvm_vm_ioctl_check_extension(kvm, arg);
} }
static long kvm_dev_ioctl(struct file *filp, static long kvm_dev_ioctl(struct file *filp,
...@@ -2614,7 +2614,7 @@ static long kvm_dev_ioctl(struct file *filp, ...@@ -2614,7 +2614,7 @@ static long kvm_dev_ioctl(struct file *filp,
r = kvm_dev_ioctl_create_vm(arg); r = kvm_dev_ioctl_create_vm(arg);
break; break;
case KVM_CHECK_EXTENSION: case KVM_CHECK_EXTENSION:
r = kvm_dev_ioctl_check_extension_generic(arg); r = kvm_vm_ioctl_check_extension_generic(NULL, arg);
break; break;
case KVM_GET_VCPU_MMAP_SIZE: case KVM_GET_VCPU_MMAP_SIZE:
r = -EINVAL; r = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册