Commit 2c6f5df9 authored by Avi Kivity's avatar Avi Kivity

KVM: Rename some kvm_dev_ioctl_*() functions to kvm_vm_ioctl_*()

This reflects the changed scope, from device-wide to single vm (previously
every device open created a virtual machine).
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent f17abe9a
...@@ -601,7 +601,7 @@ EXPORT_SYMBOL_GPL(fx_init); ...@@ -601,7 +601,7 @@ EXPORT_SYMBOL_GPL(fx_init);
/* /*
* Creates some virtual cpus. Good luck creating more than one. * Creates some virtual cpus. Good luck creating more than one.
*/ */
static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int n)
{ {
int r; int r;
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -655,8 +655,8 @@ static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) ...@@ -655,8 +655,8 @@ static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n)
* *
* Discontiguous memory is allowed, mostly for framebuffers. * Discontiguous memory is allowed, mostly for framebuffers.
*/ */
static int kvm_dev_ioctl_set_memory_region(struct kvm *kvm, static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
struct kvm_memory_region *mem) struct kvm_memory_region *mem)
{ {
int r; int r;
gfn_t base_gfn; gfn_t base_gfn;
...@@ -804,8 +804,8 @@ static void do_remove_write_access(struct kvm_vcpu *vcpu, int slot) ...@@ -804,8 +804,8 @@ static void do_remove_write_access(struct kvm_vcpu *vcpu, int slot)
/* /*
* Get (and clear) the dirty memory log for a memory slot. * Get (and clear) the dirty memory log for a memory slot.
*/ */
static int kvm_dev_ioctl_get_dirty_log(struct kvm *kvm, static int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
struct kvm_dirty_log *log) struct kvm_dirty_log *log)
{ {
struct kvm_memory_slot *memslot; struct kvm_memory_slot *memslot;
int r, i; int r, i;
...@@ -1535,7 +1535,7 @@ void save_msrs(struct vmx_msr_entry *e, int n) ...@@ -1535,7 +1535,7 @@ void save_msrs(struct vmx_msr_entry *e, int n)
} }
EXPORT_SYMBOL_GPL(save_msrs); EXPORT_SYMBOL_GPL(save_msrs);
static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) static int kvm_vm_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
int r; int r;
...@@ -1568,7 +1568,7 @@ static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) ...@@ -1568,7 +1568,7 @@ static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run)
return r; return r;
} }
static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) static int kvm_vm_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -1614,7 +1614,7 @@ static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) ...@@ -1614,7 +1614,7 @@ static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs)
return 0; return 0;
} }
static int kvm_dev_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs) static int kvm_vm_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -1660,7 +1660,7 @@ static void get_segment(struct kvm_vcpu *vcpu, ...@@ -1660,7 +1660,7 @@ static void get_segment(struct kvm_vcpu *vcpu,
return kvm_arch_ops->get_segment(vcpu, var, seg); return kvm_arch_ops->get_segment(vcpu, var, seg);
} }
static int kvm_dev_ioctl_get_sregs(struct kvm *kvm, struct kvm_sregs *sregs) static int kvm_vm_ioctl_get_sregs(struct kvm *kvm, struct kvm_sregs *sregs)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
struct descriptor_table dt; struct descriptor_table dt;
...@@ -1711,7 +1711,7 @@ static void set_segment(struct kvm_vcpu *vcpu, ...@@ -1711,7 +1711,7 @@ static void set_segment(struct kvm_vcpu *vcpu,
return kvm_arch_ops->set_segment(vcpu, var, seg); return kvm_arch_ops->set_segment(vcpu, var, seg);
} }
static int kvm_dev_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs) static int kvm_vm_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
int mmu_reset_needed = 0; int mmu_reset_needed = 0;
...@@ -1904,7 +1904,7 @@ static int msr_io(struct kvm *kvm, struct kvm_msrs __user *user_msrs, ...@@ -1904,7 +1904,7 @@ static int msr_io(struct kvm *kvm, struct kvm_msrs __user *user_msrs,
/* /*
* Translate a guest virtual address to a guest physical address. * Translate a guest virtual address to a guest physical address.
*/ */
static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) static int kvm_vm_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr)
{ {
unsigned long vaddr = tr->linear_address; unsigned long vaddr = tr->linear_address;
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -1925,7 +1925,7 @@ static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) ...@@ -1925,7 +1925,7 @@ static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr)
return 0; return 0;
} }
static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) static int kvm_vm_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -1945,7 +1945,7 @@ static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) ...@@ -1945,7 +1945,7 @@ static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq)
return 0; return 0;
} }
static int kvm_dev_ioctl_debug_guest(struct kvm *kvm, static int kvm_vm_ioctl_debug_guest(struct kvm *kvm,
struct kvm_debug_guest *dbg) struct kvm_debug_guest *dbg)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
...@@ -1973,7 +1973,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -1973,7 +1973,7 @@ static long kvm_vm_ioctl(struct file *filp,
switch (ioctl) { switch (ioctl) {
case KVM_CREATE_VCPU: case KVM_CREATE_VCPU:
r = kvm_dev_ioctl_create_vcpu(kvm, arg); r = kvm_vm_ioctl_create_vcpu(kvm, arg);
if (r) if (r)
goto out; goto out;
break; break;
...@@ -1983,7 +1983,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -1983,7 +1983,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_run, argp, sizeof kvm_run)) if (copy_from_user(&kvm_run, argp, sizeof kvm_run))
goto out; goto out;
r = kvm_dev_ioctl_run(kvm, &kvm_run); r = kvm_vm_ioctl_run(kvm, &kvm_run);
if (r < 0 && r != -EINTR) if (r < 0 && r != -EINTR)
goto out; goto out;
if (copy_to_user(argp, &kvm_run, sizeof kvm_run)) { if (copy_to_user(argp, &kvm_run, sizeof kvm_run)) {
...@@ -1998,7 +1998,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -1998,7 +1998,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs))
goto out; goto out;
r = kvm_dev_ioctl_get_regs(kvm, &kvm_regs); r = kvm_vm_ioctl_get_regs(kvm, &kvm_regs);
if (r) if (r)
goto out; goto out;
r = -EFAULT; r = -EFAULT;
...@@ -2013,7 +2013,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2013,7 +2013,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs))
goto out; goto out;
r = kvm_dev_ioctl_set_regs(kvm, &kvm_regs); r = kvm_vm_ioctl_set_regs(kvm, &kvm_regs);
if (r) if (r)
goto out; goto out;
r = 0; r = 0;
...@@ -2025,7 +2025,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2025,7 +2025,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs))
goto out; goto out;
r = kvm_dev_ioctl_get_sregs(kvm, &kvm_sregs); r = kvm_vm_ioctl_get_sregs(kvm, &kvm_sregs);
if (r) if (r)
goto out; goto out;
r = -EFAULT; r = -EFAULT;
...@@ -2040,7 +2040,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2040,7 +2040,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs))
goto out; goto out;
r = kvm_dev_ioctl_set_sregs(kvm, &kvm_sregs); r = kvm_vm_ioctl_set_sregs(kvm, &kvm_sregs);
if (r) if (r)
goto out; goto out;
r = 0; r = 0;
...@@ -2052,7 +2052,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2052,7 +2052,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&tr, argp, sizeof tr)) if (copy_from_user(&tr, argp, sizeof tr))
goto out; goto out;
r = kvm_dev_ioctl_translate(kvm, &tr); r = kvm_vm_ioctl_translate(kvm, &tr);
if (r) if (r)
goto out; goto out;
r = -EFAULT; r = -EFAULT;
...@@ -2067,7 +2067,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2067,7 +2067,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&irq, argp, sizeof irq)) if (copy_from_user(&irq, argp, sizeof irq))
goto out; goto out;
r = kvm_dev_ioctl_interrupt(kvm, &irq); r = kvm_vm_ioctl_interrupt(kvm, &irq);
if (r) if (r)
goto out; goto out;
r = 0; r = 0;
...@@ -2079,7 +2079,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2079,7 +2079,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&dbg, argp, sizeof dbg)) if (copy_from_user(&dbg, argp, sizeof dbg))
goto out; goto out;
r = kvm_dev_ioctl_debug_guest(kvm, &dbg); r = kvm_vm_ioctl_debug_guest(kvm, &dbg);
if (r) if (r)
goto out; goto out;
r = 0; r = 0;
...@@ -2091,7 +2091,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2091,7 +2091,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&kvm_mem, argp, sizeof kvm_mem)) if (copy_from_user(&kvm_mem, argp, sizeof kvm_mem))
goto out; goto out;
r = kvm_dev_ioctl_set_memory_region(kvm, &kvm_mem); r = kvm_vm_ioctl_set_memory_region(kvm, &kvm_mem);
if (r) if (r)
goto out; goto out;
break; break;
...@@ -2102,7 +2102,7 @@ static long kvm_vm_ioctl(struct file *filp, ...@@ -2102,7 +2102,7 @@ static long kvm_vm_ioctl(struct file *filp,
r = -EFAULT; r = -EFAULT;
if (copy_from_user(&log, argp, sizeof log)) if (copy_from_user(&log, argp, sizeof log))
goto out; goto out;
r = kvm_dev_ioctl_get_dirty_log(kvm, &log); r = kvm_vm_ioctl_get_dirty_log(kvm, &log);
if (r) if (r)
goto out; goto out;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment