Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0fe510864a4520a85dfa35ae14f5f376c56efc7
Commit:     f0fe510864a4520a85dfa35ae14f5f376c56efc7
Parent:     07c45a366d89f8eaec5d9890e810171b408f9a52
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 13:11:17 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:25 2007 +0300

    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 <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index cba0b87..ba7f43a 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,
 
        switch (ioctl) {
        case KVM_RUN:
+               r = -EINVAL;
+               if (arg)
+                       goto out;
                r = kvm_vcpu_ioctl_run(vcpu, vcpu->run);
                break;
        case KVM_GET_REGS: {
@@ -2440,9 +2443,15 @@ static long kvm_dev_ioctl(struct file *filp,
 
        switch (ioctl) {
        case KVM_GET_API_VERSION:
+               r = -EINVAL;
+               if (arg)
+                       goto out;
                r = KVM_API_VERSION;
                break;
        case KVM_CREATE_VM:
+               r = -EINVAL;
+               if (arg)
+                       goto out;
                r = kvm_dev_ioctl_create_vm();
                break;
        case KVM_GET_MSR_INDEX_LIST: {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to