aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqos
AgeCommit message (Collapse)Author
2023-03-10igb: Introduce qtest for igb deviceAkihiko Odaki
This change is derived from qtest for e1000e device. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Acked-by: Thomas Huth <thuth@redhat.com> [Jason: make qtest work for win32 (only hotplug)] Signed-off-by: Jason Wang <jasowang@redhat.com>
2023-03-10tests/qtest/libqos/e1000e: Export macreg functionsAkihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2023-03-10tests/qtest/e1000e-test: Fabricate ethernet headerAkihiko Odaki
e1000e understands ethernet header so fabricate something convincing. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2023-01-18tests/qtest/libqos/e1000e: Remove duplicate register definitionsAkihiko Odaki
The register definitions in tests/qtest/libqos/e1000e.h had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230114035919.35251-20-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-01-18tests/qtest/e1000e-test: Fix the code styleAkihiko Odaki
igb implementation first starts off by copying e1000e code. Correct the code style before that. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230114035919.35251-19-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-01-11tests: add G_GNUC_PRINTF for various functionsDaniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221219130205.687815-6-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-12-15tests/qtest/libqos/e1000e: Correctly group register accessesAkihiko Odaki
Add a newline after E1000_TCTL write and make it clear that E1000_TCTL write is what enabling transmit. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221110114549.66081-1-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-12-15tests/qtest/libqos/e1000e: Remove "other" interruptsAkihiko Odaki
The "other" kind of interrupts are not used in the tests. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221110114045.65544-1-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-12-01tests/qtests: override "force-legacy" for gpio virtio-mmio testsAlex Bennée
The GPIO device is a VIRTIO_F_VERSION_1 devices but running with a legacy MMIO interface we miss out that feature bit causing confusion. For the GPIO test force the mmio bus to support non-legacy so we can properly test it. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1333 Message-Id: <20221130112439.2527228-2-alex.bennee@linaro.org> Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-11-11Fix several typos in documentation (found by codespell)Stefan Weil
Those typos are in files which are used to generate the QEMU manual. Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-Id: <20221110190825.879620-1-sw@weilnetz.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Ani Sinha <ani@anisinha.ca> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> [thuth: update sentence in can.rst as suggested by Peter] Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-11-06tests/qtest/libqos/e1000e: Use IVAR shift definitionsAkihiko Odaki
There were still some constants defined in e1000_regs.h. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221105053010.38037-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-11-06tests/qtest/libqos/e1000e: Use E1000_STATUS_ASDV_1000Akihiko Odaki
Nemonics E1000_STATUS_LAN_INIT_DONE and E1000_STATUS_ASDV_1000 have the same value, and E1000_STATUS_ASDV_1000 should be used here because E1000_STATUS_ASDV_1000 represents the auto-detected speed tested here while E1000_STATUS_LAN_INIT_DONE is a value used for a different purpose with a variant of e1000e family different from the one implemented in QEMU. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221103083425.100590-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-11-06tests/qtest/libqos/e1000e: Set E1000_CTRL_SLUAkihiko Odaki
The later device status check depends on E1000_STATUS_LU, which is enabled by E1000_CTRL_SLU. Though E1000_STATUS_LU is not implemented and E1000_STATUS_LU is always available in the current implementation, be a bit nicer and set E1000_CTRL_SLU just in case the bit is implemented in the future. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221103025451.27446-1-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-11-06tests/qtest/libqos/e1000e: Refer common PCI ID definitionsAkihiko Odaki
This is yet another minor cleanup to ease understanding and future refactoring of the tests. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221103015017.19947-1-akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-28tests/qtest: libqos: Do not build virtio-9p unconditionallyBin Meng
At present the virtio-9p related codes are built into libqos unconditionally. Change to build them conditionally by testing the 'virtfs' config option. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221028045736.679903-9-bin.meng@windriver.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-28tests/qtest/libqos/e1000e: Use e1000_regs.hAkihiko Odaki
The register definitions in tests/qtest/libqos/e1000e.c had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. E1000E_CTRL_EXT_TXLSFLOW is removed from E1000E_CTRL_EXT settings because hw/net/e1000_regs.h does not have the definition and it is for TCP segmentation offload, which does not matter for the implemented tests. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-Id: <20221013055245.28102-1-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-24tests/9p: remove unnecessary g_strdup() callsChristian Schoenebeck
This is a leftover from before the recent function merge and refactoring patches: As these functions do not return control to the caller in between, it is not necessary to duplicate strings passed to them. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <0f80141cde3904ed0591354059da49d1d60bcdbc.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tunlinkat() and do_unlinkat()Christian Schoenebeck
As with previous patches, unify those 2 functions into a single function v9fs_tunlinkat() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <1dea593edd464908d92501933c068388c01f1744.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tlink() and do_hardlink()Christian Schoenebeck
As with previous patches, unify those 2 functions into a single function v9fs_tlink() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <cb4d42203e1e4e6027df4924bbe4bdbc002f668b.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tsymlink() and do_symlink()Christian Schoenebeck
As with previous patches, unify those 2 functions into a single function v9fs_tsymlink() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <563f3ad04fe596ce0ae1e2654d1d08237f18c830.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tlcreate() and do_lcreate()Christian Schoenebeck
As with previous patches, unify those 2 functions into a single function v9fs_tlcreate() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <4c01b2caa5f5b54a2020fc92701deadd2abf0571.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tmkdir() and do_mkdir()Christian Schoenebeck
As with previous patches, unify those 2 functions into a single function v9fs_tmkdir() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <b87b2c972921df980440ff5b2d3e6bb8163d6551.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: convert v9fs_tflush() to declarative argumentsChristian Schoenebeck
Use declarative function arguments for function v9fs_tflush(). Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <91b7b154298c500d100b05137146c2905c3acdec.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: convert v9fs_twrite() to declarative argumentsChristian Schoenebeck
Use declarative function arguments for function v9fs_twrite(). Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <be0326e2d9ab66f68c06b1766ddf103849d570b4.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: convert v9fs_tlopen() to declarative argumentsChristian Schoenebeck
Use declarative function arguments for function v9fs_tlopen(). Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <765ab515353c56f88f0a163631f626a44e9565d6.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: convert v9fs_treaddir() to declarative argumentsChristian Schoenebeck
Use declarative function arguments for function v9fs_treaddir(). Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <a66aae4ceb19ec12d245b8c7f33a639584c8e272.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: convert v9fs_tgetattr() to declarative argumentsChristian Schoenebeck
Use declarative function arguments for function v9fs_tgetattr(). Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <d340a91be96fbfecfb8dacdd7558223b3c0d0e2c.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tattach(), do_attach(), do_attach_rqid()Christian Schoenebeck
As with previous patches, unify those 3 functions into a single function v9fs_tattach() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <a6756b30bf2a1b25729c5bbabd1c9534a8f20d6f.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge v9fs_tversion() and do_version()Christian Schoenebeck
As with previous patches, unify functions v9fs_tversion() and do_version() into a single function v9fs_tversion() by using a declarative function arguments approach. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <2d253491aaffd267ec295f056dda47456692cd0c.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: merge *walk*() functionsChristian Schoenebeck
Introduce declarative function calls. There are currently 4 different functions for sending a 9p 'Twalk' request: v9fs_twalk(), do_walk(), do_walk_rqids() and do_walk_expect_error(). They are all doing the same thing, just in a slightly different way and with slightly different function arguments. Merge those 4 functions into a single function by using a struct for function call arguments and use designated initializers when calling this function to turn usage into a declarative approach, which is better readable and easier to maintain. Also move private functions genfid(), split() and split_free() from virtio-9p-test.c to virtio-9p-client.c. Based-on: <E1odrya-0004Fv-97@lizzy.crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <607969dbfbc63c1be008df9131133711b046e979.1664917004.git.qemu_oss@crudebyte.com>
2022-10-24tests/9p: split virtio-9p-test.c into tests and 9p client partChristian Schoenebeck
This patch is pure refactoring, it does not change behaviour. virtio-9p-test.c grew to 1657 lines. Let's split this file up between actual 9p test cases vs. 9p test client, to make it easier to concentrate on the actual 9p tests. Move the 9p test client code to a new unit virtio-9p-client.c, which are basically all functions and types prefixed with v9fs_* already. Note that some client wrapper functions (do_*) are preserved in virtio-9p-test.c, simply because these wrapper functions are going to be wiped with subsequent patches anyway. As the global QGuestAllocator variable is moved to virtio-9p-client.c, add a new function v9fs_set_allocator() to be used by virtio-9p-test.c instead of fiddling with a global variable across units and libraries. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <E1odrya-0004Fv-97@lizzy.crudebyte.com>
2022-10-13Merge tag 'pull-request-2022-10-12' of https://gitlab.com/thuth/qemu into ↵Stefan Hajnoczi
staging * Rework of qtests to support hot plugging tests on q35 * New VNC qtest * Fixes related to temporary file handling in the tests * Use signal() instead of sigaction() since the latter does not work on Windows * Some other small clean-ups # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmNGz1URHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbXwxxAAoh9CeYKLyPFPe71XGsSWW4mQDkny+4CA # AFBfcEchPSyOoTJwuSHS5cL27KkL1Wy7wTSlWdcQ2Z4LA8hexopfPtCVlizH8vQh # hHVP5KLDY7WA7bsuRznrjUjXtjLL9mExuPm3QZ+YxH/3rNhISvq1GfC9Z5PQ/zNp # GagCW+WiFyEYyhRHJnVVTJfZV0NCbJp9KCCJ6n/Rag80JRQiouGQsKLfRoRhvkGC # 13dWq2NeDq9xE1k1ThUZdIpUxJO4cA+9bh6LzGOIcHX8akfkryh3NGCWuojX3XDF # 2CRyyblfjMIp5HUcKNOrQzY1oGRn8y5537ycUkEsropSMdAccIqNwlcWO7whLEGn # 7nbogrPt8Orezytl5ZM3WopWlge5KA2vxOUURx487LnZC2/g7l2unrCDv0c3PHDb # U2fD5do7ZtPOl9Uz8QkYPo5CzEDnKPmPv1txOMBRcBZsvmXPZMxRWwsYavB/RloG # nI9IvG3ZW6ivKwoPPceJberL8Ndq+pqn7y4CNNAAunHSjJ2H0YS1m1F/HfVWKJYJ # uStXy3IZ5Qo8E+IRbPYyM68yBgrnaShuAvTSax8tWjhHOR8HetrzPABMrWylCrdo # gaeSCEZmqf2zIYHQ2q8c7U/YrHgFNHlLz9yCyM6rZtU9dOAe52PG2TlRQomlGP76 # NKnti3RJWG4= # =4f+b # -----END PGP SIGNATURE----- # gpg: Signature made Wed 12 Oct 2022 10:29:41 EDT # 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 * tag 'pull-request-2022-10-12' of https://gitlab.com/thuth/qemu: tests/unit/test-image-locking: Fix handling of temporary files tests/qtest: libqtest: Install signal handler via signal() tests/qtest: migration-test: Avoid using hardcoded /tmp qtest: start a VNC test tests/avocado: Add missing require_netdev('user') checks tests/x86: Add 'q35' machine type to ivshmem-test tests/x86: Add 'q35' machine type to drive_del-test tests/x86: replace snprint() by g_strdup_printf() in drive_del-test tests/x86: Fix comment typo in drive_del-test tests/x86: Add 'q35' machine type to hotplug hd-geo-test tests/x86: Add 'q35' machine type to override-tests in hd-geo-test tests/x86: Refactor hot unplug hd-geo-test tests/x86: Add subtest with 'q35' machine type to device-plug-test tests/x86: add helper qtest_qmp_device_del_send() tests/migration: remove the unused local variable qtest: "-display none" is set in qtest_init() Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2022-10-11tests/x86: add helper qtest_qmp_device_del_send()Michael Labiuk
Move sending 'device_del' command to separate function. Function can be used in case of addition action is needed to start actual removing device after sending command. Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com> Message-Id: <20220929223547.1429580-2-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth <thuth@redhat.com> [thuth: Fixed typo] Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-07tests/qtest: enable tests for virtio-gpioAlex Bennée
We don't have a virtio-gpio implementation in QEMU and only support a vhost-user backend. The QEMU side of the code is minimal so it should be enough to instantiate the device and pass some vhost-user messages over the control socket. To do this we hook into the existing vhost-user-test code and just add the bits required for gpio. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Eric Auger <eric.auger@redhat.com> Message-Id: <20220408155704.2777166-1-alex.bennee@linaro.org> Message-Id: <20220802095010.3330793-23-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-10-07tests/qtest: add assert to catch bad featuresAlex Bennée
No device driver (which is what the qvirtio_ access functions represent) should be setting UNUSED(30) in the feature space. Although existing libqos users mask it out lets ensure nothing sneaks through. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220802095010.3330793-20-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-10-06tests/qtest: bump up QOS_PATH_MAX_ELEMENT_SIZEAlex Bennée
It seems the depth of stack we need to support can vary depending on the order of the init constructors getting called. It seems --enable-lto shuffles things around just enough to push you over the limit. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1186 Acked-by: Thomas Huth <thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220929114231.583801-12-alex.bennee@linaro.org>
2022-08-29tests/qtest: libqos: Rename malloc.h to libqos-malloc.hXuzhou Cheng
The qtest/libqos directory is included via the "-I" option to search for header files when building qtest. Unfortunately the malloc.h has a name conflict with the standard libc header, leading to a build failure on the Windows host, due to the MinGW libc stdlib.h header file includes malloc.h and it now gets wrongly pointed to the one in the qtest/libqos directory. Rename "qtest/libqos/malloc.h" to "qtest/libqos/libqos-malloc.h" to avoid the namespace pollution. Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220824094029.1634519-26-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-08-29tests/qtest: libqos: Drop inclusion of <sys/wait.h>Xuzhou Cheng
There is no <sys/wait.h> in the Windows build environment. Actually this is not needed in the non-win32 builds too. Drop it. Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220824094029.1634519-25-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-08-25tests/qtest: Use g_mkdtemp()Bin Meng
Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220824094029.1634519-3-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-05-12tests/qtest/libqos: Add generic pci host bridge in arm-virt machineEric Auger
Up to now the virt-machine node contains a virtio-mmio node. However no driver produces any PCI interface node. Hence, PCI tests cannot be run with aarch64 binary. Add a GPEX driver node that produces a pci interface node. This latter then can be consumed by all the pci tests. One of the first motivation was to be able to run the virtio-iommu-pci tests. We still face an issue with pci hotplug tests as hotplug cannot happen on the pcie root bus and require a generic root port. This will be addressed later on. We force cpu=max along with aarch64/virt machine as some PCI tests require high MMIO regions to be available. Signed-off-by: Eric Auger <eric.auger@redhat.com> Message-Id: <20220504152025.1785704-4-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-12tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggableEric Auger
ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger <eric.auger@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220504152025.1785704-3-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-12tests/qtest/libqos/pci: Introduce pio_limitEric Auger
At the moment the IO space limit is hardcoded to QPCI_PIO_LIMIT = 0x10000. When accesses are performed to a bar, the base address of this latter is compared against the limit to decide whether we perform an IO or a memory access. On ARM, we cannot keep this PIO limit as the arm-virt machine uses [0x3eff0000, 0x3f000000 ] for the IO space map and we are mandated to allocate at 0x0. Add a new flag in QPCIBar indicating whether it is an IO bar or a memory bar. This flag is set on QPCIBar allocation and provisionned based on the BAR configuration. Then the new flag is used in access functions and in iomap() function. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220504152025.1785704-2-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03libqtest: split QMP part in libqmpMarc-André Lureau
This will help moving QAPI/QMP in a common subproject. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com>
2022-05-03tests: move libqtest.h back under qtest/Marc-André Lureau
Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"), libqtest.h is under libqos/ directory, while libqtest.c is still in qtest/. Move back to its original location to avoid mixing with libqos/. Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2022-04-20tests/qtest: properly initialise the vring used idxAlex Bennée
Eric noticed while attempting to enable the vhost-user-blk-test for Aarch64 that that things didn't work unless he put in a dummy guest_malloc() at the start of the test. Without it qvirtio_wait_used_elem() would assert when it reads a junk value for idx resulting in: qvirtqueue_get_buf: idx:2401 last_idx:0 qvirtqueue_get_buf: 0x7ffcb6d3fe74, (nil) qvirtio_wait_used_elem: 3000000/0 ERROR:../../tests/qtest/libqos/virtio.c:226:qvirtio_wait_used_elem: assertion failed (got_desc_idx == desc_idx): (50331648 == 0) Bail out! ERROR:../../tests/qtest/libqos/virtio.c:226:qvirtio_wait_used_elem: assertion failed (got_desc_idx == desc_idx): (50331648 == 0) What was actually happening is the guest_malloc() effectively pushed the allocation of the vring into the next page which just happened to have clear memory. After much tedious tracing of the code I could see that qvring_init() does attempt initialise a bunch of the vring structures but skips the vring->used.idx value. It is probably not wise to assume guest memory is zeroed anyway. Once the ring is properly initialised the hack is no longer needed to get things working. Thanks-to: John Snow <jsnow@redhat.com> for helping debug Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220406173356.1891500-1-alex.bennee@linaro.org> Tested-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-04-06Remove qemu-common.h include from most unitsMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-22Replace GCC_FMT_ATTR with G_GNUC_PRINTFMarc-André Lureau
One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
2022-02-17tests/9pfs: Use g_autofree and g_autoptr where possibleGreg Kurz
It is recommended to use g_autofree or g_autoptr as it reduces the odds of introducing memory leaks in future changes. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20220201151508.190035-3-groug@kaod.org> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
2022-02-17tests/9pfs: Fix leak of local_test_pathGreg Kurz
local_test_path is allocated in virtio_9p_create_local_test_dir() to hold the path of the temporary directory. It should be freed in virtio_9p_remove_local_test_dir() when the temporary directory is removed. Clarify the lifecycle of local_test_path while here. Based-on: <f6602123c6f7d0d593466231b04fba087817abbd.1642879848.git.qemu_oss@crudebyte.com> Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20220201151508.190035-2-groug@kaod.org> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
2022-02-17tests/9pfs: fix mkdir() being called twiceChristian Schoenebeck
The 9p test cases use mkdtemp() to create a temporary directory for running the 'local' 9p tests with real files/dirs. Unlike mktemp() which only generates a unique file name, mkdtemp() also creates the directory, therefore the subsequent mkdir() was wrong and caused errors on some systems. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Fixes: 136b7af2 (tests/9pfs: fix test dir for parallel tests) Reported-by: Daniel P. Berrangé <berrange@redhat.com> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/832 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Greg Kurz <Greg Kurz <groug@kaod.org> Message-Id: <f6602123c6f7d0d593466231b04fba087817abbd.1642879848.git.qemu_oss@crudebyte.com>