aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-03-01tests/docker: add zstdtools to the imagesAlex Bennée19-16/+34
We need this to be able to run the tuxrun_baseline tests in CI which in turn helps us reduce overhead running other tests. We need to update libvirt-ci and refresh the generated files by running 'make lcitool-refresh' to get the new mapping. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-24-alex.bennee@linaro.org>
2023-03-01gitlab: move the majority of artefact handling to a templateAlex Bennée2-51/+46
To avoid lots of copy and paste lets deal with artefacts in a template. This way we can filter out most of the pre-binary object and library files we no longer need as we have the final binaries. build-system-alpine also saved .git-submodule-status so for simplicity we bring that into the template as well. As an example the build-system-ubuntu artefacts before this patch where around 1.3 GB, after dropping the object files it comes to 970 MB. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-23-alex.bennee@linaro.org>
2023-03-01tests/docker: use direct RUNC call to run test jobsAlex Bennée1-2/+3
If we build them without the script we can certainly run them without it. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-22-alex.bennee@linaro.org>
2023-03-01tests/docker: use direct RUNC call to build containersAlex Bennée1-9/+14
We don't really need stuff from docker.py to do the build as we have everything we need with a direct call. We do rely on the dockerfiles being able to tweak the UID/name mapping as the last step. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-21-alex.bennee@linaro.org>
2023-03-01tests/docker: add USER stanzas to non-lci imagesAlex Bennée20-1/+100
These are flat but not generated by lcitool so we need to manually update them with the `useradd` stanza. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-20-alex.bennee@linaro.org>
2023-03-01tests/lcitool: append user setting stanza to dockerfilesAlex Bennée18-0/+100
For the cross-compilation use-case it is important to add the host user to the dockerfile so we can map them to the docker environment when cross-building files. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230228190653.1602033-19-alex.bennee@linaro.org>
2023-03-01configure: expose the direct container commandAlex Bennée1-0/+3
In the process of migrating away from using docker.py to build our containers we need to expose the command to the build environment. The script is still a useful way to probe which command works though. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-18-alex.bennee@linaro.org>
2023-03-01tests: Ensure TAP version is printed before other messagesRichard W.M. Jones2-3/+4
These two tests were failing with this error: stderr: TAP parsing error: version number must be on the first line [...] Unknown TAP version. The first line MUST be `TAP version <int>`. Assuming version 12. This can be fixed by ensuring we always call g_test_init first in the body of main. Thanks: Daniel Berrange, for diagnosing the problem Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alexander Bulekov <alxndr@bu.edu> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Message-Id: <20230227174019.1164205-1-rjones@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230228190653.1602033-17-alex.bennee@linaro.org>
2023-03-01gitlab: Use plain docker in container-template.ymlFabiano Rosas1-5/+4
Our dockerfiles no longer reference layers from other qemu images so we can now use 'docker build' on them. Also reinstate the caching that was disabled due to bad interactions with certain runners. See commit 6ddc3dc7a8 ("tests/docker: don't use BUILDKIT in GitLab either"). We now believe those issues to be fixed. The COMMON_TAG needed to be fixed for the caching to work. The docker.py script was not using the variable, but constructing the correct URL directly. Signed-off-by: Fabiano Rosas <farosas@suse.de> Tested-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230227151110.31455-2-farosas@suse.de> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-16-alex.bennee@linaro.org>
2023-03-01tests/dockerfiles: unify debian-toolchain referencesAlex Bennée1-2/+2
We use the debian release number elsewhere so fix it for consistency along with the broken comment. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230228190653.1602033-15-alex.bennee@linaro.org>
2023-03-01cirrus.yml: Improve the windows_msys2_taskThomas Huth1-3/+5
There's no need to run a full-blown bash just to create a directory. And we can skip the "cd build" each time by doing it once at the beginning. Additionally, let's exclude some targets (that we already compile-test with MinGW in the gitlab jobs) from the build, since the build time of this task is very long already (between 80 and 90 minutes). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208103046.618154-1-thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-14-alex.bennee@linaro.org>
2023-03-01tests: ensure we export job results for some cross buildsAlex Bennée2-3/+20
We do run tests on some cross builds. Provide a template to ensure we export the testlog to the build artefacts and report the test results via the junit. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reported-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230228190653.1602033-13-alex.bennee@linaro.org>
2023-03-01tests/docker: Use binaries for debian-tricore-crossBastian Koppelmann3-11/+7
since binutils is pretty old, it fails our CI repeatedly during the compilation of tricore-binutils. We created a precompiled version using the debian docker image and download it instead of building it ourself. We also updated the package to include a newer version of binutils, gcc, and newlib. The default TriCore ISA version used by tricore-as changed from the old version, so we have to specify it now. If we don't 'test_fadd' fails with 'unknown opcode'. The new assembler also picks a new encoding in ld.h which fails the 'test_ld_h' test. We fix that by using the newest TriCore CPU for QEMU. The old assembler accepted an extra ')' in 'test_imask'. The new one does not, so lets remove it. Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Message-Id: <20230209145812.46730-1-kbastian@mail.uni-paderborn.de> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-12-alex.bennee@linaro.org>
2023-03-01tests: add tuxrun baseline test to avocadoAlex Bennée2-0/+424
The TuxRun project (www.tuxrun.org) uses QEMU to run tests on a wide variety of kernel configurations on wide range of our emulated platforms. They publish a known good set of images at: https://storage.tuxboot.com/ to help with bisecting regressions in either the kernel, firmware or QEMU itself. The tests are pretty lightweight as they contain just a kernel with a minimal rootfs which boots a lot faster than most of the distros. In time they might be persuaded to version their known good baselines and we can then enable proper checksums. For a couple of tests we currently skip: - mips64, a regression against previous stable release - sh4, very unstable with intermittent oops Total run time: 340s (default) -> 890s (debug) Overall coverage rate (tested targets + disabled tests): lines......: 16.1% (126894 of 789848 lines) functions..: 20.6% (15954 of 77489 functions) branches...: 9.3% (40727 of 439365 branches) Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Anders Roxell <anders.roxell@linaro.org> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-11-alex.bennee@linaro.org>
2023-03-01tests: skip the nios2 replay_kernel testAlex Bennée1-0/+1
It is buggy and keeps failing. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-10-alex.bennee@linaro.org>
2023-03-01testing: update ubuntu2004 to ubuntu2204Alex Bennée7-26/+163
The 22.04 LTS release has been out for almost a year now so its time to update all the remaining images to the current LTS. We can also drop some hacks we need for older clang TSAN support. We will keep the ubuntu2004 container around for those who wish to test builds on the currently still supported baseline. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230228190653.1602033-9-alex.bennee@linaro.org>
2023-03-01tests: don't run benchmarks for the tsan buildAlex Bennée1-1/+0
All we are really doing here is checking that TSAN builds compile and are therefor a tool available to developers. The benchmarks are not representative of QEMU's actual threading behaviour and they burn precious CI time. Indeed switching to check-unit reveals many unaddressed issues which have been logged at: https://gitlab.com/qemu-project/qemu/-/issues/1496 So for now disable the make check and make this a build only test. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230228190653.1602033-8-alex.bennee@linaro.org>
2023-03-01gitlab: extend custom runners with base_job_templateAlex Bennée4-12/+13
The base job template is responsible for controlling how we kick off testing on our various branches. Rename and extend the custom_runner_template so we can take advantage of all that control. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230228190653.1602033-7-alex.bennee@linaro.org>
2023-03-01gitlab-ci: Use artifacts instead of dumping logs in the Cirrus-CI jobsThomas Huth1-2/+5
The meson log files can get very big, especially if running the tests in verbose mode. So dumping those logs to the console was a bad idea, since gitlab truncates the output if it is getting too big. Let's publish the logs as artifacts instead. This has the disadvantage that you have to look up the logs on cirrus-ci.com now instead, but that's still better than not having the important part of the log at all since it got truncated. Fixes: 998f334722 ("gitlab: show testlog.txt contents ...") Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230215142503.90660-1-thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230228190653.1602033-6-alex.bennee@linaro.org>
2023-03-01tests: make fp-test less chatty when running from test suiteAlex Bennée3-6/+15
As we like to run tests under CI with V=1 flags the softfloat tests can add up to a fair amount of extra log lines. With an update to the testfloat library we can now call fp-test with the -q flag and reduce the output to a terse one line per function tested. make check-softfloat V=1 | wc -l 759 Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230228190653.1602033-5-alex.bennee@linaro.org>
2023-03-01tests: be a bit more strict cleaning up fifosAlex Bennée1-1/+5
When we re-factored we dropped the unlink() step which turns out to be required for rmdir to do its thing. If we had been checking the return value we would have noticed so lets do that with this fix. Fixes: 68406d1085 (tests/unit: cleanups for test-io-channel-command) Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230228190653.1602033-4-alex.bennee@linaro.org>
2023-03-01tests: add socat dependency for testsAlex Bennée20-3/+20
We only use it for test-io-channel-command at the moment. Unfortunately bringing socat into CI exposed an existing bug in the test-io-channel-command unit test so we disabled it for MacOS in the previous patch. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230228190653.1602033-3-alex.bennee@linaro.org>
2023-03-01tests: don't run socat tests on MacOS as wellAlex Bennée1-2/+2
In preparation for the next patch when we enable socat for our CI images we need to disable this part of the test for MacOS. The bug has been raised here: https://gitlab.com/qemu-project/qemu/-/issues/1495 Once that is fixed we should re-enable the test. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230228190653.1602033-2-alex.bennee@linaro.org>
2023-02-28Merge tag 'buildsys-qom-qdev-ui-20230227' of https://github.com/philmd/qemu ↵Peter Maydell173-1966/+2183
into staging - buildsys - Various header cleaned up (removing pointless headers) - Mark various files/code user/system specific - Make various objects target-independent - Remove tswapN() calls from dump.o - Suggest g_assert_not_reached() instead of assert(0) - qdev / qom - Replace various container_of() by QOM cast macros - Declare some QOM macros using OBJECT_DECLARE_TYPE() - Embed OHCI QOM child in SM501 chipset - hw (ISA & IDE) - add some documentation, improve function names - un-inline, open-code few functions - have ISA API accessing IRQ/DMA prefer ISABus over ISADevice - Demote IDE subsystem maintenance to "Odd Fixes" - ui: Improve Ctrl+Alt hint on Darwin Cocoa # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmP9IeAACgkQ4+MsLN6t # wN7bdQ//SxJYJuQvqTT6s+O0LmP6NbqvhxCXX7YAwK2jCTM+zTgcqqRZCcisLQol # 3ENu2UhnZmiLKHSOxatOVozbws08/u8Vl+WkW4UTMUb1yo5KPaPtq808Y95RdAJB # 7D7B5juDGnFRAHXZz38zVk9uIuEkm+Po/pD0JQa+upBtAAgOJTqGavDNSR5+T0Yl # VjGdwK0b10skPqiF6OABYoy/4IFHVJJFIbARZh+a7hrF0llsbzUts5JiYsOxEEHQ # t3woUItdMnS1m0+Ty4AQ8m0Yv9y4HZOIzixvsZ+vChj5ariwUhL9/7wC/s/UCYEg # gKVA5X8R6n/ME6DScK99a+CyR/MXkz70b/rOUZxoutXhV3xdh4X1stL4WN9W/m3z # D4i4ZrUsDUcKCGWlj49of/dKbOPwk1+e/mT0oDZD6JzG0ODjfdVxvJ/JEV2iHgS3 # WqHuSKzX/20H9j7/MgfbQ0HjBFOQ8tl781vQzhD+y+cF/IiTsHhrE6esIWho4bob # kfSdVydUWWRnBsnyGoRZXoEMX9tn+pu0nKxEDm2Bo2+jajsa0aZZPokgjxaz4MnD # Hx+/p1E+8IuOn05JgzQSgTJmKFdSbya203tXIsTo1kL2aJTJ6QfMvgEPP/fkn+lS # oQyVBFZmb1JDdTM1MxOncnlWLg74rp/CWEc+u5pSdbxMO/M/uac= # =AV/+ # -----END PGP SIGNATURE----- # gpg: Signature made Mon 27 Feb 2023 21:34:24 GMT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'buildsys-qom-qdev-ui-20230227' of https://github.com/philmd/qemu: (125 commits) ui/cocoa: user friendly characters for release mouse dump: Add create_win_dump() stub for non-x86 targets dump: Simplify compiling win_dump.o by introducing win_dump_available() dump: Clean included headers dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size() dump: Replace tswapN() -> cpu_to_dumpN() hw/ide/pci: Add PCIIDEState::isa_irq[] hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVS hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per bus hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msg hw/ide/piix: Remove unused includes hw/ide/pci: Unexport bmdma_active_if() hw/ide/ioport: Remove unnecessary includes hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h' hw/ide: Rename idebus_active_if() -> ide_bus_active_if() hw/ide: Rename ide_init2() -> ide_bus_init_output_irq() hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cb hw/ide: Rename ide_create_drive() -> ide_bus_create_drive() hw/ide: Rename ide_set_irq() -> ide_bus_set_irq() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-27ui/cocoa: user friendly characters for release mouseChristian Schoenebeck1-2/+5
While mouse is grabbed, window title contains a hint for the user what keyboard keys to press to release the mouse. Make that hint text a bit more user friendly for a Mac user: - Replace "Ctrl" and "Alt" by appropriate symbols for those keyboard keys typically displayed for them on a Mac (encode those symbols by using UTF-8 characters). - Drop " + " in between the keys, as that's not common on macOS for documenting keyboard shortcuts. - Convert lower case "g" to upper case "G", as that's common on macOS. - Add one additional space at start and end of key stroke set, to visually separate the key strokes from the rest of the text. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <E1pAClj-0003Jo-OB@lizzy.crudebyte.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27dump: Add create_win_dump() stub for non-x86 targetsPhilippe Mathieu-Daudé3-5/+6
Implement the non-x86 create_win_dump(). We can remove the last TARGET_X86_64 #ifdef'ry in dump.c, which thus becomes target-independent. Update meson accordingly. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-6-philmd@linaro.org>
2023-02-27dump: Simplify compiling win_dump.o by introducing win_dump_available()Philippe Mathieu-Daudé4-12/+27
To make dump.c less target dependent, move the TARGET_X86_64 #ifdef'ry from dump.c to win_dump.c (introducing a win_dump_available() method there). By doing so we can build win_dump.c on any target, and simplify the meson rule. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-5-philmd@linaro.org>
2023-02-27dump: Clean included headersPhilippe Mathieu-Daudé4-16/+9
"qemu/win_dump_defs.h" is only required by win_dump.c, but win_dump.h requires "sysemu/dump.h" which declares the DumpState type. Remove various unused headers. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-4-philmd@linaro.org>
2023-02-27dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size()Philippe Mathieu-Daudé1-1/+2
TARGET_PAGE_SIZE is target specific. In preparation of making dump.c target-agnostic, replace the compile-time TARGET_PAGE_SIZE definition by runtime qemu_target_page_size(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-3-philmd@linaro.org>
2023-02-27dump: Replace tswapN() -> cpu_to_dumpN()Philippe Mathieu-Daudé1-4/+4
All uses of tswap in that file are wrong, and should be using cpu_to_dumpN, which correctly tests the endianness of the output. Reported-by: Richard Henderson <richard.henderson@linaro.org> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-2-philmd@linaro.org>
2023-02-27hw/ide/pci: Add PCIIDEState::isa_irq[]Bernhard Beschow1-0/+1
These legacy ISA IRQs allow the PIIX IDE functions to be wired up in their south bridges and the VIA IDE functions to disuse PCI_INTERRUPT_LINE as outlined in https://lists.nongnu.org/archive/html/qemu-devel/2020-03/msg01707.html Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230126211740.66874-7-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVSPhilippe Mathieu-Daudé1-6/+6
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20210511041848.2743312-5-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per busPhilippe Mathieu-Daudé1-20/+19
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-21-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msgPhilippe Mathieu-Daudé1-8/+7
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-20-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/piix: Remove unused includesPhilippe Mathieu-Daudé1-6/+1
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-19-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide/pci: Unexport bmdma_active_if()Bernhard Beschow2-6/+6
The function is only used inside ide/pci.c, so doesn't need to be exported. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-18-philmd@linaro.org>
2023-02-27hw/ide/ioport: Remove unnecessary includesPhilippe Mathieu-Daudé1-10/+0
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-17-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h'Philippe Mathieu-Daudé3-5/+6
ide_get_geometry() and ide_get_bios_chs_trans() are only used by the TYPE_PC_MACHINE. "hw/ide.h" is a mixed bag of lost IDE declarations. In order to remove this (almost) pointless header soon, move these declarations to "hw/ide/internal.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230220091358.17038-18-philmd@linaro.org>
2023-02-27hw/ide: Rename idebus_active_if() -> ide_bus_active_if()Philippe Mathieu-Daudé5-17/+17
idebus_active_if() operates on a IDEBus; rename it as ide_bus_active_if() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/idebus_active_if/ide_bus_active_if/g' \ $(git grep -l idebus_active_if) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-16-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_init2() -> ide_bus_init_output_irq()Philippe Mathieu-Daudé11-13/+14
ide_init2() initializes a IDEBus, and set its output IRQ. To emphasize this, rename it as ide_bus_init_output_irq(). Mechanical change using: $ sed -i -e 's/ide_init2/ide_bus_init_output_irq/g' \ $(git grep -l ide_init2) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-15-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd()Philippe Mathieu-Daudé4-6/+6
ide_exec_cmd() operates on a IDEBus; rename it as ide_bus_exec_cmd() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_exec_cmd/ide_bus_exec_cmd/g' \ $(git grep -wl ide_exec_cmd) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-14-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cbPhilippe Mathieu-Daudé8-8/+8
ide_register_restart_cb() operates on a IDEBus; rename it as ide_bus_register_restart_cb() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_register_restart_cb/ide_bus_register_restart_cb/g' \ $(git grep -l ide_register_restart_cb) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-13-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_create_drive() -> ide_bus_create_drive()Philippe Mathieu-Daudé9-11/+11
ide_create_drive() operates on a IDEBus; rename it as ide_bus_create_drive() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_create_drive/ide_bus_create_drive/g' \ $(git grep -wl ide_create_drive) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-12-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Rename ide_set_irq() -> ide_bus_set_irq()Philippe Mathieu-Daudé4-30/+30
ide_set_irq() operates on a IDEBus; rename it as ide_bus_set_irq() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/ide_set_irq/ide_bus_set_irq/g' \ $(git grep -l ide_set_irq) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-11-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Un-inline ide_set_irq()Philippe Mathieu-Daudé9-8/+16
Only include "hw/irq.h" where appropriate. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-10-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-27hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h'Philippe Mathieu-Daudé1-1/+1
The IDEBus structure has PortioList fields, so we need its declarations from "exec/ioport.h". "hw/isa/isa.h" is not required. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-9-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2023-02-27hw/ide: Remove unused 'qapi/qapi-types-run-state.h'Philippe Mathieu-Daudé1-1/+0
Missed in commit d7458e7754 ("hw/ide/internal: Remove unused DMARestartFunc typedef") which removed the single use of RunState. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-8-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2023-02-27hw/ide/atapi: Restrict 'scsi/constants.h' inclusionPhilippe Mathieu-Daudé2-1/+1
Only atapi.c requires the SCSI constants. No need to include it in all files including "hw/ide/internal.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-7-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2023-02-27hw/ide/isa: Remove intermediate ISAIDEState::irq variablePhilippe Mathieu-Daudé1-3/+1
The intermediate ISAIDEState::irq variable just add noise, remove it. Message-Id: <20230215112712.23110-6-philmd@linaro.org> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-02-27hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h'Philippe Mathieu-Daudé4-13/+27
"hw/ide.h" is a mixed bag of lost IDE declarations. Extract isa_ide_init() and the TYPE_ISA_IDE QOM declarations to a new "hw/ide/isa.h" header. Rename ISAIDEState::isairq as 'irqnum' to emphasize this is not a qemu_irq object but the number (index) of an ISA IRQ. Message-Id: <20230215112712.23110-5-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>