qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts: Explain the difference between linux-headers and standard-headers
@ 2021-12-09 17:34 Thomas Huth
  2021-12-09 17:44 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2021-12-09 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Paolo Bonzini, Cornelia Huck, Michael S. Tsirkin

If you don't know it, it's hard to figure out the difference between
the linux-headers folder and the include/standard-headers folder.
So let's add a short explanation to clarify the difference.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/update-linux-headers.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index fea4d6eb65..96c7daef94 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -9,6 +9,13 @@
 #
 # This work is licensed under the terms of the GNU GPL version 2.
 # See the COPYING file in the top-level directory.
+#
+# The script will copy the headers into two target folder:
+#
+# - linux-headers/ for file that are required for compiling on a Linux host
+#
+# - include/standard-headers/ for files that are used for guest device emulation
+#
 
 tmpdir=$(mktemp -d)
 linux="$1"
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts: Explain the difference between linux-headers and standard-headers
  2021-12-09 17:34 [PATCH] scripts: Explain the difference between linux-headers and standard-headers Thomas Huth
@ 2021-12-09 17:44 ` Peter Maydell
  2021-12-09 17:59   ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2021-12-09 17:44 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Paolo Bonzini, Cornelia Huck, qemu-devel, Michael S. Tsirkin

On Thu, 9 Dec 2021 at 17:34, Thomas Huth <thuth@redhat.com> wrote:
>
> If you don't know it, it's hard to figure out the difference between
> the linux-headers folder and the include/standard-headers folder.
> So let's add a short explanation to clarify the difference.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  scripts/update-linux-headers.sh | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index fea4d6eb65..96c7daef94 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -9,6 +9,13 @@
>  #
>  # This work is licensed under the terms of the GNU GPL version 2.
>  # See the COPYING file in the top-level directory.
> +#
> +# The script will copy the headers into two target folder:

"folders"

> +#
> +# - linux-headers/ for file that are required for compiling on a Linux host

"files"

> +#
> +# - include/standard-headers/ for files that are used for guest device emulation
> +#


We could expand on this a little if you like, eg:

- linux-headers/ for files that are required for compiling on a Linux host.
  Generally we have these so we can use kernel structs and defines that
  are more recent than the headers that might be in /usr/include/linux
  on the host system. Usually this script can do simple file copies
  for these headers.

- include/standard-headers/ for files that are used for guest device emulation
  and are required on all hosts. For instance, we get our definitions of the
  virtio structures from the Linux kernel headers, but we need those
  definitions regardless of which host OS we are building on. This script
  has to be careful to sanitize the headers to remove any use of Linux-specifics
  such as types like "__u64". This work is done in the cp_portable function.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts: Explain the difference between linux-headers and standard-headers
  2021-12-09 17:44 ` Peter Maydell
@ 2021-12-09 17:59   ` Thomas Huth
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2021-12-09 17:59 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Paolo Bonzini, Cornelia Huck, qemu-devel, Michael S. Tsirkin

On 09/12/2021 18.44, Peter Maydell wrote:
> On Thu, 9 Dec 2021 at 17:34, Thomas Huth <thuth@redhat.com> wrote:
>>
>> If you don't know it, it's hard to figure out the difference between
>> the linux-headers folder and the include/standard-headers folder.
>> So let's add a short explanation to clarify the difference.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   scripts/update-linux-headers.sh | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
>> index fea4d6eb65..96c7daef94 100755
>> --- a/scripts/update-linux-headers.sh
>> +++ b/scripts/update-linux-headers.sh
>> @@ -9,6 +9,13 @@
>>   #
>>   # This work is licensed under the terms of the GNU GPL version 2.
>>   # See the COPYING file in the top-level directory.
>> +#
>> +# The script will copy the headers into two target folder:
> 
> "folders"
> 
>> +#
>> +# - linux-headers/ for file that are required for compiling on a Linux host
> 
> "files"
> 
>> +#
>> +# - include/standard-headers/ for files that are used for guest device emulation
>> +#
> 
> 
> We could expand on this a little if you like, eg:
> 
> - linux-headers/ for files that are required for compiling on a Linux host.
>    Generally we have these so we can use kernel structs and defines that
>    are more recent than the headers that might be in /usr/include/linux
>    on the host system. Usually this script can do simple file copies
>    for these headers.
> 
> - include/standard-headers/ for files that are used for guest device emulation
>    and are required on all hosts. For instance, we get our definitions of the
>    virtio structures from the Linux kernel headers, but we need those
>    definitions regardless of which host OS we are building on. This script
>    has to be careful to sanitize the headers to remove any use of Linux-specifics
>    such as types like "__u64". This work is done in the cp_portable function.

Sounds like a very good idea! Could you please send this as a patch (since 
this wouldn't be my own words anymore)?

  Thomas



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-09 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09 17:34 [PATCH] scripts: Explain the difference between linux-headers and standard-headers Thomas Huth
2021-12-09 17:44 ` Peter Maydell
2021-12-09 17:59   ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).