diff options
author | Avi Kivity <avi@qumranet.com> | 2007-02-20 11:27:58 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-03-04 04:12:42 -0500 |
commit | 2c6f5df9793e6f928fc763af3fb535a5e28a1f8a (patch) | |
tree | 84ce59e464a97194413e16c7ecc43ee1e7b394da /drivers/kvm/kvm_main.c | |
parent | f17abe9a44425ff9c9858bc1806cc09d6b5dad1c (diff) |
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: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index aa07d9c9d20d..981f5d3cfd94 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -601,7 +601,7 @@ EXPORT_SYMBOL_GPL(fx_init); | |||
601 | /* | 601 | /* |
602 | * Creates some virtual cpus. Good luck creating more than one. | 602 | * Creates some virtual cpus. Good luck creating more than one. |
603 | */ | 603 | */ |
604 | static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) | 604 | static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int n) |
605 | { | 605 | { |
606 | int r; | 606 | int r; |
607 | struct kvm_vcpu *vcpu; | 607 | struct kvm_vcpu *vcpu; |
@@ -655,8 +655,8 @@ out: | |||
655 | * | 655 | * |
656 | * Discontiguous memory is allowed, mostly for framebuffers. | 656 | * Discontiguous memory is allowed, mostly for framebuffers. |
657 | */ | 657 | */ |
658 | static int kvm_dev_ioctl_set_memory_region(struct kvm *kvm, | 658 | static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, |
659 | struct kvm_memory_region *mem) | 659 | struct kvm_memory_region *mem) |
660 | { | 660 | { |
661 | int r; | 661 | int r; |
662 | gfn_t base_gfn; | 662 | gfn_t base_gfn; |
@@ -804,8 +804,8 @@ static void do_remove_write_access(struct kvm_vcpu *vcpu, int slot) | |||
804 | /* | 804 | /* |
805 | * Get (and clear) the dirty memory log for a memory slot. | 805 | * Get (and clear) the dirty memory log for a memory slot. |
806 | */ | 806 | */ |
807 | static int kvm_dev_ioctl_get_dirty_log(struct kvm *kvm, | 807 | static int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, |
808 | struct kvm_dirty_log *log) | 808 | struct kvm_dirty_log *log) |
809 | { | 809 | { |
810 | struct kvm_memory_slot *memslot; | 810 | struct kvm_memory_slot *memslot; |
811 | int r, i; | 811 | int r, i; |
@@ -1535,7 +1535,7 @@ void save_msrs(struct vmx_msr_entry *e, int n) | |||
1535 | } | 1535 | } |
1536 | EXPORT_SYMBOL_GPL(save_msrs); | 1536 | EXPORT_SYMBOL_GPL(save_msrs); |
1537 | 1537 | ||
1538 | static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) | 1538 | static int kvm_vm_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) |
1539 | { | 1539 | { |
1540 | struct kvm_vcpu *vcpu; | 1540 | struct kvm_vcpu *vcpu; |
1541 | int r; | 1541 | int r; |
@@ -1568,7 +1568,7 @@ static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) | |||
1568 | return r; | 1568 | return r; |
1569 | } | 1569 | } |
1570 | 1570 | ||
1571 | static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) | 1571 | static int kvm_vm_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) |
1572 | { | 1572 | { |
1573 | struct kvm_vcpu *vcpu; | 1573 | struct kvm_vcpu *vcpu; |
1574 | 1574 | ||
@@ -1614,7 +1614,7 @@ static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) | |||
1614 | return 0; | 1614 | return 0; |
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | static int kvm_dev_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs) | 1617 | static int kvm_vm_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs) |
1618 | { | 1618 | { |
1619 | struct kvm_vcpu *vcpu; | 1619 | struct kvm_vcpu *vcpu; |
1620 | 1620 | ||
@@ -1660,7 +1660,7 @@ static void get_segment(struct kvm_vcpu *vcpu, | |||
1660 | return kvm_arch_ops->get_segment(vcpu, var, seg); | 1660 | return kvm_arch_ops->get_segment(vcpu, var, seg); |
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | static int kvm_dev_ioctl_get_sregs(struct kvm *kvm, struct kvm_sregs *sregs) | 1663 | static int kvm_vm_ioctl_get_sregs(struct kvm *kvm, struct kvm_sregs *sregs) |
1664 | { | 1664 | { |
1665 | struct kvm_vcpu *vcpu; | 1665 | struct kvm_vcpu *vcpu; |
1666 | struct descriptor_table dt; | 1666 | struct descriptor_table dt; |
@@ -1711,7 +1711,7 @@ static void set_segment(struct kvm_vcpu *vcpu, | |||
1711 | return kvm_arch_ops->set_segment(vcpu, var, seg); | 1711 | return kvm_arch_ops->set_segment(vcpu, var, seg); |
1712 | } | 1712 | } |
1713 | 1713 | ||
1714 | static int kvm_dev_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs) | 1714 | static int kvm_vm_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs) |
1715 | { | 1715 | { |
1716 | struct kvm_vcpu *vcpu; | 1716 | struct kvm_vcpu *vcpu; |
1717 | int mmu_reset_needed = 0; | 1717 | int mmu_reset_needed = 0; |
@@ -1904,7 +1904,7 @@ out: | |||
1904 | /* | 1904 | /* |
1905 | * Translate a guest virtual address to a guest physical address. | 1905 | * Translate a guest virtual address to a guest physical address. |
1906 | */ | 1906 | */ |
1907 | static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) | 1907 | static int kvm_vm_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) |
1908 | { | 1908 | { |
1909 | unsigned long vaddr = tr->linear_address; | 1909 | unsigned long vaddr = tr->linear_address; |
1910 | struct kvm_vcpu *vcpu; | 1910 | struct kvm_vcpu *vcpu; |
@@ -1925,7 +1925,7 @@ static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) | |||
1925 | return 0; | 1925 | return 0; |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) | 1928 | static int kvm_vm_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) |
1929 | { | 1929 | { |
1930 | struct kvm_vcpu *vcpu; | 1930 | struct kvm_vcpu *vcpu; |
1931 | 1931 | ||
@@ -1945,7 +1945,7 @@ static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) | |||
1945 | return 0; | 1945 | return 0; |
1946 | } | 1946 | } |
1947 | 1947 | ||
1948 | static int kvm_dev_ioctl_debug_guest(struct kvm *kvm, | 1948 | static int kvm_vm_ioctl_debug_guest(struct kvm *kvm, |
1949 | struct kvm_debug_guest *dbg) | 1949 | struct kvm_debug_guest *dbg) |
1950 | { | 1950 | { |
1951 | struct kvm_vcpu *vcpu; | 1951 | struct kvm_vcpu *vcpu; |
@@ -1973,7 +1973,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
1973 | 1973 | ||
1974 | switch (ioctl) { | 1974 | switch (ioctl) { |
1975 | case KVM_CREATE_VCPU: | 1975 | case KVM_CREATE_VCPU: |
1976 | r = kvm_dev_ioctl_create_vcpu(kvm, arg); | 1976 | r = kvm_vm_ioctl_create_vcpu(kvm, arg); |
1977 | if (r) | 1977 | if (r) |
1978 | goto out; | 1978 | goto out; |
1979 | break; | 1979 | break; |
@@ -1983,7 +1983,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
1983 | r = -EFAULT; | 1983 | r = -EFAULT; |
1984 | if (copy_from_user(&kvm_run, argp, sizeof kvm_run)) | 1984 | if (copy_from_user(&kvm_run, argp, sizeof kvm_run)) |
1985 | goto out; | 1985 | goto out; |
1986 | r = kvm_dev_ioctl_run(kvm, &kvm_run); | 1986 | r = kvm_vm_ioctl_run(kvm, &kvm_run); |
1987 | if (r < 0 && r != -EINTR) | 1987 | if (r < 0 && r != -EINTR) |
1988 | goto out; | 1988 | goto out; |
1989 | if (copy_to_user(argp, &kvm_run, sizeof kvm_run)) { | 1989 | if (copy_to_user(argp, &kvm_run, sizeof kvm_run)) { |
@@ -1998,7 +1998,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
1998 | r = -EFAULT; | 1998 | r = -EFAULT; |
1999 | if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) | 1999 | if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) |
2000 | goto out; | 2000 | goto out; |
2001 | r = kvm_dev_ioctl_get_regs(kvm, &kvm_regs); | 2001 | r = kvm_vm_ioctl_get_regs(kvm, &kvm_regs); |
2002 | if (r) | 2002 | if (r) |
2003 | goto out; | 2003 | goto out; |
2004 | r = -EFAULT; | 2004 | r = -EFAULT; |
@@ -2013,7 +2013,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2013 | r = -EFAULT; | 2013 | r = -EFAULT; |
2014 | if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) | 2014 | if (copy_from_user(&kvm_regs, argp, sizeof kvm_regs)) |
2015 | goto out; | 2015 | goto out; |
2016 | r = kvm_dev_ioctl_set_regs(kvm, &kvm_regs); | 2016 | r = kvm_vm_ioctl_set_regs(kvm, &kvm_regs); |
2017 | if (r) | 2017 | if (r) |
2018 | goto out; | 2018 | goto out; |
2019 | r = 0; | 2019 | r = 0; |
@@ -2025,7 +2025,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2025 | r = -EFAULT; | 2025 | r = -EFAULT; |
2026 | if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) | 2026 | if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) |
2027 | goto out; | 2027 | goto out; |
2028 | r = kvm_dev_ioctl_get_sregs(kvm, &kvm_sregs); | 2028 | r = kvm_vm_ioctl_get_sregs(kvm, &kvm_sregs); |
2029 | if (r) | 2029 | if (r) |
2030 | goto out; | 2030 | goto out; |
2031 | r = -EFAULT; | 2031 | r = -EFAULT; |
@@ -2040,7 +2040,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2040 | r = -EFAULT; | 2040 | r = -EFAULT; |
2041 | if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) | 2041 | if (copy_from_user(&kvm_sregs, argp, sizeof kvm_sregs)) |
2042 | goto out; | 2042 | goto out; |
2043 | r = kvm_dev_ioctl_set_sregs(kvm, &kvm_sregs); | 2043 | r = kvm_vm_ioctl_set_sregs(kvm, &kvm_sregs); |
2044 | if (r) | 2044 | if (r) |
2045 | goto out; | 2045 | goto out; |
2046 | r = 0; | 2046 | r = 0; |
@@ -2052,7 +2052,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2052 | r = -EFAULT; | 2052 | r = -EFAULT; |
2053 | if (copy_from_user(&tr, argp, sizeof tr)) | 2053 | if (copy_from_user(&tr, argp, sizeof tr)) |
2054 | goto out; | 2054 | goto out; |
2055 | r = kvm_dev_ioctl_translate(kvm, &tr); | 2055 | r = kvm_vm_ioctl_translate(kvm, &tr); |
2056 | if (r) | 2056 | if (r) |
2057 | goto out; | 2057 | goto out; |
2058 | r = -EFAULT; | 2058 | r = -EFAULT; |
@@ -2067,7 +2067,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2067 | r = -EFAULT; | 2067 | r = -EFAULT; |
2068 | if (copy_from_user(&irq, argp, sizeof irq)) | 2068 | if (copy_from_user(&irq, argp, sizeof irq)) |
2069 | goto out; | 2069 | goto out; |
2070 | r = kvm_dev_ioctl_interrupt(kvm, &irq); | 2070 | r = kvm_vm_ioctl_interrupt(kvm, &irq); |
2071 | if (r) | 2071 | if (r) |
2072 | goto out; | 2072 | goto out; |
2073 | r = 0; | 2073 | r = 0; |
@@ -2079,7 +2079,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2079 | r = -EFAULT; | 2079 | r = -EFAULT; |
2080 | if (copy_from_user(&dbg, argp, sizeof dbg)) | 2080 | if (copy_from_user(&dbg, argp, sizeof dbg)) |
2081 | goto out; | 2081 | goto out; |
2082 | r = kvm_dev_ioctl_debug_guest(kvm, &dbg); | 2082 | r = kvm_vm_ioctl_debug_guest(kvm, &dbg); |
2083 | if (r) | 2083 | if (r) |
2084 | goto out; | 2084 | goto out; |
2085 | r = 0; | 2085 | r = 0; |
@@ -2091,7 +2091,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2091 | r = -EFAULT; | 2091 | r = -EFAULT; |
2092 | if (copy_from_user(&kvm_mem, argp, sizeof kvm_mem)) | 2092 | if (copy_from_user(&kvm_mem, argp, sizeof kvm_mem)) |
2093 | goto out; | 2093 | goto out; |
2094 | r = kvm_dev_ioctl_set_memory_region(kvm, &kvm_mem); | 2094 | r = kvm_vm_ioctl_set_memory_region(kvm, &kvm_mem); |
2095 | if (r) | 2095 | if (r) |
2096 | goto out; | 2096 | goto out; |
2097 | break; | 2097 | break; |
@@ -2102,7 +2102,7 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2102 | r = -EFAULT; | 2102 | r = -EFAULT; |
2103 | if (copy_from_user(&log, argp, sizeof log)) | 2103 | if (copy_from_user(&log, argp, sizeof log)) |
2104 | goto out; | 2104 | goto out; |
2105 | r = kvm_dev_ioctl_get_dirty_log(kvm, &log); | 2105 | r = kvm_vm_ioctl_get_dirty_log(kvm, &log); |
2106 | if (r) | 2106 | if (r) |
2107 | goto out; | 2107 | goto out; |
2108 | break; | 2108 | break; |