From: Paolo Bonzini Subject: Re: [kvm-unit-tests PATCH] kvm-unit-tests: Gtests Framework and Example Tests Date: Thu, 1 Feb 2018 11:58:45 -0500 Message-ID: <953ce426-985a-4642-30c4-b2876d22b62d@redhat.com> References: <20180125184803.228086-1-hofsass@google.com> <20180130160924.GD22015@flask> <20180131085601.4yhk6tc3kqq2vv3t@kamzik.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Jim Mattson , kvm@vger.kernel.org To: Andrew Jones , Ken Hofsass Return-path: Received: from mail-qk0-f169.google.com ([209.85.220.169]:35960 "EHLO mail-qk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752875AbeBAQ6r (ORCPT ); Thu, 1 Feb 2018 11:58:47 -0500 Received: by mail-qk0-f169.google.com with SMTP id d21so20257772qkj.3 for ; Thu, 01 Feb 2018 08:58:47 -0800 (PST) In-Reply-To: <20180131085601.4yhk6tc3kqq2vv3t@kamzik.brq.redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 31/01/2018 03:56, Andrew Jones wrote: >>> (Also, doesn't compile here due to missing #include >>> and I didn't look further.) >> >> My apologies. Please try "KERNEL= make" >> >> The gtests code needs the actual KVM/kernel headers for the API/ABI >> details. I should have added a check for $KERNEL before building >> gtests. If you have a different recommendation for referencing the >> kernel sources from the kvm-unit-test directory, let me know. >> > > We've been copying the kernel files we need (see lib/linux/), or even > just cherry-picking the defines we need from linux headers and dropping > them into their respective kvm-unit-tests' lib/$ARCH/asm/ headers. Is > there some reason you've opted not to do that? > > On a historical note, kvm-unit-tests used to look in kernel sources for > headers, but we decided it would be more useful for the test suite to > remove the dependency. That was pre 'make standalone' though. We could > start a discussion about how much we need kvm-unit-tests to _build_ > without the dependency now, as one can always build standalone tests > on a build machine and then easily copy them to test machines. There are two things to consider in this. The first thing is separating the kvm-unit-tests "mini guest" tests from the API tests that Ken is adding. For the "mini guest" tests, having no Linux dependency is a feature. While we occasionally copy some code because we're lazy, the code is completely freestanding and not necessarily related to KVM actually. It could even be compiled on Windows or OS X if somebody cared. API tests instead are Linux- and KVM-specific. The second thing is separating UAPI vs. kernel development headers for API tests. Here, the API tests certainly can use the installed UAPI headers from /usr/include/linux (we _can_ copy them, but don't necessarily _have to_), but they shouldn't use the kernel development headers because those are reserved to kernel modules. Paolo