On 17.08.2017 14:35, Thomas Huth wrote: > On 17.08.2017 13:40, Philippe Mathieu-Daudé wrote: >> Hi David, >> >> On 08/17/2017 06:22 AM, David Hildenbrand wrote: >>> Let's do it just like the other architectures. Introduce kvm-stub.c >>> for stubs and kvm_s390x.h for the declarations. >>> >>> Add a fake declaration of struct kvm_s390_irq so we don't need other >>> ugly CONFIG_KVM checks. >> >> You can use an opaque pointer to avoid that ("bridge" design pattern). >> >> It involves few more changes but looks safer. > > There is maybe even a simpler solution than that, see below ... > > [...] >>> feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/ >>> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h >>> index 74d5b35..aeb730c 100644 >>> --- a/target/s390x/cpu.h >>> +++ b/target/s390x/cpu.h >>> @@ -41,6 +41,7 @@ >>> #include "exec/cpu-all.h" >>> #include "fpu/softfloat.h" >>> +#include "kvm_s390x.h" > > Do we still need that? cpu.h should theoretically be independent from > kvm now, shouldn't it? And for the .c files, it's likely better to > include kvm_s390x.h directly there if they require it.
It should work if: a) we include "sysemu/kvm.h" in hw/s390x/s390-virtio-ccw.c b) we include "target/s390x/kvm_s390x.h" in hw/intc/s390_flic_kvm.c c) we include "kvm_s390x.h" in "internal.h" d) we drop the "KVMState" parameter from kvm_s390_get_memslot_count() (separate patch) > > May I suggest to simply use this instead: > > struct kvm_s390_irq; That also seems to compile just fine. > > No need to switch for a typedef here, you can simply use this anonymous > struct declaration, I think. > > Thomas > -- Thanks, David