Commit Graph

80225 Commits

Author SHA1 Message Date
Paolo Bonzini ca0fc78431 configure: move disassembler configuration to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Paolo Bonzini 660f793093 Makefile: inline the relevant parts of rules.mak
Most of rules.mak is not used anymore, just inline what's needed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Paolo Bonzini 296bf3d12b Makefile: remove dead variables and includes
Makefile.objs, the .d files and various CONFIG_* symbols are not
used anymore by the Make side of the build; they are only processed
by Meson.  We can delete them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Paolo Bonzini a98006bc79 meson: compute config_all_devices directly
There is no need anymore to produce config-all-devices.mak, compute
the resulting dictionary directly instead of going through grepy.sh.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Paolo Bonzini 0f4d8894df configure: remove dead code for in-tree builds
The $pwd_is_source_path variable is never "y", since
configure re-executes itself from a build directory.
Remove code that will never run.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 4fbcdcd742 meson: convert migration/initrd-stress
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-17-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 3909def82a meson: fix migration/stress compilation with glibc>=2.30
gettid() was introduced with glibc 2.30.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-16-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau c4c4aacb24 tests/migration/stress: remove unused exit_success
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-15-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Paolo Bonzini 9ed7247a59 meson: convert the speed tests
Use meson benchmark() for them, adjust mtest2make.py for that.
A new target "make bench" can be used to run all benchmarks.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-14-marcandre.lureau@redhat.com>
[Rewrite mtest2make part. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 24441f912e tests: do not print benchmark output to stdout
As this makes the TAP output invalid. Use g_test_message().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200828110734.1638685-13-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau a52f4a7a57 meson: convert atomic*-bench
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-11-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 89d4dc8f8f meson: convert vhost-user-bridge
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-10-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau fb5c578697 meson: remove old socket_scm_helper rule
It was covered already in commit d3ca592b3c ("meson: convert check-block")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-9-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau af04e89dd9 meson: move keyutils dependency check
Since there is not minimum version specified, and it's a test-only
dependency, it's fair to depend on a version that ships with a .pc I
suppose.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-8-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau 279588d4de meson: convert the unit tests
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-7-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 11:43:16 +02:00
Marc-André Lureau a9726a900d meson: convert qht-bench
This is required by test-qht-par unit test.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-5-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Marc-André Lureau 9866a33cbb meson: declare keyutils dependency
Rename the variable to be more explicit. A further clean-up patch will
move the actual to dependency check to meson entirely.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Marc-André Lureau 8ce0a45fa2 meson: declare tasn1 dependency
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Marc-André Lureau 37e2777670 meson: build qapi tests library
- builds QAPI builtins types/visitor to fix a linking issue with
  unresolved symbols in the static library.

- work around a meson limitation on generated file output directories.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini c138156ba5 meson: fix libqos linking
Add genh to the sources to avoid race conditions between QAPI
file generation and libqos compilation.

Make the name_suffix .fa for consistency with other link_whole
static libraries and to work around a Meson issue where
lots of linker flags are placed between -Wl,--start-group and
-Wl,--end-group and this breaks the fork-fuzz.ld linker script.

Reported-by: Claudio Fontana <cfontana@suse.de>
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 8d60f37740 ninjatool: use constant names for stamp files
Numbering files according to rules causes confusion, because
CUSTOM_COMMAND3.stamp from a previous build might represent
completely different targets after Makefile.ninja is regenerated.
As a result, the new targets are not rebuilt and compilation
fails.

Use the targets to build a SHA1 hash; the chances for collision
are one in 2^24 even with a 12-character prefix of the hash.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini e817851479 configure: include cross sdl2-config in meson cross file
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 58683d07d2 configure: do not include absolute paths in -I and -L paths
On msys2, paths such as -L/e/path/to/qemu are not recognized by
the linker.  Fortunately we do not need absolute paths at all in a
non-recursive build system.

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 3e0e519026 meson: remove b_lundef option
Meson automatically adds "-undefined dynamic_lookup" to
shared_module build targets; b_lundef is only needed for
executables.  Therefore, we can remove this option.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 40d9b74eaf mtest2make: unify tests that appear in multiple suites
Whenever a test appears in multiple suites, the rules generated
by mtest2make are currently running it twice.  Instead, after
this patch we generate a phony target for each test and we have
a generic "run-tests" target depend on all the tests that were
chosen on the command line.  Tests that appear in multiple suites
will be added to the prerequisites just once.

This has other advantages: it removes the handling of -k and
it increases parallelism.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini d322e84eef mtest2make: hide output of successful tests
The softfloat tests are quite noisy; before the Meson conversion
they buffered the output in a file and emitted the output only
if the test failed.  Tweak mtest2make.py so that the courtesy
is extended to all non-TAP tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 42d729e12c mtest2make: split working directory from test command
Pass the working directory and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 555b27a750 mtest2make: split environment from test command
Pass the environment and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini e781190cda qemu-iotests: move check-block back to Makefiles
check-block has its own test harness, unlike every other test.  If
we capture its output, as is in general nicer to do without V=1,
there will be no sign of progress.  So for lack of a better option
just move the invocation of the test back to Makefile rules.

As a side effect, this will also fix "make check" in --disable-tools
builds, as they were trying to run qemu-iotests without having
made qemu-img before.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Peter Maydell e11bd71f89 * Fixes for cross-compiling with MinGW / compiling with MSYS2
* Enable cross-compiler builds in the Gitlab CI
 * Improvements / fixes for the crypto tests in the Gitlab CI
 * Fix for the "make check-acceptance" microblaze failure
   (required to get the Gitlab CI green again)
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAl9WIZMRHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbUaFg//T5/yuRz8TitZBJ7som5DgyhUHaFnOgA+
 uFeI3aDbqooRroAmElEMSzjas5oFVNaNUuk0OduYbXB8ZnQyZwD0ePfGvCHtNq1M
 YIYidNZQhf4D0m0r2WsjdnP2Yq1/J44WqyS2DmGWNgGp/80Ns4OVsm1sEgWowIsS
 3RmQi/u7G3KulNkuCD9f1raAXodYPqYuhnxK6wBeaf0QnScsoGSoYkirrgu3Vjp9
 mO78x5j6DrkCwwh2p3BP7rtORX3pZzjkBcqrL3buwLcuDiYMVtZbEf41uThlwLzd
 AyrQa1FoNJnQWafk6tZda52QhmVAUvoOhrxamzupWNPJeg2fkjKA3hfBSp+ic7yV
 5+1MmWaXlULNFjHSeSmsCZBhSh+i0Q3Lij7bLRQ5iuJcP/+pNWUIv7Csn07OBrg1
 aodc6APg510I6af3sf1VXRh20pqN2gBXEsYOODv/yuCmUR9k0dI9xecxSQEEntKk
 utY7HZGL1lQMU5kagR+VtZmRoBhloI3ie33wCaE0FzjLEdNDWMEr/xm3x/mB1eSn
 8qeqssdpvUT3cdxWGHWMpKUiE7bVsjsxEE4Ozx3rTLnzHHUMrgTAaBCpJHb7uzwi
 1XP5Scd0wPJmsoyFSfswIKQoeMdXqlGvUYTihk5Iin63lkDtlEP9wY8CVUrzYp4v
 3+y8hjkxWCg=
 =fpyA
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-09-07' into staging

* Fixes for cross-compiling with MinGW / compiling with MSYS2
* Enable cross-compiler builds in the Gitlab CI
* Improvements / fixes for the crypto tests in the Gitlab CI
* Fix for the "make check-acceptance" microblaze failure
  (required to get the Gitlab CI green again)

# gpg: Signature made Mon 07 Sep 2020 13:03:31 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2020-09-07:
  target/microblaze: Collected fixes for env->iflags
  tests/qtest: do not list ahci-test twice
  gitlab: expand test coverage for crypto builds
  crypto: fix build with gcrypt enabled
  gitlab-ci: Add cross-compiling build tests
  stubs: Move qemu_fd_register stub to util/main-loop.c
  stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  configure: Allow automatic WHPX detection
  dockerfiles/debian-win64-cross: Download WHPX MinGW headers
  tests/Makefile: test-image-locking needs CONFIG_POSIX
  tests: Fixes building test-util-filemonitor.c on msys2/mingw
  tests: fixes test-vmstate.c compile error on msys2
  tests: handling signal on win32 properly
  tests/docker: add python3-setuptools the docker images

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 16:51:00 +01:00
Peter Maydell 9d5589bb3f Add ppoll_time64() and pselect6_time64()
Some fixes for for elfload, fcntl, termbits and btrfs
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl9V+qQSHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748fSwQAJJFV7a9zFDGA2wmiu4mLffFN4FUwkE6
 Ov4/pzE8O6By5AnaBN8JiuoIYLKD5vdIjz/vuMwxxVUbwqBeqLGir+LmrGMhGNWO
 Ghu/SyDhGiot+WU3rAvn3cr2ceZgn+eZtDHdYO3pFcthe18JP1wJIYtYISL7I4Tm
 ulsp0JiL0+UqBQeJHwA+ttmL1kNDqnvwJqDLLX2cZ4QaMhmg/c825CXmvaP7gXUO
 FOhBBdSrCl8sPr/A4Lem8lvCJpZSPt3cZvmpRm/7H9Oe2FRMhaizIDuPhrJoWqui
 NH1UwOig0Sy9vBTAzpNCNjKOwXYFTePOB3QQcmaQSqWjSSReUHdcD/Fx2Dw9BYot
 9mv8QWZukyYOaO6Py4LmtFOc2uupDIEqkOnD0mVlGYjMlCd2LI6AG3eI1VDZNtiL
 mc4Mv6nZfn+/c7jXMg9ZrhR5Hm7lbBEtSSLs7hczgMoE2o9RyD4mILLdUKm+VZYn
 DfnwlrLtDAQvP3ANYemdSuMODQnFzcbz348m6MQr/6p98+9q9yxehE1SoDIBLSmk
 3xfSiTTv1nolTYdBG6/5h3pI7r3b76iHICKJVU0XTCd+XFs9o+MfRrtQ95f7T5hJ
 BRkyDHi/HDD8XFYbmCd3Zdy+/SlyL4TYsNLflSP9wwcFOX4odL7L9RN4T2bpcS1a
 t4qgCgCJxrNH
 =edT0
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging

Add ppoll_time64() and pselect6_time64()
Some fixes for for elfload, fcntl, termbits and btrfs

# gpg: Signature made Mon 07 Sep 2020 10:17:24 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.2-pull-request:
  linux-user: Protect btrfs ioctl target definitions
  linux-user: fix ppc/termbits.h
  linux-user: Map signal numbers in fcntl
  linux-user: Correctly start brk after executable
  linux-user: Add support for ppoll_time64() and pselect6_time64()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 15:31:04 +01:00
Peter Maydell 62f9256052 vga: fixes for cirrus and virtio-gpu.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCgAGBQJfUiRsAAoJEEy22O7T6HE4Tv4QAIhkJ8uyt4Z6OZYZclAs86Ny
 3z96+WCsuzCmI+qP8JAnLnegSxdqJgKWpBOQ6I/BdST6hsLJ5+56q+SYkOt27ry9
 CJF7l+xZgYuutl8dF4GXR6M8sDjWlKJtMwjFTZvo9/RQ9jm3DHsfFz0zi87oOyhr
 3XJM36aR/OMXSouxaPGhrw8tmi+AU0ditOa95NKK8qu872v4fHn2s/L0GKi61Qh9
 YoE3N141gFFmkPuWjalSFERc6ozQEf0DzOLK3efTSMHmjBRnzI8SmKUoXBd77+tj
 enLvRQW0vrGMFziV2sxCs4jJXvvY1QbW+7IOvry6hnRr7sIU+GsRcrBxWlKgCHrR
 1Gn2qY+9ALJTBbiGSWXiCfhoAqjZnv4MYWS4bZTuih3SlWgk8An+vIanM5YkVZg0
 1JMmEuSwfSFhet12fmR8SOStIGwXHACYTkVr6ITGvThaoAEaBG76wd80kv920ruW
 F892hq7Al6rm7rZ/hH5FZwXHOqEn8bomOZtl6DN2q5w5waZfzk6FnAVS86b79/18
 LvR1pf8xYAhUcckkJWKvk2kDghOjVsNun0o6FY7L3+8MBDHRGcSgJaZ2feAkH2S9
 ywUrYSItn0lvmVTvl9WWApRp8uR42f8R2Luf9kSWCzetBn1XAfGHjOiT20WO7jBB
 tx1oz5kE7sO5FwKXZJE0
 =inDV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200904-pull-request' into staging

vga: fixes for cirrus and virtio-gpu.

# gpg: Signature made Fri 04 Sep 2020 12:26:36 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20200904-pull-request:
  cirrus: handle wraparound in cirrus_invalidate_region
  virtio-gpu: fix unmap the already mapped items

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 13:27:20 +01:00
Richard Henderson 88e74b6122 target/microblaze: Collected fixes for env->iflags
There are several problems here that can result in soft lockup,
depending on exactly where an interrupt or exception is delivered:

Include BIMM_FLAG in IFLAGS_TB_MASK, since it needs to follow D_FLAG.
Ensure that iflags is 0 when entering an interrupt/exception handler.
Add mb_cpu_synchronize_from_tb to restore iflags from tb->flags.
The change to t_sync_flags is cosmetic, but makes the code clearer.

This fixes the reported regression in acceptance/replay_kernel.py.

Fixes: 683a247ed7 ("target/microblaze: Store "current" iflags in insn_start")
Tested-by: Thomas Huth <thuth@redhat.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200904190842.2282109-2-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Paolo Bonzini cc9962d8ea tests/qtest: do not list ahci-test twice
This is caught by "meson test", which complains about two tests with the
same name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200904120342.11370-1-pbonzini@redhat.com>
Fixes: a2ce7dbd91 ("meson: convert tests/qtest to meson")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Daniel P. Berrangé affcc09c2d gitlab: expand test coverage for crypto builds
Most jobs test the latest nettle library. This adds explicit coverage
for latest gcrypt using Fedora, and old gcrypt and nettle using
CentOS-7. The latter does a minimal tools-only build, as we only need to
validate that the crypto code builds and unit tests pass. Finally a job
disabling both nettle and gcrypt is provided to validate that gnutls
still works.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Daniel P. Berrangé 46859d9398 crypto: fix build with gcrypt enabled
If nettle is disabled and gcrypt enabled, the compiler and linker flags
needed for gcrypt are not passed.

Gnutls was also not added as a dependancy when gcrypt is enabled.

Attempting to add the library dependencies at the same time as the
source dependencies is error prone, as there are alot of different
rules for picking which sources to use, and some of the source files
use code level conditionals intead. It is thus clearer to add the
library dependencies separately.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-2-berrange@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth 6bcb5fc0f7 gitlab-ci: Add cross-compiling build tests
Now that we can use all our QEMU test containers in the gitlab-CI, we can
easily add some jobs that test cross-compilation for various architectures.
There is just only small ugliness: Since the shared runners on gitlab.com
are single-threaded, we have to split each compilation job into two parts
(--disable-user and --disable-system), and exclude some additional targets,
to avoid that the jobs are running too long and hitting the timeout of 1 h.

Message-Id: <20200823111757.72002-8-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth 8c2787629e stubs: Move qemu_fd_register stub to util/main-loop.c
The linker of MinGW sometimes runs into the following problem:

libqemuutil.a(util_main-loop.c.obj): In function `qemu_fd_register':
/builds/huth/qemu/build/../util/main-loop.c:331: multiple definition of
 `qemu_fd_register'
libqemuutil.a(stubs_fd-register.c.obj):/builds/huth/qemu/stubs/fd-register.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

qemu_fd_register() is defined in util/main-loop.c for WIN32, so let's simply
move the stub also there in the #else part of the corresponding #ifndef
to fix this problem.

Message-Id: <20200903054503.425435-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth b0476d6602 stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
When cross-compiling with MinGW, there are sometimes some weird linker
errors like:

ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
/builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
 `qemu_notify_event'
libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

It seems like it works better when the qemu_timer_notify_cb() stub (which
calls qemu_notify_event()) is in a separate file - then we can also even
remove the qemu_notify_event() stub now.

This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
Claudio Fontana.

Message-Id: <20200902102433.304737-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth e7a222aeb8 configure: Allow automatic WHPX detection
The whpx variable is currently initialized to "no" which causes the WHPX
check to skip the detection unless the user specified --enable-whpx.
Since the detection code should be able to figure it out correctly, let's
initialized the variable to "" on MinGW-builds for proper auto-detection
instead.

Message-Id: <20200804170055.2851-11-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20200823111757.72002-7-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth d3dd34a1e5 dockerfiles/debian-win64-cross: Download WHPX MinGW headers
To compile-test the WHPX accelerator, we need to download these system
headers first (they are unfortunately not part of any released and
packaged MinGW toolchain yet).

Idea taken from another patch by Stefan Weil.

Message-Id: <20200804170055.2851-12-thuth@redhat.com>
Message-Id: <20200823111757.72002-6-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth ce4e510ac7 tests/Makefile: test-image-locking needs CONFIG_POSIX
test-image-locking.c uses the qemu_lock_fd_test() function which is
only available on POSIX-like systems.

Message-Id: <20200804170055.2851-4-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-Id: <20200823111757.72002-4-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo 0fdc1f2f5e tests: Fixes building test-util-filemonitor.c on msys2/mingw
Fixes the following compiling error:
../tests/test-util-filemonitor.c: In function 'test_file_monitor_events':
../tests/test-util-filemonitor.c:620:17: error: too many arguments to function 'mkdir'
  620 |             if (mkdir(pathsrc, 0700) < 0) {
      |                 ^~~~~
In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:93,
                 from ../tests/test-util-filemonitor.c:21:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |               ^~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905203425.1470-1-luoyonggang@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo 85c93c57f1 tests: fixes test-vmstate.c compile error on msys2
../tests/test-vmstate.c: In function 'int_cmp':
../tests/test-vmstate.c:884:5: error: unknown type name 'uint'; did you mean 'uInt'?
  884 |     uint ua = GPOINTER_TO_UINT(a);
      |     ^~~~
      |     uInt
../tests/test-vmstate.c:885:5: error: unknown type name 'uint'; did you mean 'uInt'?
  885 |     uint ub = GPOINTER_TO_UINT(b);
      |     ^~~~
      |     uInt
make: *** [Makefile.ninja:5461:tests/test-vmstate.exe.p/test-vmstate.c.obj] 错误 1

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905063813.1875-1-luoyonggang@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo fec7bcf16b tests: handling signal on win32 properly
SIGABRT should use signal(SIGABRT, sigabrt_handler) to handle on win32

The error:
E:/CI-Cor-Ready/xemu/qemu.org/tests/test-replication.c:559:33: error: invalid use of undefined type 'struct sigaction'
  559 |     sigact = (struct sigaction) {
      |                                 ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-6-luoyonggang@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-06 20:26:43 +02:00
Alex Bennée 90843750e3 tests/docker: add python3-setuptools the docker images
We need these now for builds to work.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200903112107.27367-4-alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-06 20:26:43 +02:00
Peter Maydell 7c37270b3f ui: memleak fixes.
gtk: refresh interval fix.
 spice: add mouse buttons.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCgAGBQJfUeYnAAoJEEy22O7T6HE4NbkP/1jTXWNh/D9niG4eW2x2Oasc
 /hUtW70sKfRaIvsnrY5avSMS9PmligvuBi0OlqUx1mSmq6bicnKsengvZCmx8kja
 w7yetoaElngm7Ycho9dED0uXi9Czk33Do3UZycxz6WwsacSKnh4SFM11wOjKjm5n
 6XmgobBmDe4DPlmiW84I9yYnpWH3DeMZyCg6lkODT0k0/fIF6h7r8gbwKLznyO9X
 JSVaAPNQ2m4CJYWRvOcIylnyD7e2GnZn+4EGZt7vpmdSvhy0sFSNQQFFd1pvCTig
 pyYtETunq5xaMSrJCuUQoejvaPbuTnlmUh7SjcfPcxe0SZKj9gOFUGRM89Ghn4O2
 f2TYFKVJLXLVpbKzsHPhbX5OBdiC3+kT2b/eHARRmzRH6/74982esrC+bHe3dWkY
 hjfNY/dQ6vWMg09NFmR9SOuZ9yvRRX2znnYb1FE/QQ6qDLaQwryiVhTB654jztEK
 IGhPjh+3Is8iqYp25Ls1CWODu9Hd5AgGFTvc/rQ95rpHqJu3GXRK+4zfzat0eUKi
 Ahx1vraJjjCFIhzetkKHVtdQd4c+f0m96hwcqEUF9rN/o6dQr/rsJ6IruxK1lRPE
 6m8XPKBK6K2jbUdHTrDSHPLcy1iXRukNPS7gdxgJzjl/FG6GXyCfrapJBkpDmWyK
 daB6kvPtKj9s4JBhuOp5
 =7Z4z
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200904-pull-request' into staging

ui: memleak fixes.
gtk: refresh interval fix.
spice: add mouse buttons.

# gpg: Signature made Fri 04 Sep 2020 08:00:55 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20200904-pull-request:
  ui/gtk: Update refresh interval after widget is realized
  ui: Add more mouse buttons to SPICE
  vnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string
  ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-06 16:23:55 +01:00
Filip Bozuta 5d5d17522f linux-user: Protect btrfs ioctl target definitions
Target definitions of btrfs ioctls in 'syscall_defs.h' use
the value BTRFS_IOCTL_MAGIC that is defined header 'btrfs.h'.
This header is not available in kernel versions before 3.9.
For that reason, these target ioctl definitions should be
enwrapped in an #ifdef directive to check whether the 'btrfs.h'
header is available as to not cause build errors on older
Linux systems.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200905163802.2666-1-Filip.Bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:19 +02:00
Laurent Vivier 4d6e318af0 linux-user: fix ppc/termbits.h
On ppc, in termios, c_line is after c_cc, not before .

Fixes: c218b4ede4 ("linux-user: Add missing termbits types and values definitions")
Cc: Filip.Bozuta@syrmia.com
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200830181620.422036-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:19 +02:00
Timothy Baldwin a7b4c9b1b4 linux-user: Map signal numbers in fcntl
Map signal numbers in fcntl F_SETSIG and F_GETSIG.

Signed-off-by: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <72cc725c-f344-b7f1-d559-401867067d80@members.leeds.ac.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:16 +02:00