From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZy1O-0003nP-2o for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:19:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZy1N-00053C-5R for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:19:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZy1M-00051e-Mp for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:19:57 -0400 References: <1441816441-7730-1-git-send-email-pbonzini@redhat.com> <1441816441-7730-3-git-send-email-pbonzini@redhat.com> <20150910103319-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <55F14B34.5050906@redhat.com> Date: Thu, 10 Sep 2015 11:19:48 +0200 MIME-Version: 1.0 In-Reply-To: <20150910103319-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] target-i386: move asm-x86/hyperv.h to standard-headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: cornelia.huck@de.ibm.com, den@openvz.org, qemu-devel@nongnu.org On 10/09/2015 09:42, Michael S. Tsirkin wrote: > On Wed, Sep 09, 2015 at 06:34:01PM +0200, Paolo Bonzini wrote: >> The Hyper-V definitions are an industry standard and can be used >> from code that is not KVM-specific. >> >> The changes to scripts/update-linux-headers.sh are required because there >> is both an asm-x86/hyperv.h and a linux/hyperv.h file. linux/hyperv.h >> introduces dependencies on additional Linux uapi headers, so we only >> want the former. >> >> The solution is to make cp_virtio (now renamed to cp_portable) copy >> one file only, instead of using the "find" command, and call it multiple >> times. The new function is really just a reindentation of the old one. >> >> Signed-off-by: Paolo Bonzini > > I'd rather see a script update, then result of running it > in a separate patch. Okay, I'll split the patch in two. >> @@ -68,6 +61,7 @@ cp_virtio() { >> ARCHLIST=$(cd "$linux/arch" && echo *) >> >> for arch in $ARCHLIST; do >> + >> # Discard anything which isn't a KVM-supporting architecture >> if ! [ -e "$linux/arch/$arch/include/asm/kvm.h" ] && >> ! [ -e "$linux/arch/$arch/include/uapi/asm/kvm.h" ] ; then > > This empty line looks ugly imho. Right. >> +cat <$output/linux-headers/asm-x86/hyperv.h >> +#include "standard-headers/asm-x86/hyperv.h" >> +EOF > > I don't think this is needed. We only did this for > virtio_config to avoid the code churn. Hyperv has > a single user, so no issue. It is needed because kvm headers include and you don't want to pick the system version. >> cat <$output/linux-headers/linux/virtio_config.h >> #include "standard-headers/linux/virtio_config.h" >> EOF >> @@ -120,7 +122,12 @@ cat <$output/linux-headers/linux/virtio_ring.h >> #include "standard-headers/linux/virtio_ring.h" >> EOF >> >> -cp_virtio "$tmpdir/include/linux/" "$output/include/standard-headers/linux" >> +rm -rf "$output/include/standard-headers/linux" >> +mkdir -p "$output/include/standard-headers/linux" >> +for i in "$tmpdir"/include/linux/*virtio*.h "$tmpdir/include/linux/input.h" \ >> + "$tmpdir/include/linux/pci_regs.h"; do >> + cp_portable "$i" "$output/include/standard-headers/linux" >> +done > > How about we move the above loop into cp_virtio? I disagree, because input.h and pci_regs.h make no sense for s390. Paolo > Then we can reuse it for asm like we did. > hyperv can use cp_portable if it wants to. > >> >> cat <$output/include/standard-headers/linux/types.h >> #include >> diff --git a/target-i386/kvm.c b/target-i386/kvm.c >> index 066d03d..d8a11be 100644 >> --- a/target-i386/kvm.c >> +++ b/target-i386/kvm.c >> @@ -33,7 +33,7 @@ >> #include "hw/i386/apic_internal.h" >> #include "hw/i386/apic-msidef.h" >> #include "exec/ioport.h" >> -#include >> +#include "standard-headers/asm-x86/hyperv.h" >> #include "hw/pci/pci.h" >> #include "migration/migration.h" >> #include "exec/memattrs.h" >> -- >> 2.4.3