Carsten Otte wrote:
> We've seen various big patches regarding portability from Christian and
> Xianto, but none was merged to date. Maintaining a large patch set on
> top of a quickly moving code base is painful.
> I thought it might be cool to try to throw trivial patches at Avi that
> obviously don't break things and push towards portability. In case this
> succeeds I'll keep throwing in trivial patches until we've split
> everything proper.
> This patch splits kvm_dev_ioctl into architecture independent and
> architecture dependent ioctls. Those that are arch independent remain in
> kvm_main.c, others are implemented by kvm_arch_dev_ioctl() in kvm_x86.c.
> A header file named kvm_arch.h is being introduced that contains
> prototypes for funtions in kvm_x86.c.
>
> Comments? Is this a preferable approach? What needs to be done
> different?
>
>   

Small, reviewable, posted patches are definitely the best way forward.

> -     case KVM_CHECK_EXTENSION: {
> -             int ext = (long)argp;
> -
> -             switch (ext) {
> -             case KVM_CAP_IRQCHIP:
> -             case KVM_CAP_HLT:
> -             case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
> -                     r = 1;
> -                     break;
> -             default:
> -                     r = 0;
> -                     break;
> -             }
> -             break;
> -     }
>   

CHECK_EXTENSION is hopefully a generic mechanism (even if the some of 
the actual extensions are not).  So there should be a switch in common 
code for the common extensions, and the default: target should call 
kvm_arch_check_extension() for further processing.

> -     case KVM_GET_VCPU_MMAP_SIZE:
> -             r = -EINVAL;
> -             if (arg)
> -                     goto out;
> -             r = 2 * PAGE_SIZE;
> -             break;
>   

I would think this is generic too?  Isn't s390 interested in passing 
information to userspace via a mmap()ed region?

Note that mmio data is passed via that region.


>  
> Index: kvm/drivers/kvm/kvm_x86.c
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ kvm/drivers/kvm/kvm_x86.c 2007-10-09 16:47:55.000000000 +0200
>   

x86.c


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to