* [Qemu-devel] [PATCH] linux-user: fix includes to find SIOCGSTAMP with latest kernel headers
@ 2019-06-17 11:40 Daniel P. Berrangé
2019-06-17 11:47 ` Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-06-17 11:40 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Daniel P. Berrangé, Laurent Vivier
The SIOCGSTAMP symbol was previously defined in the
asm-generic/sockios.h header file. QEMU sees that header
indirectly via
sys/socket.h
-> bits/socket.h
-> asm/socket.h
-> asm-generic/socket.h
-> asm/sockios.h
-> asm-generic/sockios.h
In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
Instead it provides only SIOCGSTAMP_OLD.
The linux/sockios.h header now defines SIOCGSTAMP using either
SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
header file is not pulled in by QEMU though, so we get a build
failure:
qemu/linux-user/ioctls.h:225:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
225 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
| ^~~~~~~~~~
qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
| ^~~
qemu/linux-user/ioctls.h:226:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
226 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
| ^~~~~~~~~~~~
qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
| ^~~
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
linux-user/syscall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b187c1281d..f13e260b02 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -37,6 +37,7 @@
#include <sched.h>
#include <sys/timex.h>
#include <sys/socket.h>
+#include <linux/sockios.h>
#include <sys/un.h>
#include <sys/uio.h>
#include <poll.h>
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user: fix includes to find SIOCGSTAMP with latest kernel headers
2019-06-17 11:40 [Qemu-devel] [PATCH] linux-user: fix includes to find SIOCGSTAMP with latest kernel headers Daniel P. Berrangé
@ 2019-06-17 11:47 ` Laurent Vivier
2019-06-17 13:12 ` Daniel P. Berrangé
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2019-06-17 11:47 UTC (permalink / raw)
To: Daniel P. Berrangé, qemu-devel; +Cc: Riku Voipio
Le 17/06/2019 à 13:40, Daniel P. Berrangé a écrit :
> The SIOCGSTAMP symbol was previously defined in the
> asm-generic/sockios.h header file. QEMU sees that header
> indirectly via
>
> sys/socket.h
> -> bits/socket.h
> -> asm/socket.h
> -> asm-generic/socket.h
> -> asm/sockios.h
> -> asm-generic/sockios.h
>
> In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
> the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
> Instead it provides only SIOCGSTAMP_OLD.
>
> The linux/sockios.h header now defines SIOCGSTAMP using either
> SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
> header file is not pulled in by QEMU though, so we get a build
> failure:
>
> qemu/linux-user/ioctls.h:225:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
> 225 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
> | ^~~~~~~~~~
> qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
> 4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
> | ^~~
> qemu/linux-user/ioctls.h:226:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
> 226 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
> | ^~~~~~~~~~~~
> qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
> 4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
> | ^~~
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> linux-user/syscall.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index b187c1281d..f13e260b02 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -37,6 +37,7 @@
> #include <sched.h>
> #include <sys/timex.h>
> #include <sys/socket.h>
> +#include <linux/sockios.h>
> #include <sys/un.h>
> #include <sys/uio.h>
> #include <poll.h>
>
We already had a patch for that:
https://patchew.org/QEMU/20190604071915.288045-1-borntraeger@de.ibm.com/
but the value of SIOCGSTAMP depends on the size of struct timeval. The
host part must be able to process SIOCGSTAMP_OLD and SIOCGSTAMP_NEW if
it defines them.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user: fix includes to find SIOCGSTAMP with latest kernel headers
2019-06-17 11:47 ` Laurent Vivier
@ 2019-06-17 13:12 ` Daniel P. Berrangé
0 siblings, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-06-17 13:12 UTC (permalink / raw)
To: Laurent Vivier; +Cc: Riku Voipio, qemu-devel
On Mon, Jun 17, 2019 at 01:47:48PM +0200, Laurent Vivier wrote:
> Le 17/06/2019 à 13:40, Daniel P. Berrangé a écrit :
> > The SIOCGSTAMP symbol was previously defined in the
> > asm-generic/sockios.h header file. QEMU sees that header
> > indirectly via
> >
> > sys/socket.h
> > -> bits/socket.h
> > -> asm/socket.h
> > -> asm-generic/socket.h
> > -> asm/sockios.h
> > -> asm-generic/sockios.h
> >
> > In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115
> > the asm-generic/sockios.h header no longer defines SIOCGSTAMP.
> > Instead it provides only SIOCGSTAMP_OLD.
> >
> > The linux/sockios.h header now defines SIOCGSTAMP using either
> > SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. This linux only
> > header file is not pulled in by QEMU though, so we get a build
> > failure:
> >
> > qemu/linux-user/ioctls.h:225:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
> > 225 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
> > | ^~~~~~~~~~
> > qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
> > 4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
> > | ^~~
> > qemu/linux-user/ioctls.h:226:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
> > 226 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
> > | ^~~~~~~~~~~~
> > qemu/linux-user/syscall.c:4855:23: note: in definition of macro ‘IOCTL’
> > 4855 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
> > | ^~~
> >
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> > linux-user/syscall.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> > index b187c1281d..f13e260b02 100644
> > --- a/linux-user/syscall.c
> > +++ b/linux-user/syscall.c
> > @@ -37,6 +37,7 @@
> > #include <sched.h>
> > #include <sys/timex.h>
> > #include <sys/socket.h>
> > +#include <linux/sockios.h>
> > #include <sys/un.h>
> > #include <sys/uio.h>
> > #include <poll.h>
> >
>
> We already had a patch for that:
>
> https://patchew.org/QEMU/20190604071915.288045-1-borntraeger@de.ibm.com/
>
> but the value of SIOCGSTAMP depends on the size of struct timeval. The
> host part must be able to process SIOCGSTAMP_OLD and SIOCGSTAMP_NEW if
> it defines them.
I've sent a v2 that attempts to handle both struct sizes
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-17 13:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-17 11:40 [Qemu-devel] [PATCH] linux-user: fix includes to find SIOCGSTAMP with latest kernel headers Daniel P. Berrangé
2019-06-17 11:47 ` Laurent Vivier
2019-06-17 13:12 ` Daniel P. Berrangé
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).