Re: [PATCH] kvm: Make kvm_rebooting visible

Andi Kleen
2013-08-05T22:57:59Z

> > static void kvm_io_bus_destroy(struct kvm_io_bus *bus);
> >
> >-bool kvm_rebooting;
> >+__visible bool kvm_rebooting;
> > EXPORT_SYMBOL_GPL(kvm_rebooting);
>
> How many of these are there kernel wide?

Not very many (at least on x86 allyes) <~10.
Also most users are not exported.

Probably not worth an own macro.

>
> Could you do something like this instead:
>
> DEFINE_AND_EXPORT_GPL(bool, kvm_rebooting);
>
> The definition of DEFINE_AND_EXPORT_GPL(_type, _name) is left as an
> exercise for the reader.

I actually had EXPORT_SYMBOL make things always visible for a long time,
but it prevents optimizing away unused code in very small
non modular configurations. So I switched to separate annotations.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.