I think Paolo's approach can work even with vl.c including kvm.h, provided that kvm.h remains such that it can be used safely.
The situation is a bit fragile though. Some kind of poisoning, splitting kvm.h into two files, or other means should be used to make kvm.h more robust. Blue Swirl (2): Compile vl.c once Compile event_notifier only once Paolo Bonzini (1): provide a stub version of kvm-all.c if !CONFIG_KVM Makefile.objs | 4 +- Makefile.target | 5 +- kvm-all.c | 6 ++- kvm-stub.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ kvm.h | 13 +---- vl.c | 16 +++---- 6 files changed, 154 insertions(+), 25 deletions(-) create mode 100644 kvm-stub.c