aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-07 06:11:17 -0500
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:25 -0400
commitf0fe510864a4520a85dfa35ae14f5f376c56efc7 (patch)
tree3d6422576b072480b78b3b505ec03d98ab21c0c3
parent07c45a366d89f8eaec5d9890e810171b408f9a52 (diff)
KVM: Future-proof argument-less ioctls
Some ioctls ignore their arguments. By requiring them to be zero now, we allow a nonzero value to have some special meaning in the future. Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--drivers/kvm/kvm_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index cba0b87c34e4..ba7f43a4459e 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2169,6 +2169,9 @@ static long kvm_vcpu_ioctl(struct file *filp,
2169 2169
2170 switch (ioctl) { 2170 switch (ioctl) {
2171 case KVM_RUN: 2171 case KVM_RUN:
2172 r = -EINVAL;
2173 if (arg)
2174 goto out;
2172 r = kvm_vcpu_ioctl_run(vcpu, vcpu->run); 2175 r = kvm_vcpu_ioctl_run(vcpu, vcpu->run);
2173 break; 2176 break;
2174 case KVM_GET_REGS: { 2177 case KVM_GET_REGS: {
@@ -2440,9 +2443,15 @@ static long kvm_dev_ioctl(struct file *filp,
2440 2443
2441 switch (ioctl) { 2444 switch (ioctl) {
2442 case KVM_GET_API_VERSION: 2445 case KVM_GET_API_VERSION:
2446 r = -EINVAL;
2447 if (arg)
2448 goto out;
2443 r = KVM_API_VERSION; 2449 r = KVM_API_VERSION;
2444 break; 2450 break;
2445 case KVM_CREATE_VM: 2451 case KVM_CREATE_VM:
2452 r = -EINVAL;
2453 if (arg)
2454 goto out;
2446 r = kvm_dev_ioctl_create_vm(); 2455 r = kvm_dev_ioctl_create_vm();
2447 break; 2456 break;
2448 case KVM_GET_MSR_INDEX_LIST: { 2457 case KVM_GET_MSR_INDEX_LIST: {