qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: fix build with 5.2-rc2 kernel headers
@ 2019-06-04  7:19 Christian Borntraeger
  2019-06-04  7:42 ` Laurent Vivier
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Borntraeger @ 2019-06-04  7:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Arnd Bergmann, Gerhard Stenzel, Riku Voipio, Laurent Vivier,
	Christian Borntraeger, qemu-s390x

Since kernel commit 0768e17073dc527ccd ("net: socket: implement 64-bit
timestamps") the linux kernel headers (those installed on the build
system, not those that are synced to QEMU) will make qemu-user fail to
build:

/root/rpmbuild/BUILD/qemu-4.0.50/linux-user/ioctls.h:222:9: error: 'SIOCGSTAMP' undeclared here (not in a function); did you mean 'SIOCSRARP'?
  222 |   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
      |         ^~~~~~~~~~

Let us fix this by including  "linux/sockios.h" instead of relying on
"sys/socket.h" providing those defines via an include chain.

Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: Gerhard Stenzel <gerhard.stenzel@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efa3ec2837..7332be9b06 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -34,6 +34,7 @@
 #include <sys/resource.h>
 #include <sys/swap.h>
 #include <linux/capability.h>
+#include <linux/sockios.h>
 #include <sched.h>
 #include <sys/timex.h>
 #include <sys/socket.h>
-- 
2.21.0



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

* Re: [Qemu-devel] [PATCH] linux-user: fix build with 5.2-rc2 kernel headers
  2019-06-04  7:19 [Qemu-devel] [PATCH] linux-user: fix build with 5.2-rc2 kernel headers Christian Borntraeger
@ 2019-06-04  7:42 ` Laurent Vivier
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2019-06-04  7:42 UTC (permalink / raw)
  To: Christian Borntraeger, qemu-devel
  Cc: Gerhard Stenzel, qemu-s390x, Riku Voipio, Arnd Bergmann

Le 04/06/2019 à 09:19, Christian Borntraeger a écrit :
> Since kernel commit 0768e17073dc527ccd ("net: socket: implement 64-bit
> timestamps") the linux kernel headers (those installed on the build
> system, not those that are synced to QEMU) will make qemu-user fail to
> build:
> 
> /root/rpmbuild/BUILD/qemu-4.0.50/linux-user/ioctls.h:222:9: error: 'SIOCGSTAMP' undeclared here (not in a function); did you mean 'SIOCSRARP'?
>   222 |   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
>       |         ^~~~~~~~~~
> 
> Let us fix this by including  "linux/sockios.h" instead of relying on
> "sys/socket.h" providing those defines via an include chain.

I'm not sure it is as simple as this:
the value of SIOCGSTAMP depends on the size of struct timeval, and we
should use SIOCGSTAMP_OLD and SIOCGSTAMP_NEW to have the host and the
guest parts in sync.

Thanks,
Laurent
> 
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Reported-by: Gerhard Stenzel <gerhard.stenzel@de.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  linux-user/syscall.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index efa3ec2837..7332be9b06 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -34,6 +34,7 @@
>  #include <sys/resource.h>
>  #include <sys/swap.h>
>  #include <linux/capability.h>
> +#include <linux/sockios.h>
>  #include <sched.h>
>  #include <sys/timex.h>
>  #include <sys/socket.h>
> 



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

end of thread, other threads:[~2019-06-04  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-04  7:19 [Qemu-devel] [PATCH] linux-user: fix build with 5.2-rc2 kernel headers Christian Borntraeger
2019-06-04  7:42 ` Laurent Vivier

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).