Re: [PATCH] KVM: Avoid using CONFIG_ in userspace visible headers

From: Avi Kivity
Date: Mon Jan 19 2009 - 08:31:33 EST


Ingo Molnar wrote:
btw., would be nice to somehow untangle consciously-exported interface definitions from kernel side bits, and standardize these feature/capability flags like __KVM_HAVE_IOAPIC, etc.

Right now we have this body of 75,000 lines of code spread out in 600+ header files that are so-called 'exported' to user-space, but 95% of that interface definition code is never being relied on by any user-space bit! They are exported due to cargo-cult mentality or due to dependencies.

It would be far better to have an explicit place for such bits, include/syscall-ABI/ or so - and not export _any_ other kernel headers. But that's a much larger project.

Yes, kvm has non-interface stuff in <linux/kvm_host.h>, so there's at least some separation. All of <linux/kvm.h> is needed by userspace.

What's more painful to me in this area is advertising what's exported. Right now userspace has to rely on the kernel version to see what features are supported, but that doesn't work if a feature is backported or removed. KVM has KVM_CHECK_EXTENSION which I'd love to see standardized.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/