aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-11-25Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into stagingPeter Maydell
Block layer patches - Fix qmp_device_add() to not throw non-scalar options away (fixes iothread-vq-mapping being silently ignored in device_add) - Fix qdev property crash with integer PCI addresses and JSON -device - iotests: Fix mypy failure - parallels: Avoid potential integer overflow - ssh: libssh broke with non-blocking sessions, use a blocking one for now - Fix crash in migration_is_running() # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmdES74RHGt3b2xmQHJl # ZGhhdC5jb20ACgkQfwmycsiPL9abFQ//fGmBl3Jp99GWB1R0y49/hPhfj0166UGj # zeEmhdy+k6gKywyhVy0Fj0xLztDTb/2bGflrwtDDxYA0PBLel461QSeJUzwDsn9h # ZGLyFrosXgIPADP55RF1wJ6c+m13MX4jVy80Neh2jemhinMazjj3ADb4RdCf0B4M # XoYOy96goDFPlzZNvr08dlaDvJaD5QmPYX8nK7TaZqZOSYvdSRWMuB+QQCPj+qEf # UfpBo3beNsxedNu/1wKS1Nc6FVX7VHKoMzhDLAvxkYMBKcCg9l5lEAGrgp61O+79 # nYZmPtEG5RHsMNBCZtk8zZMIHPg2Ydxpj3jOV3eA0rF4Twk/fPrOOfBEUHT6PapX # tCS1UJtgyQA2GTULiax3vKV4yBSpmUzbhjddNwBkW7uG1md67d17nqbjkEhHVxZL # yMuauFRCx5onzE0TSgTYEMAmAgD9oawuGUqBiNCOqJlTbGZwJ9l7jtwP4Bl1gskk # pWzL/PLP8MkVf50dcP0QBPNHn85/oZOwv5yNr2Z893qNQhh/0xqCEFwqSq2SJOkg # vKd/bAusgmicoh1XD0o0+mv2ewZor/JghrU83YDPKWM1MmOwePZ8wRTx9pJtZWvq # Pnc71397zppHIw7aIWKYDoyQ3aeaoTM/oY2Q5Y7et6c/FvGW5JtFjsPCGbgm9mw+ # +6JA51ujtYU= # =oLdE # -----END PGP SIGNATURE----- # gpg: Signature made Mon 25 Nov 2024 10:04:46 GMT # gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6 # gpg: issuer "kwolf@redhat.com" # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * tag 'for-upstream' of https://repo.or.cz/qemu/kevin: ssh: Do not switch session to non-blocking mode vl: use qmp_device_add() in qemu_create_cli_devices() qdev-monitor: avoid QemuOpts in QMP device_add tests/avocado/hotplug_blk: Fix addr in device_add command qdev: Fix set_pci_devfn() to visit option only once python: silence pylint raising-non-exception error python: disable too-many-positional-arguments warning iotests: correct resultclass type in ReproducibleTestRunner iotests: reflow ReproducibleTestRunner arguments parallels: fix possible int overflow Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-11-25Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into stagingPeter Maydell
# -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEIV1G9IJGaJ7HfzVi7wSWWzmNYhEFAmdEEtgACgkQ7wSWWzmN # YhH5qAgAlKdcx/gFt4EBXtjVq/qbPluEGOQxvcRYLlN90rPLHPgCjAoT5ly3fIv1 # 4kCgcVZyG8SdGu1n0TzTTS9kg5tL7weQ9xEWwF0oyyuZABgAB7w/wpC8MHSkJFOn # 2Tv+2Iab0dJ+e1pw71OMpE/YR5X2xq5vopsSHRtnyGWfRPGswJFwka+f8FS5DSiq # 2CeNxADgTkPxJgDmOrNSsAPz8Rns77FAZdvDMqFjx1Lrqm8kPv9jzwOMO+a/2LpC # t6OkpFzGjiiskPjSnSn/tzo4TfWYoABjJaI7b3vEqmNEJSTAaxltZNtSXZucctEt # 1ihnFdjr/wPwGK/5Wu+qGnfDbFNxBw== # =W4y1 # -----END PGP SIGNATURE----- # gpg: Signature made Mon 25 Nov 2024 06:02:00 GMT # gpg: using RSA key 215D46F48246689EC77F3562EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * tag 'net-pull-request' of https://github.com/jasowang/qemu: virtio-net: Copy received header to buffer virtio-net: Initialize hash reporting values virtio-net: Fix hash reporting when the queue changes virtio-net: Do not check for the queue before RSS virtio-net: Fix size check in dhclient workaround net: checksum: Convert data to void * Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-11-25tests/functional: Remove sleep workarounds from Aspeed testsCédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected "login:" string or the command prompt now. Drop the last use of exec_command. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-4-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25tests/functional: Convert Aspeed arm SDK testsCédric Le Goater
Drop the SSH connection which was introduced in the avocado tests to workaround read issues when interacting with console. EXTRA_BOOTARGS was introduced to reduce the console output at Linux boot time. This didn't have the desired effect as we still had issues when trying to match patterns on the console and we had to use the ssh connection as a workaround. While at it, remove the U-Boot EXTRA_BOOTARGS variable which has become useless. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-3-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25tests/functional: Convert Aspeed aarch64 SDK testsCédric Le Goater
Drop the SSH connection which was introduced in the avocado tests to workaround read issues when interacting with console. Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241122090322.1934697-2-clg@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2024-11-25docs: explicitly permit a "commonly known identity" with SoBDaniel P. Berrangé
The docs for submitting a patch describe using your "Real Name" with the Signed-off-by line. Although somewhat ambiguous, this has often been interpreted to mean someone's legal name. In recent times, there's been a general push back[1] against the notion that use of Signed-off-by in a project automatically requires / implies the use of legal ("real") names and greater awareness of the downsides. Full discussion of the problems of such policies is beyond the scope of this commit message, but at a high level they are liable to marginalize, disadvantage, and potentially result in harm, to contributors. TL;DR: there are compelling reasons for a person to choose distinct identities in different contexts & a decision to override that choice should not be taken lightly. A number of key projects have responded to the issues raised by making it clear that a contributor is free to determine the identity used in SoB lines: * Linux has clarified[2] that they merely expect use of the contributor's "known identity", removing the previous explicit rejection of pseudonyms. * CNCF has clarified[3] that the real name is simply the identity the contributor chooses to use in the context of the community and does not have to be a legal name, nor birth name, nor appear on any government ID. Since we have no intention of ever routinely checking any form of ID documents for contributors[4], realistically we have no way of knowing anything about the name they are using, except through chance, or through the contributor volunteering the information. IOW, we almost certainly already have people using pseudonyms for contributions. This proposes to accept that reality and eliminate unnecessary friction, by following Linux & the CNCF in merely asking that a contributors' commonly known identity, of their choosing, be used with the SoB line. [1] Raised in many contexts at many times, but a decent overall summary can be read at https://drewdevault.com/2023/10/31/On-real-names.html [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330 [3] https://github.com/cncf/foundation/blob/659fd32c86dc/dco-guidelines.md [4] Excluding the rare GPG key signing parties for regular maintainers Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20241021190939.1482466-1-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-40-alex.bennee@linaro.org>
2024-11-25rust/pl011: Fix range checks for device ID accessesJunjie Mao
The peripheral and PrimeCell identification registers of pl011 are located at offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C implementation checks if the offset-shifted-by-2 (not the offset itself) is in the range 0x3F8 - 0x3FF. Use the same check in the Rust implementation. This fixes the timeout of the following avocado tests: * tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_virt * tests/avocado/replay_kernel.py:ReplayKernelNormal.test_arm_virt * tests/avocado/replay_kernel.py:ReplayKernelNormal.test_arm_vexpressa9 Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Junjie Mao <junjie.mao@hotmail.com> Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <SY0P300MB102644C4AC34A3AAD75DC4D5955C2@SY0P300MB1026.AUSP300.PROD.OUTLOOK.COM> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-39-alex.bennee@linaro.org>
2024-11-25plugins: eradicate qemu-plugins.symbols static filePierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20241112212622.3590693-4-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-38-alex.bennee@linaro.org>
2024-11-25plugins: detect qemu plugin API symbols from headerPierrick Bouvier
Instead of using a static file (error prone and hard to keep in sync), we generate it using a script. Note: if a symbol is not exported, we'll now notice it when linking for Windows/MacOS platforms. Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20241112212622.3590693-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-37-alex.bennee@linaro.org>
2024-11-25plugins: add missing export for qemu_plugin_num_vcpusPierrick Bouvier
Fixes: 4a448b148ca ("plugins: add qemu_plugin_num_vcpus function") Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20241112212622.3590693-2-pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-36-alex.bennee@linaro.org>
2024-11-25tests/functional: update the aarch64 tuxrun testsAlex Bennée
Now there are new up to date images available we should update to them. With the new rootfs the blk I/O errors also go away on arm64be. Cc: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-22-alex.bennee@linaro.org>
2024-11-25tests/functional: Convert the Avocado aarch64 tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-aarch64 in the functional framework. Since these were the last tests in tests/avocado/tuxrun_baselines.py, we can now remove that file, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-20-alex.bennee@linaro.org>
2024-11-25tests/functional: avoid accessing log_filename on earlier failuresDaniel P. Berrangé
If a failure occurs early in the QemuBaseTest constructor, the 'log_filename' object atttribute may not exist yet. This happens most notably if the QEMU_TEST_QEMU_BINARY is not set. We can't initialize 'log_filename' earlier as we use the binary to identify the architecture which is then used to build the path in which the logs are stored. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-19-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-19-alex.bennee@linaro.org>
2024-11-25tests/functional: add a QMP backdoor for debugging stalled testsDaniel P. Berrangé
Support the QEMU_TEST_QMP_BACKDOOR=backdoor.sock env variable as a way to get a QMP backdoor for debugging a stalled QEMU test. Most typically this would be used if running the tests directly: $ QEMU_TEST_QMP_BACKDOOR=backdoor.sock \ QEMU_TEST_QEMU_BINARY=./build/qemu-system-arm \ PYTHONPATH=./python \ ./tests/functional/test_arm_tuxrun.py And then, when the test stalls, in a second shell run: $ ./scripts/qmp/qmp-shell backdoor.sock Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-18-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-18-alex.bennee@linaro.org>
2024-11-25tests/functional: remove time.sleep usage from tuxrun testsDaniel P. Berrangé
The tuxrun tests send a series of strings to the guest to login and then run commands. Since we have been unable to match on console output that isn't followed by a newline, the test used many time.sleep() statements to pretend to synchronize with the guest. This has proved to be unreliable for the aarch64be instance of the tuxrun tests, with the test often hanging. The hang is a very subtle timing problem, and it is suspected that some (otherwise apparently harmless) I/O error messages could be resulting in full FIFO buffers, stalling interaction with the guest. With the newly rewritten console interaction able to match strings that don't have a following newline, the tux run tests can now match directly on the login prompt, and/or shell PS1 prompt. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2689 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-17-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-17-alex.bennee@linaro.org>
2024-11-25tests/functional: rewrite console handling to be bytewiseDaniel P. Berrangé
The console interaction that waits for predicted strings uses readline(), and thus is only capable of waiting for strings that are followed by a newline. This is inconvenient when needing to match on some things, particularly login prompts, or shell prompts, causing tests to use time.sleep(...) instead, which is unreliable. Switch to reading the console 1 byte at a time, comparing against the success/failure messages until we see a match, regardless of whether a newline is encountered. The success/failure comparisons are done with the python bytes type, rather than strings, to avoid the problem of needing to decode partially received multibyte utf8 characters. Heavily inspired by a patch proposed by Cédric, but written again to work in bytes, rather than strings. Co-developed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-16-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-16-alex.bennee@linaro.org>
2024-11-25tests/functional: require non-NULL success_message for console waitDaniel P. Berrangé
When waiting for expected output, the 'success_message' is a mandatory parameter, with 'failure_message' defaulting to None. The code has logic which indicates it was trying to cope with 'success_message' being None and 'failure_message' being non-None but it does not appear able to actually do anything useful. The check for 'success_message is None' will break out of the loop before any check for 'failure_message' has been performed. IOW, for practcal purposes 'success_message' must be non-None unless 'send_string' is set. Assert this expectation and simplify the loop logic. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-15-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-15-alex.bennee@linaro.org>
2024-11-25tests/functional: don't try to wait for the empty stringDaniel P. Berrangé
Telling exec_command_wand_wait_for_pattern to wait for the empty string does not make any conceptual sense, as a check for empty string will always succeed. It makes even less sense when followed by a call to wait_for_console_pattern() with a real match. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-14-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-14-alex.bennee@linaro.org>
2024-11-25tests/functional: logs details of console interaction operationsDaniel P. Berrangé
When functional tests go wrong, it will often be related to the console interaction wait state. By logging the messages that we're looking for, and data we're about to be sending, it'll be easier to diagnose where tests are getting stuck. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-13-berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-13-alex.bennee@linaro.org>
2024-11-25tests/functional: enable debug logging for QEMUMachineDaniel P. Berrangé
Set the 'qemu.machine' logger to 'DEBUG' level, to ensure we see log messages related to the QEMUMachine class. Most importantly this ensures we capture the full QEMU command line args for instances we spawn. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-12-berrange@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20241121165806.476008-12-alex.bennee@linaro.org>
2024-11-25tests/functional: honour requested test VM name in QEMUMachineDaniel P. Berrangé
The functional test case class is going to the trouble of passing around a machine name, but then fails to give this QEMUMachine. As a result, QEMUMachine will create a completely random name. Since log file names match the machine name, this results in log files accumulating over time. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-11-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-11-alex.bennee@linaro.org>
2024-11-25tests/functional: put QEMUMachine logs in testcase log directoryDaniel P. Berrangé
We are not passing the 'log_dir' parameter to QEMUMachine, so the QEMU stdout/err logs are being placed in a temp directory and thus deleted after execution. This makes them inaccessible as gitlab CI artifacts. Pass the testcase log directory path into QEMUMachine to make the logs persistent. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-10-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-10-alex.bennee@linaro.org>
2024-11-25tests/functional: honour self.workdir in ACPI bits testsDaniel P. Berrangé
The ACPI bits test sets up its own private temporary directory into it creates scratch files. This is justified by a suggestion that we need to be able to preserve the scratch files. We have the ability to preserve the scratch dir with our functional harness, so there's no reason to diverge from standard practice in file placement. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-9-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-9-alex.bennee@linaro.org>
2024-11-25tests/functional: remove comments talking about avocadoDaniel P. Berrangé
The first comment is still relevant but should talk about our own test harness instead. The second comment adds no value over reading the code and can be removed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-8-berrange@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-8-alex.bennee@linaro.org>
2024-11-25tests/functional: remove obsolete reference to avocado bugDaniel P. Berrangé
Historical bugs in avocado related to zstd support are not relevant to the code now that it uses QEMU's native test harness. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-7-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-7-alex.bennee@linaro.org>
2024-11-25tests/functional: remove leftover :avocado: tagsDaniel P. Berrangé
These tags are not honoured under the new functional test harness. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-6-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-6-alex.bennee@linaro.org>
2024-11-25tests/functional: remove todo wrt avocado.utils.wait_forDaniel P. Berrangé
We're not using avocado anymore, so while the TODO item is still relevant, suggesting use of avocado.utils is not. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-5-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-5-alex.bennee@linaro.org>
2024-11-25tests/functional: remove "AVOCADO" from env variable nameDaniel P. Berrangé
This env variable is a debugging flag to save screendumps in the mips64el malta tests. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-4-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-4-alex.bennee@linaro.org>
2024-11-25tests/functional: automatically clean up scratch files after testsDaniel P. Berrangé
The build/tests/functional subdirectories are consuming huge amounts of disk space. Split the location for scratch files into a 'scratch' sub-directory, separate from log files, and delete it upon completion of each test. The new env variable QEMU_TEST_KEEP_SCRATCH can be set to preserve this scratch dir for debugging access if required. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-3-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-3-alex.bennee@linaro.org>
2024-11-25tests/functional: fix mips64el test to honour workdirDaniel P. Berrangé
The missing directory separator resulted in the kernel file being created 1 level higher than expected. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20241121154218.1423005-2-berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-2-alex.bennee@linaro.org>
2024-11-25ssh: Do not switch session to non-blocking modeJakub Jelen
The libssh does not handle non-blocking mode in SFTP correctly. The driver code already changes the mode to blocking for the SFTP initialization, but for some reason changes to non-blocking mode. This used to work accidentally until libssh in 0.11 branch merged the patch to avoid infinite looping in case of network errors: https://gitlab.com/libssh/libssh-mirror/-/merge_requests/498 Since then, the ssh driver in qemu fails to read files over SFTP as the first SFTP messages exchanged after switching the session to non-blocking mode return SSH_AGAIN, but that message is lost int the SFTP internals and interpretted as SSH_ERROR, which is returned to the caller: https://gitlab.com/libssh/libssh-mirror/-/issues/280 This is indeed an issue in libssh that we should address in the long term, but it will require more work on the internals. For now, the SFTP is not supported in non-blocking mode. Fixes: https://gitlab.com/libssh/libssh-mirror/-/issues/280 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Message-ID: <20241113125526.2495731-1-rjones@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25vl: use qmp_device_add() in qemu_create_cli_devices()Stefan Hajnoczi
qemu_create_cli_devices() should use qmp_device_add() to match the behavior of the QMP monitor. A comment explained that libvirt changes implementing strict CLI syntax were needed. Peter Krempa <pkrempa@redhat.com> has confirmed that modern libvirt uses the same JSON for -device (CLI) and device_add (QMP). Go ahead and use qmp_device_add(). Cc: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20240827192751.948633-3-stefanha@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25qdev-monitor: avoid QemuOpts in QMP device_addStefan Hajnoczi
The QMP device_add monitor command converts the QDict arguments to QemuOpts and then back again to QDict. This process only supports scalar types. Device properties like virtio-blk-pci's iothread-vq-mapping (an array of objects) are silently dropped by qemu_opts_from_qdict() during the QemuOpts conversion even though QAPI is capable of validating them. As a result, hotplugging virtio-blk-pci devices with the iothread-vq-mapping property does not work as expected (the property is ignored). Get rid of the QemuOpts conversion in qmp_device_add() and call qdev_device_add_from_qdict() with from_json=true. Using the QMP command's QDict arguments directly allows non-scalar properties. The HMP is also adjusted since qmp_device_add()'s now expects properly typed JSON arguments and cannot be used from HMP anymore. Move the code that was previously in qmp_device_add() (with QemuOpts conversion and from_json=false) into hmp_device_add() so that its behavior is unchanged. This patch changes the behavior of QMP device_add but not HMP device_add. QMP clients that sent incorrectly typed device_add QMP commands no longer work. This is a breaking change but clients should be using the correct types already. See the netdev_add QAPIfication in commit db2a380c8457 for similar reasoning and object-add in commit 9151e59a8b6e. Unlike those commits, we continue to rely on 'gen': false for the time being. Markus helped me figure this out and even provided a draft patch. The code ended up very close to what he suggested. Suggested-by: Markus Armbruster <armbru@redhat.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20240827192751.948633-2-stefanha@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25tests/avocado/hotplug_blk: Fix addr in device_add commandKevin Wolf
pci_devfn properties accept both integer and string values, but integer 1 and string '1' have different meanings: The integer value means device 0, function 1 whereas the string value '1' is short for '1.0' and means device 1, function 0. This test wants the string version so that the device actually becomes visible for the guest. device_add hides the problem because it goes through QemuOpts, which turns all properties into strings - this is a QEMU bug that we want to fix, but that cancelled out the bug in this test. Fix the test first so that device_add can be fixed afterwards. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20241122224042.149258-1-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25qdev: Fix set_pci_devfn() to visit option only onceKevin Wolf
pci_devfn properties accept either a string or an integer as input. To implement this, set_pci_devfn() first tries to visit the option as a string, and if that fails, it visits it as an integer instead. While the QemuOpts visitor happens to accept this, it is invalid according to the visitor interface. QObject input visitors run into an assertion failure when this is done. QObject input visitors are used with the JSON syntax version of -device on the command line: $ ./qemu-system-x86_64 -enable-kvm -M q35 -device pcie-pci-bridge,id=pci.1,bus=pcie.0 -blockdev null-co,node-name=disk -device '{ "driver": "virtio-blk-pci", "drive": "disk", "id": "virtio-disk0", "bus": "pci.1", "addr": 1 }' qemu-system-x86_64: ../qapi/qobject-input-visitor.c:143: QObject *qobject_input_try_get_object(QObjectInputVisitor *, const char *, _Bool): Assertion `removed' failed. The proper way to accept both strings and integers is using the alternate mechanism, which tells us the type of the input before it's visited. With this information, we can directly visit it as the right type. This fixes set_pci_devfn() by using the alternate mechanism. Cc: qemu-stable@nongnu.org Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20241119120353.57812-1-kwolf@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25python: silence pylint raising-non-exception errorJohn Snow
As of (at least) pylint 3.3.1, this code trips pylint up into believing we are raising something other than an Exception. We are not: the first two values may indeed be "None", but the last and final value must by definition be a SystemExit exception. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20241101173700.965776-5-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25python: disable too-many-positional-arguments warningJohn Snow
Newest versions of pylint complain about specifically positional arguments in addition to too many in general. We already disable the general case, so silence this new warning too. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20241101173700.965776-4-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25iotests: correct resultclass type in ReproducibleTestRunnerJohn Snow
I have a vague memory that I suggested this base class to Vladimir and said "Maybe someday it will break, and I'll just fix it then." Guess that's today. Fixes various mypy errors in the "make check-tox" python test for at least Python3.8; seemingly requires a fairly modern mypy and/or Python base version to trigger. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20241101173700.965776-3-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25iotests: reflow ReproducibleTestRunner argumentsJohn Snow
Trivial reflow to let the type names breathe. (I need to add a longer type name.) Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20241101173700.965776-2-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25parallels: fix possible int overflowDmitry Frolov
The sum "cluster_index + count" may overflow uint32_t. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov <frolov@swemel.ru> Message-ID: <20241106080521.219255-2-frolov@swemel.ru> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2024-11-25virtio-net: Copy received header to bufferAkihiko Odaki
receive_header() used to cast the const qualifier of the pointer to the received packet away to modify the header. Avoid this by copying the received header to buffer. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-25virtio-net: Initialize hash reporting valuesAkihiko Odaki
The specification says hash_report should be set to VIRTIO_NET_HASH_REPORT_NONE if VIRTIO_NET_F_HASH_REPORT is negotiated but not configured with VIRTIO_NET_CTRL_MQ_RSS_CONFIG. However, virtio_net_receive_rcu() instead wrote out the content of the extra_hdr variable, which is not uninitialized in such a case. Fix this by zeroing the extra_hdr. Fixes: e22f0603fb2f ("virtio-net: reference implementation of hash report") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-25virtio-net: Fix hash reporting when the queue changesAkihiko Odaki
virtio_net_process_rss() fills the values used for hash reporting, but the values used to be thrown away with a recursive function call if the queue changes after RSS. Avoid the function call to keep the values. Fixes: a4c960eedcd2 ("virtio-net: Do not write hashes to peer buffer") Buglink: https://issues.redhat.com/browse/RHEL-59572 Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-25virtio-net: Do not check for the queue before RSSAkihiko Odaki
virtio_net_can_receive() checks if the queue is ready, but RSS will change the queue to use so, strictly speaking, we may still be able to receive the packet even if the queue initially provided is not ready. Perform RSS before virtio_net_can_receive() to cover such a case. Fixes: 4474e37a5b3a ("virtio-net: implement RX RSS processing") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-25virtio-net: Fix size check in dhclient workaroundAkihiko Odaki
work_around_broken_dhclient() accesses IP and UDP headers to detect relevant packets and to calculate checksums, but it didn't check if the packet has size sufficient to accommodate them, causing out-of-bound access hazards. Fix this by correcting the size requirement. Fixes: 1d41b0c1ec66 ("Work around dhclient brokenness") Cc: qemu-stable@nongnu.org Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-25net: checksum: Convert data to void *Akihiko Odaki
Convert the data parameter of net_checksum_calculate() to void * to save unnecessary casts for callers. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-11-24Merge tag 'pull-lu-20241122' of https://gitlab.com/rth7680/qemu into stagingPeter Maydell
linux-user: Fix strace output for s390x mmap() linux-user: Print tid not pid with strace # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmdA59IdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+YfAf9E41MJqZhhtWIHJW7 # z+mDw3Yr4Lgvmu2q3PmvOfM9YfvT3HFCh4gQRDaZbd3zy3c73S1/xSwBF2MQhElf # Ml5mEUXtZGrK6Z/hq0QfS2mOGdwsydy+OpEtaw7YhVCMxMapnMi8rvSKe5XRpy/2 # vragLVvJxISS6TnnJ/5RcnmajRLzgGIj7Ej4lbCyViOKhDPXMCr77+jOPHSxUt4R # PQMPzUPJG8Y7j+YR4fQng6700XaqIu8hcn7o0RSghdWEvF+fPaJZDlF32V+yD2Jj # sAvtRsiwLM54rycMJUrQ274IYPIhxyxlgWT0mIIb9fXYdYTHcpZ+ggQ/mSKg+8QQ # 9tmsRg== # =pR93 # -----END PGP SIGNATURE----- # gpg: Signature made Fri 22 Nov 2024 20:21:38 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * tag 'pull-lu-20241122' of https://gitlab.com/rth7680/qemu: linux-user: Fix strace output for s390x mmap() linux-user: Print tid not pid with strace Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-11-22linux-user: Fix strace output for s390x mmap()Ilya Leoshkevich
print_mmap() assumes that mmap() receives arguments via memory if mmap2() is present. s390x (as opposed to s390) does not fit this pattern: it does not have mmap2(), but mmap() still receives arguments via memory. Fix by sharing the detection logic between syscall.c and strace.c. Cc: qemu-stable@nongnu.org Fixes: d971040c2d16 ("linux-user: Fix strace output for old_mmap") Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-ID: <20241120212717.246186-1-iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2024-11-22linux-user: Print tid not pid with straceJ. Neuschäfer
This aligns with strace, and is very useful when tracing multi-threaded programs. The result is the same in single-threaded programs. Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net> Message-Id: 20241024-strace-v1-1-56c4161431cd@gmx.net [rth: Use TaskState.ts_tid via get_task_state()] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2024-11-20Update version for v9.2.0-rc1 releasev9.2.0-rc1Peter Maydell
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>