* [PATCH] tests/migration: Restrict initrd-stress.img to Linux
@ 2023-07-10 17:56 Philippe Mathieu-Daudé
2023-07-10 18:11 ` Daniel P. Berrangé
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-10 17:56 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Xu, Thomas Huth, Juan Quintela, Leonardo Bras,
Philippe Mathieu-Daudé
Trying to build initrd-stress.img on Darwin we get:
$ ninja tests/migration/initrd-stress.img
Compiling C object tests/migration/stress.p/stress.c.o
FAILED: tests/migration/stress.p/stress.c.o
../tests/migration/stress.c:24:10: fatal error: 'linux/random.h' file not found
#include <linux/random.h>
^~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
Per the include path, this test is Linux specific.
Since this is the single binary built in this directory,
restrict the whole meson.build to Linux.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/migration/meson.build | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/migration/meson.build b/tests/migration/meson.build
index ac71f13290..56523e0785 100644
--- a/tests/migration/meson.build
+++ b/tests/migration/meson.build
@@ -1,3 +1,7 @@
+if targetos != 'linux'
+ subdir_done()
+endif
+
sysprof = dependency('sysprof-capture-4', required: false)
glib_static = dependency('glib-2.0', version: glib_req_ver, required: false,
method: 'pkg-config', static: true)
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/migration: Restrict initrd-stress.img to Linux
2023-07-10 17:56 [PATCH] tests/migration: Restrict initrd-stress.img to Linux Philippe Mathieu-Daudé
@ 2023-07-10 18:11 ` Daniel P. Berrangé
2023-07-10 19:17 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Daniel P. Berrangé @ 2023-07-10 18:11 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Peter Xu, Thomas Huth, Juan Quintela, Leonardo Bras
On Mon, Jul 10, 2023 at 07:56:07PM +0200, Philippe Mathieu-Daudé wrote:
> Trying to build initrd-stress.img on Darwin we get:
>
> $ ninja tests/migration/initrd-stress.img
> Compiling C object tests/migration/stress.p/stress.c.o
> FAILED: tests/migration/stress.p/stress.c.o
> ../tests/migration/stress.c:24:10: fatal error: 'linux/random.h' file not found
> #include <linux/random.h>
> ^~~~~~~~~~~~~~~~
I think that's historical accident, as AFAICT, nothing in stress.c
needs that include to be present.
> 1 error generated.
> ninja: build stopped: subcommand failed.
>
> Per the include path, this test is Linux specific.
> Since this is the single binary built in this directory,
> restrict the whole meson.build to Linux.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> tests/migration/meson.build | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/migration/meson.build b/tests/migration/meson.build
> index ac71f13290..56523e0785 100644
> --- a/tests/migration/meson.build
> +++ b/tests/migration/meson.build
> @@ -1,3 +1,7 @@
> +if targetos != 'linux'
> + subdir_done()
> +endif
> +
> sysprof = dependency('sysprof-capture-4', required: false)
> glib_static = dependency('glib-2.0', version: glib_req_ver, required: false,
> method: 'pkg-config', static: true)
> --
> 2.38.1
>
>
With 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] 4+ messages in thread
* Re: [PATCH] tests/migration: Restrict initrd-stress.img to Linux
2023-07-10 18:11 ` Daniel P. Berrangé
@ 2023-07-10 19:17 ` Philippe Mathieu-Daudé
2023-07-11 11:50 ` Daniel P. Berrangé
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-10 19:17 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: qemu-devel, Peter Xu, Thomas Huth, Juan Quintela, Leonardo Bras
On 10/7/23 20:11, Daniel P. Berrangé wrote:
> On Mon, Jul 10, 2023 at 07:56:07PM +0200, Philippe Mathieu-Daudé wrote:
>> Trying to build initrd-stress.img on Darwin we get:
>>
>> $ ninja tests/migration/initrd-stress.img
>> Compiling C object tests/migration/stress.p/stress.c.o
>> FAILED: tests/migration/stress.p/stress.c.o
>> ../tests/migration/stress.c:24:10: fatal error: 'linux/random.h' file not found
>> #include <linux/random.h>
>> ^~~~~~~~~~~~~~~~
>
> I think that's historical accident, as AFAICT, nothing in stress.c
> needs that include to be present.
Removing I get:
../../tests/migration/stress.c:35:12: error: 'syscall' is deprecated:
first deprecated in macOS 10.12 - syscall(2) is unsupported; please
switch to a supported interface. For SYS_kdebug_trace use
kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
return syscall(SYS_gettid);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:746:6:
note: 'syscall' has been explicitly marked deprecated here
int syscall(int, ...);
^
../../tests/migration/stress.c:43:16: error: use of undeclared
identifier 'RB_POWER_OFF'
reboot(RB_POWER_OFF);
^
../../tests/migration/stress.c:241:39: error: too many arguments to
function call, expected 4, have 5
if (mount("none", dir, fstype, 0, NULL) < 0) {
~~~~~ ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/stddef.h:89:16:
note: expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/mount.h:448:9:
note: 'mount' declared here
int mount(const char *, const char *, int, void *);
^
3 errors generated.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/migration: Restrict initrd-stress.img to Linux
2023-07-10 19:17 ` Philippe Mathieu-Daudé
@ 2023-07-11 11:50 ` Daniel P. Berrangé
0 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2023-07-11 11:50 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Peter Xu, Thomas Huth, Juan Quintela, Leonardo Bras
On Mon, Jul 10, 2023 at 09:17:43PM +0200, Philippe Mathieu-Daudé wrote:
> On 10/7/23 20:11, Daniel P. Berrangé wrote:
> > On Mon, Jul 10, 2023 at 07:56:07PM +0200, Philippe Mathieu-Daudé wrote:
> > > Trying to build initrd-stress.img on Darwin we get:
> > >
> > > $ ninja tests/migration/initrd-stress.img
> > > Compiling C object tests/migration/stress.p/stress.c.o
> > > FAILED: tests/migration/stress.p/stress.c.o
> > > ../tests/migration/stress.c:24:10: fatal error: 'linux/random.h' file not found
> > > #include <linux/random.h>
> > > ^~~~~~~~~~~~~~~~
> >
> > I think that's historical accident, as AFAICT, nothing in stress.c
> > needs that include to be present.
>
> Removing I get:
True, the resulting file is still written to assume Linux userspace.
We can remove the linux/random.h header as it is redundant. Your
patch is still needed, just with a more general commit message
saying that many requird features are Linux only.
>
> ../../tests/migration/stress.c:35:12: error: 'syscall' is deprecated: first
> deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a
> supported interface. For SYS_kdebug_trace use kdebug_signpost().
> [-Werror,-Wdeprecated-declarations]
> return syscall(SYS_gettid);
> ^
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:746:6:
> note: 'syscall' has been explicitly marked deprecated here
> int syscall(int, ...);
> ^
> ../../tests/migration/stress.c:43:16: error: use of undeclared identifier
> 'RB_POWER_OFF'
> reboot(RB_POWER_OFF);
> ^
> ../../tests/migration/stress.c:241:39: error: too many arguments to function
> call, expected 4, have 5
> if (mount("none", dir, fstype, 0, NULL) < 0) {
> ~~~~~ ^~~~
> /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/stddef.h:89:16:
> note: expanded from macro 'NULL'
> # define NULL ((void*)0)
> ^~~~~~~~~~
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/mount.h:448:9:
> note: 'mount' declared here
> int mount(const char *, const char *, int, void *);
> ^
> 3 errors generated.
>
With 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] 4+ messages in thread
end of thread, other threads:[~2023-07-11 11:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-10 17:56 [PATCH] tests/migration: Restrict initrd-stress.img to Linux Philippe Mathieu-Daudé
2023-07-10 18:11 ` Daniel P. Berrangé
2023-07-10 19:17 ` Philippe Mathieu-Daudé
2023-07-11 11:50 ` 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).