First testing patches for QEMU 7.2
Hi Peter, hi Richard,
sorry for flooding you with so many pull request mails right after QEMU 7.1 has been tagged, but I'll be away from keyboard starting tomorrow, and I still wanted to get these out before I'm away...
The following changes since commit 9a99f964b152f8095949bbddca7841744ad418da:
Update version for v7.1.0-rc4 release (2022-08-24 19:27:56 -0700)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/testing-pull-request-2022-08-30
for you to fetch changes up to da55be562ea2b082da5d55cc12730fe8fe118852:
tests/avocado/migration: Get find_free_port() from the ports (2022-08-30 07:55:43 +0200)
----------------------------------------------------------------
* First batch of patches to get qtests adapted for Windows
* Two preparation patches for the upcoming removal of the slirp submodule
* Some other small test fixes (typos, etc.)
----------------------------------------------------------------
Akihiko Odaki (1):
tests/qtest/ac97-test: Correct reference to driver
Bin Meng (14):
tests/qtest: Use g_setenv()
tests/qtest: Use g_mkdtemp()
tests: Use g_mkdir_with_parents()
tests/qtest: migration-test: Handle link() for win32 backends/tpm: Exclude headers and macros that don't exist on win32 tests/qtest: Adapt {m48t59,rtc}-test cases for win32 tests/qtest: Build e1000e-test for posix only
tests/qtest: Build cases that use memory-backend-file for posix only tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32 tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32 tests/qtest: device-plug-test: Reverse the usage of double/single quotes tests/qtest: machine-none-test: Use double quotes to pass the cpu option tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32 tests/qtest: prom-env-test: Use double quotes to pass the prom-env option
Matheus Tavares Bernardino (1):
docs/devel/testing: fix minor typo
Thomas Huth (5):
tests/vm: Add libslirp to the VM tests
tests/avocado: Do not run tests that require libslirp if it is not available tests/avocado: Fix trivial typo
gitlab-ci: Only use one process in Windows jobs for compilation tests/avocado/migration: Get find_free_port() from the ports
Xuzhou Cheng (2):
tests/qtest: libqos: Drop inclusion of <sys/wait.h> tests/qtest: libqos: Rename malloc.h to libqos-malloc.h
docs/devel/testing.rst | 2 +-
backends/tpm/tpm_ioctl.h | 4 ++++
tests/qtest/fuzz/generic_fuzz_configs.h | 2 +-
tests/qtest/libqos/generic-pcihost.h | 2 +-
tests/qtest/libqos/{malloc.h => libqos-malloc.h} | 0
tests/qtest/libqos/libqos.h | 2 +-
tests/qtest/libqos/malloc-pc.h | 2 +-
tests/qtest/libqos/malloc-spapr.h | 2 +-
tests/qtest/libqos/pci-pc.h | 2 +-
tests/qtest/libqos/pci-spapr.h | 2 +-
tests/qtest/libqos/qgraph.h | 2 +-
tests/qtest/libqos/qos_external.h | 2 +-
tests/qtest/libqos/rtas.h | 2 +-
tests/qtest/libqos/virtio.h | 2 +-
tests/qtest/migration-helpers.h | 2 ++
tests/migration/stress.c | 2 +-
tests/qtest/ac97-test.c | 2 +-
tests/qtest/bios-tables-test.c | 10 ++++++++++
tests/qtest/cdrom-test.c | 2 +-
tests/qtest/cxl-test.c | 10 +++++++---
tests/qtest/device-plug-test.c | 2 +-
tests/qtest/e1000e-test.c | 2 +-
tests/qtest/fuzz/generic_fuzz.c | 8 ++++----
tests/qtest/fuzz/qos_fuzz.c | 2 +-
tests/qtest/i440fx-test.c | 6 ++++++
tests/qtest/ivshmem-test.c | 4 ++--
tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c | 2 +-
tests/qtest/libqos/arm-imx25-pdk-machine.c | 2 +-
tests/qtest/libqos/arm-n800-machine.c | 2 +-
tests/qtest/libqos/arm-raspi2-machine.c | 2 +-
tests/qtest/libqos/arm-sabrelite-machine.c | 2 +-
tests/qtest/libqos/arm-smdkc210-machine.c | 2 +-
tests/qtest/libqos/arm-virt-machine.c | 2 +-
tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c | 2 +-
tests/qtest/libqos/e1000e.c | 2 +-
tests/qtest/libqos/{malloc.c => libqos-malloc.c} | 2 +-
tests/qtest/libqos/libqos.c | 2 --
tests/qtest/libqos/qos_external.c | 2 +-
tests/qtest/libqos/virtio-9p.c | 4 ++--
tests/qtest/libqos/virtio-mmio.c | 2 +-
tests/qtest/libqos/virtio-pci.c | 2 +-
tests/qtest/libqtest.c | 4 ++--
tests/qtest/m48t59-test.c | 2 +-
tests/qtest/machine-none-test.c | 2 +-
tests/qtest/migration-helpers.c | 2 ++
tests/qtest/migration-test.c | 22 +++++++++++++++++-----
tests/qtest/npcm7xx_emc-test.c | 8 ++++++++
tests/qtest/prom-env-test.c | 4 ++--
tests/qtest/qmp-test.c | 4 ++--
tests/qtest/qos-test.c | 2 +-
tests/qtest/rtc-test.c | 2 +-
tests/qtest/vhost-user-test.c | 4 ++--
tests/unit/test-crypto-tlscredsx509.c | 4 ++--
tests/unit/test-crypto-tlssession.c | 6 +++---
tests/unit/test-io-channel-tls.c | 6 +++---
tests/unit/test-qga.c | 2 +-
.gitlab-ci.d/windows.yml | 4 ++--
tests/avocado/avocado_qemu/__init__.py | 9 ++++++++-
tests/avocado/info_usernet.py | 1 +
tests/avocado/migration.py | 4 ++--
tests/avocado/replay_linux.py | 1 +
tests/qtest/libqos/meson.build | 2 +-
tests/qtest/meson.build | 7 +++++--
tests/vm/freebsd | 3 +++
tests/vm/haiku.x86_64 | 3 ++-
tests/vm/netbsd | 3 +++
66 files changed, 144 insertions(+), 79 deletions(-)
rename tests/qtest/libqos/{malloc.h => libqos-malloc.h} (100%)
rename tests/qtest/libqos/{malloc.c => libqos-malloc.c} (99%)[PULL 02/23] tests/qtest: Use g_mkdtemp()
From: Bin Meng <[email protected]>
Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version.
Message-Id: <[email protected]>
--- tests/qtest/fuzz/generic_fuzz_configs.h | 2 +- tests/qtest/cdrom-test.c | 2 +- tests/qtest/cxl-test.c | 6 +++--- tests/qtest/ivshmem-test.c | 4 ++-- tests/qtest/libqos/virtio-9p.c | 4 ++-- tests/qtest/libqtest.c | 2 +- tests/qtest/migration-test.c | 4 ++-- tests/qtest/qmp-test.c | 4 ++-- tests/qtest/vhost-user-test.c | 4 ++-- tests/unit/test-qga.c | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-)
tests/qtest/fuzz/generic_fuzz_configs.h +1 -1
@@ -21,7 +21,7 @@ typedef struct generic_fuzz_config {static inline gchar *generic_fuzzer_virtio_9p_args (void ){char tmpdir[] ="/tmp/qemu-fuzz.XXXXXX" ; -g_assert_nonnull (mkdtemp (tmpdir)); +g_assert_nonnull (g_mkdtemp (tmpdir));return g_strdup_printf ("-machine q35 -nodefaults " "-device virtio-9p,fsdev=hshare,mount_tag=hshare "
tests/qtest/cdrom-test.c +1 -1
@@ -52,7 +52,7 @@ static int prepare_image(const char *arch, char *isoimage)perror ("Error creating temporary iso image file" );return -1 ; } -if (!mkdtemp (srcdir)) { +if (!g_mkdtemp (srcdir)) {perror ("Error creating temporary directory" ); goto cleanup; }
tests/qtest/cxl-test.c +3 -3
@@ -95,7 +95,7 @@ static void cxl_t3d(void)char template[] ="/tmp/cxl-test-XXXXXX" ;const char *tmpfs; - tmpfs =mkdtemp (template); + tmpfs =g_mkdtemp (template); g_string_printf(cmdline, QEMU_PXB_CMD QEMU_RP QEMU_T3D, tmpfs, tmpfs);
@@ -109,7 +109,7 @@ static void cxl_1pxb_2rp_2t3d(void)char template[] ="/tmp/cxl-test-XXXXXX" ;const char *tmpfs; - tmpfs =mkdtemp (template); + tmpfs =g_mkdtemp (template); g_string_printf(cmdline, QEMU_PXB_CMD QEMU_2RP QEMU_2T3D, tmpfs, tmpfs, tmpfs, tmpfs);
@@ -124,7 +124,7 @@ static void cxl_2pxb_4rp_4t3d(void)char template[] ="/tmp/cxl-test-XXXXXX" ;const char *tmpfs; - tmpfs =mkdtemp (template); + tmpfs =g_mkdtemp (template); g_string_printf(cmdline, QEMU_2PXB_CMD QEMU_4RP QEMU_4T3D, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs,
tests/qtest/ivshmem-test.c +2 -2
@@ -481,8 +481,8 @@ int main(int argc, char **argv) tmpshmem =mmap (0 ,TMPSHMSIZE ,PROT_READ |PROT_WRITE ,MAP_SHARED , fd,0 );g_assert (tmpshmem !=MAP_FAILED );/* server */ -if (mkdtemp (dir) ==NULL ) { -g_error ("mkdtemp: %s" ,g_strerror (errno)); +if (g_mkdtemp (dir) ==NULL ) { +g_error ("g_mkdtemp: %s" ,g_strerror (errno)); } tmpdir = dir; tmpserver =g_strconcat (tmpdir,"/server" ,NULL );
tests/qtest/libqos/virtio-9p.c +2 -2
@@ -48,9 +48,9 @@ void virtio_9p_create_local_test_dir(void)*/ char *template =concat_path (pwd,"qtest-9p-local-XXXXXX" ); - local_test_path =mkdtemp (template); + local_test_path =g_mkdtemp (template);if (!local_test_path) { -g_test_message ("mkdtemp('%s') failed: %s" , template,strerror (errno)); +g_test_message ("g_mkdtemp('%s') failed: %s" , template,strerror (errno)); }g_assert (local_test_path !=NULL );
tests/qtest/libqtest.c +1 -1
@@ -393,7 +393,7 @@ QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd)char *sock_path, sock_dir[] ="/tmp/qtest-serial-XXXXXX" ;QTestState *qts; -g_assert_true (mkdtemp (sock_dir) !=NULL ); +g_assert_true (g_mkdtemp (sock_dir) !=NULL ); sock_path =g_strdup_printf ("%s/sock" , sock_dir); sock_fd_init =init_socket (sock_path);
tests/qtest/migration-test.c +2 -2
@@ -2452,9 +2452,9 @@ int main(int argc, char **argv)return g_test_run (); } - tmpfs =mkdtemp (template); + tmpfs =g_mkdtemp (template);if (!tmpfs) { -g_test_message ("mkdtemp on path (%s): %s" , template,strerror (errno)); +g_test_message ("g_mkdtemp on path (%s): %s" , template,strerror (errno)); }g_assert (tmpfs);
tests/qtest/qmp-test.c +2 -2
@@ -166,8 +166,8 @@ char *fifo_name;static void setup_blocking_cmd (void ) { -if (!mkdtemp (tmpdir)) { -g_error ("mkdtemp: %s" ,strerror (errno)); +if (!g_mkdtemp (tmpdir)) { +g_error ("g_mkdtemp: %s" ,strerror (errno)); } fifo_name =g_strdup_printf ("%s/fifo" , tmpdir);if (mkfifo (fifo_name,0666 )) {
tests/qtest/vhost-user-test.c +2 -2
@@ -491,9 +491,9 @@ static TestServer *test_server_new(const gchar *name,/* run the main loop thread so the chardev may operate */ server->thread =g_thread_new (NULL , thread_function, server->loop); - tmpfs =mkdtemp (template); + tmpfs =g_mkdtemp (template);if (!tmpfs) { -g_test_message ("mkdtemp on path (%s): %s" , template,strerror (errno)); +g_test_message ("g_mkdtemp on path (%s): %s" , template,strerror (errno)); }g_assert (tmpfs);
tests/unit/test-qga.c +1 -1
@@ -60,7 +60,7 @@ fixture_setup(TestFixture *fixture, gconstpointer data, gchar **envp) fixture->loop =g_main_loop_new (NULL , FALSE); fixture->test_dir =g_strdup ("/tmp/qgatest.XXXXXX" ); -g_assert_nonnull (mkdtemp (fixture->test_dir)); +g_assert_nonnull (g_mkdtemp (fixture->test_dir)); path =g_build_filename (fixture->test_dir,"sock" ,NULL ); cwd =g_get_current_dir ();
Signature · 1 line
2.31.1
[PULL 07/23] tests/qtest: Build e1000e-test for posix only
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
The whole e1000e-test test case relies on socketpair() which does not exist on win32.
Message-Id: <[email protected]>
--- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qtest/meson.build +3 -1
@@ -239,7 +239,6 @@ qos_test_ss.add( 'adm1272-test.c', 'ds1338-test.c', 'e1000-test.c', - 'e1000e-test.c', 'eepro100-test.c', 'es1370-test.c', 'ipoctal232-test.c',
@@ -267,6 +266,9 @@ qos_test_ss.add( 'virtio-iommu-test.c', 'vmxnet3-test.c', ) +if config_host.has_key('CONFIG_POSIX') + qos_test_ss.add(files('e1000e-test.c')) +endif if have_virtfs qos_test_ss.add(files('virtio-9p-test.c')) endif
Signature · 1 line
2.31.1
[PULL 13/23] tests/qtest: device-plug-test: Reverse the usage of double/single quotes
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
The usage of double/single quotes in test_pci_unplug_json_request() should be reversed to work on both win32 and non-win32 platforms:
- The value of -device parameter needs to be surrounded by "" as Windows does not drop '' when passing it to QEMU which causes QEMU command line option parser failure.
- The JSON key/value pairs need to be surrounded by '' to make the JSON parser happy on Windows.
Message-Id: <[email protected]>
--- tests/qtest/device-plug-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/device-plug-test.c +1 -1
@@ -95,7 +95,7 @@ static void test_pci_unplug_json_request(void) }QTestState *qtest =qtest_initf ( -"%s -device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'" , +"%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"" , machine_addition);/*
Signature · 1 line
2.31.1
[PULL 03/23] tests: Use g_mkdir_with_parents()
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
Use the same g_mkdir_with_parents() call to create a directory on all platforms.
Message-Id: <[email protected]>
--- tests/migration/stress.c | 2 +- tests/qtest/migration-test.c | 6 +++--- tests/unit/test-crypto-tlscredsx509.c | 4 ++-- tests/unit/test-crypto-tlssession.c | 6 +++--- tests/unit/test-io-channel-tls.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-)
tests/migration/stress.c +1 -1
@@ -232,7 +232,7 @@ static void stress(unsigned long long ramsizeGB, int ncpus)static int mount_misc (const char *fstype,const char *dir) { -if (mkdir (dir,0755 ) <0 && errno !=EEXIST ) { +if (g_mkdir_with_parents (dir,0755 ) <0 && errno !=EEXIST ) {fprintf (stderr,"%s (%05d): ERROR: cannot create %s: %s\n" , argv0,gettid (), dir,strerror (errno));return -1 ;
tests/qtest/migration-test.c +3 -3
@@ -761,14 +761,14 @@ test_migrate_tls_psk_start_common(QTestState *from, data->workdir =g_strdup_printf ("%s/tlscredspsk0" , tmpfs); data->pskfile =g_strdup_printf ("%s/%s" , data->workdir,QCRYPTO_TLS_CREDS_PSKFILE ); -mkdir (data->workdir,0700 ); +g_mkdir_with_parents (data->workdir,0700 );test_tls_psk_init (data->pskfile);if (mismatch) { data->workdiralt =g_strdup_printf ("%s/tlscredspskalt0" , tmpfs); data->pskfilealt =g_strdup_printf ("%s/%s" , data->workdiralt,QCRYPTO_TLS_CREDS_PSKFILE ); -mkdir (data->workdiralt,0700 ); +g_mkdir_with_parents (data->workdiralt,0700 );test_tls_psk_init_alt (data->pskfilealt); }
@@ -873,7 +873,7 @@ test_migrate_tls_x509_start_common(QTestState *from, data->clientcert =g_strdup_printf ("%s/client-cert.pem" , data->workdir); } -mkdir (data->workdir,0700 ); +g_mkdir_with_parents (data->workdir,0700 );test_tls_init (data->keyfile);g_assert (link (data->keyfile, data->serverkey) ==0 );
tests/unit/test-crypto-tlscredsx509.c +2 -2
@@ -75,7 +75,7 @@ static void test_tls_creds(const void *opaque)QCryptoTLSCreds *creds;#define CERT_DIR "tests/test-crypto-tlscredsx509-certs/" -mkdir (CERT_DIR ,0700 ); +g_mkdir_with_parents (CERT_DIR ,0700 ); unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);if (data->isServer) {
@@ -141,7 +141,7 @@ int main(int argc, char **argv)g_test_init (&argc, &argv,NULL );g_setenv ("GNUTLS_FORCE_FIPS_MODE" ,"2" ,1 ); -mkdir (WORKDIR ,0700 ); +g_mkdir_with_parents (WORKDIR ,0700 );test_tls_init (KEYFILE );
tests/unit/test-crypto-tlssession.c +3 -3
@@ -249,8 +249,8 @@ static void test_crypto_tls_session_x509(const void *opaque)#define CLIENT_CERT_DIR "tests/test-crypto-tlssession-client/"#define SERVER_CERT_DIR "tests/test-crypto-tlssession-server/" -mkdir (CLIENT_CERT_DIR ,0700 ); -mkdir (SERVER_CERT_DIR ,0700 ); +g_mkdir_with_parents (CLIENT_CERT_DIR ,0700 ); +g_mkdir_with_parents (SERVER_CERT_DIR ,0700 ); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);
@@ -398,7 +398,7 @@ int main(int argc, char **argv)g_test_init (&argc, &argv,NULL );g_setenv ("GNUTLS_FORCE_FIPS_MODE" ,"2" ,1 ); -mkdir (WORKDIR ,0700 ); +g_mkdir_with_parents (WORKDIR ,0700 );test_tls_init (KEYFILE );test_tls_psk_init (PSKFILE );
tests/unit/test-io-channel-tls.c +3 -3
@@ -125,8 +125,8 @@ static void test_io_channel_tls(const void *opaque)#define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/"#define SERVER_CERT_DIR "tests/test-io-channel-tls-server/" -mkdir (CLIENT_CERT_DIR ,0700 ); -mkdir (SERVER_CERT_DIR ,0700 ); +g_mkdir_with_parents (CLIENT_CERT_DIR ,0700 ); +g_mkdir_with_parents (SERVER_CERT_DIR ,0700 ); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);
@@ -273,7 +273,7 @@ int main(int argc, char **argv)g_test_init (&argc, &argv,NULL );g_setenv ("GNUTLS_FORCE_FIPS_MODE" ,"2" ,1 ); -mkdir (WORKDIR ,0700 ); +g_mkdir_with_parents (WORKDIR ,0700 );test_tls_init (KEYFILE );
Signature · 1 line
2.31.1
[PULL 04/23] tests/qtest: migration-test: Handle link() for win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
Windows does not provide a link() API like POSIX. Instead it provides a similar API CreateHardLink() that does the same thing, but with different argument order and return value.
Message-Id: <[email protected]>
--- tests/qtest/migration-test.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/qtest/migration-test.c +8 -0
@@ -876,9 +876,17 @@ test_migrate_tls_x509_start_common(QTestState *from,g_mkdir_with_parents (data->workdir,0700 );test_tls_init (data->keyfile); +#ifndef _WIN32g_assert (link (data->keyfile, data->serverkey) ==0 ); +#else +g_assert (CreateHardLink (data->serverkey, data->keyfile,NULL ) !=0 ); +#endif if (args->clientcert) { +#ifndef _WIN32g_assert (link (data->keyfile, data->clientkey) ==0 ); +#else +g_assert (CreateHardLink (data->clientkey, data->keyfile,NULL ) !=0 ); +#endif }TLS_ROOT_REQ_SIMPLE (cacertreq, data->cacert);
Signature · 1 line
2.31.1
[PULL 17/23] tests/vm: Add libslirp to the VM tests
In reply to Thomas HuthWe are going to remove the slirp submodule from the QEMU repository, so we should make sure to install the distro's libslirp to get the same test coverage as before in the VMs.
Message-Id: <[email protected]>
--- tests/vm/freebsd | 3 +++ tests/vm/haiku.x86_64 | 3 ++- tests/vm/netbsd | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-)
tests/vm/freebsd +3 -0
@@ -63,6 +63,9 @@ class FreeBSDVM(basevm.BaseVM): # libs: migration "zstd", + + # libs: networking + "libslirp", ] BUILD_SCRIPT = """
tests/vm/haiku.x86_64 +2 -1
@@ -71,6 +71,7 @@ class HaikuVM(basevm.BaseVM): "devel:libpixman_1", "devel:libpng16", "devel:libsdl2_2.0", + "devel:libslirp", "devel:libsnappy", "devel:libssh2", "devel:libtasn1",
@@ -89,7 +90,7 @@ class HaikuVM(basevm.BaseVM): mkdir -p /usr/bin ln -s /boot/system/bin/env /usr/bin/env cd ../build - ../src/configure --disable-slirp {configure_opts}; + ../src/configure {configure_opts}; make --output-sync -j{jobs} {target} {verbose}; """
tests/vm/netbsd +3 -0
@@ -54,6 +54,9 @@ class NetBSDVM(basevm.BaseVM): # libs: migration "zstd", + + # libs: networking + "libslirp", ] BUILD_SCRIPT = """
Signature · 1 line
2.31.1
[PULL 06/23] tests/qtest: Adapt {m48t59,rtc}-test cases for win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
There is no tm_gmtoff member in 'struct tm' on Windows. Update rtc-test.c and m48t59-test.c accordingly.
Message-Id: <[email protected]>
--- tests/qtest/m48t59-test.c | 2 +- tests/qtest/rtc-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tests/qtest/m48t59-test.c +1 -1
@@ -137,7 +137,7 @@ static void cmos_get_date_time(QTestState *s, struct tm *date) date->tm_mday = mday; date->tm_mon = mon -1 ; date->tm_year = base_year + year -1900 ; -#ifndef __sun__ +#if !defined(__sun__) && !defined(_WIN32) date->tm_gmtoff =0 ;#endif
tests/qtest/rtc-test.c +1 -1
@@ -111,7 +111,7 @@ static void cmos_get_date_time(struct tm *date) date->tm_mday = mday; date->tm_mon = mon -1 ; date->tm_year = base_year + year -1900 ; -#ifndef __sun__ +#if !defined(__sun__) && !defined(_WIN32) date->tm_gmtoff =0 ;#endif
Signature · 1 line
2.31.1
[PULL 05/23] backends/tpm: Exclude headers and macros that don't exist on win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
These headers and macros do not exist on Windows. Exclude them.
Message-Id: <[email protected]>
--- backends/tpm/tpm_ioctl.h | 4 ++++ 1 file changed, 4 insertions(+)
backends/tpm/tpm_ioctl.h +4 -0
@@ -9,8 +9,10 @@#ifndef TPM_IOCTL_H #define TPM_IOCTL_H +#ifndef _WIN32#include <sys/uio.h> #include <sys/ioctl.h> +#endif #ifdef HAVE_SYS_IOCCOM_H #include <sys/ioccom.h>
@@ -222,6 +224,7 @@ typedef struct ptm_setbuffersize ptm_setbuffersize;#define PTM_CAP_SET_DATAFD (1 << 12)#define PTM_CAP_SET_BUFFERSIZE (1 << 13) +#ifndef _WIN32enum {PTM_GET_CAPABILITY =_IOR ('P' ,0 , ptm_cap), PTM_INIT = _IOWR('P', 1, ptm_init),
@@ -241,6 +244,7 @@ enum {PTM_SET_DATAFD =_IOR ('P' ,15 , ptm_res), PTM_SET_BUFFERSIZE = _IOWR('P', 16, ptm_setbuffersize), }; +#endif /* * Commands used by the non-CUSE TPMs
Signature · 1 line
2.31.1
[PULL 20/23] docs/devel/testing: fix minor typo
In reply to Thomas HuthFrom: Matheus Tavares Bernardino <[email protected]>
Message-Id: <421fb28678d1077c0b14978e359b4e1469cc0168.1661262376.git.quic_mathbern@quicinc.com>
--- docs/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
docs/devel/testing.rst +1 -1
@@ -297,7 +297,7 @@ build and test QEMU in predefined and widely accessible Linux environments. This makes it possible to expand the test coverage across distros, toolchain flavors and library versions. The support was originally written for Docker although we also support Podman as -an alternative container runtime. Although the many of the target +an alternative container runtime. Although many of the target names and scripts are prefixed with "docker" the system will automatically run on whichever is configured.
Signature · 1 line
2.31.1
[PULL 08/23] tests/qtest: Build cases that use memory-backend-file for posix only
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
As backends/meson.build tells us, hostmem-file.c is only supported on POSIX platforms, hence any test case that utilizes the memory backend file should be guarded by CONFIG_POSIX too.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 10 ++++++++++ tests/qtest/cxl-test.c | 4 ++++ tests/qtest/meson.build | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +10 -0
@@ -1461,6 +1461,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)test_acpi_tcg_acpi_hmat (MACHINE_PC ); } +#ifdef CONFIG_POSIX static void test_acpi_erst (const char *machine) {gchar *tmp_path =g_dir_make_tmp ("qemu-test-erst.XXXXXX" ,NULL );
@@ -1511,6 +1512,7 @@ static void test_acpi_microvm_acpi_erst(void)g_free (tmp_path); free_test_data(&data); } +#endif /* CONFIG_POSIX */ static void test_acpi_virt_tcg (void ) {
@@ -1551,6 +1553,7 @@ static void test_acpi_q35_viot(void)free_test_data (&data); } +#ifdef CONFIG_POSIX static void test_acpi_q35_cxl (void ) {gchar *tmp_path =g_dir_make_tmp ("qemu-test-cxl.XXXXXX" ,NULL );
@@ -1593,6 +1596,7 @@ static void test_acpi_q35_cxl(void)g_free (tmp_path); free_test_data(&data); } +#endif /* CONFIG_POSIX */ static void test_acpi_virt_viot (void ) {
@@ -1805,8 +1809,10 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm);qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat);qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat); +#ifdef CONFIG_POSIX qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst);qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst); +#endif qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc);qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa);qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg);
@@ -1818,7 +1824,9 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs);if (strcmp (arch,"x86_64" ) ==0 ) {qtest_add_func ("acpi/microvm/pcie" , test_acpi_microvm_pcie_tcg); +#ifdef CONFIG_POSIX qtest_add_func ("acpi/microvm/acpierst" , test_acpi_microvm_acpi_erst); +#endif } }if (has_kvm) {
@@ -1826,7 +1834,9 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); }qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); +#ifdef CONFIG_POSIX qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); +#endif qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); }else if (strcmp (arch,"aarch64" ) ==0 ) {if (has_tcg) {
tests/qtest/cxl-test.c +4 -0
@@ -89,6 +89,7 @@ static void cxl_2root_port(void)qtest_end (); } +#ifdef CONFIG_POSIX static void cxl_t3d (void ) {g_autoptr (GString) cmdline =g_string_new (NULL );
@@ -133,6 +134,7 @@ static void cxl_2pxb_4rp_4t3d(void)qtest_start (cmdline->str); qtest_end(); } +#endif /* CONFIG_POSIX */ int main (int argc,char **argv) {
@@ -144,8 +146,10 @@ int main(int argc, char **argv)qtest_add_func ("/pci/cxl/pxb_x2_with_window" , cxl_2pxb_with_window);qtest_add_func ("/pci/cxl/rp" , cxl_root_port);qtest_add_func ("/pci/cxl/rp_x2" , cxl_2root_port); +#ifdef CONFIG_POSIX qtest_add_func ("/pci/cxl/type3_device" , cxl_t3d);qtest_add_func ("/pci/cxl/rp_x2_type3_x2" , cxl_1pxb_2rp_2t3d);qtest_add_func ("/pci/cxl/pxb_x2_root_port_x4_type3_x4" , cxl_2pxb_4rp_4t3d); +#endif return g_test_run (); }
tests/qtest/meson.build +2 -1
@@ -71,7 +71,8 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \ (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ - (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ + (config_host.has_key('CONFIG_POSIX') and \ + config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
Signature · 1 line
2.31.1
[PULL 09/23] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
The request_{bios,pflash} test cases call mmap() which does not exist on win32. Exclude them.
Message-Id: <[email protected]>
--- tests/qtest/i440fx-test.c | 6 ++++++ 1 file changed, 6 insertions(+)
tests/qtest/i440fx-test.c +6 -0
@@ -278,6 +278,8 @@ static void test_i440fx_pam(gconstpointer opaque)qtest_end (); } +#ifndef _WIN32 +#define BLOB_SIZE ((size_t)65536)#define ISA_BIOS_MAXSZ ((size_t)(128 * 1024))
@@ -396,6 +398,8 @@ static void request_pflash(FirmwareTestFixture *fixture, fixture->is_bios = false; } +#endif /* _WIN32 */ +int main (int argc,char **argv) {TestData data;
@@ -406,8 +410,10 @@ int main(int argc, char **argv)qtest_add_data_func ("i440fx/defaults" , &data, test_i440fx_defaults);qtest_add_data_func ("i440fx/pam" , &data, test_i440fx_pam); +#ifndef _WIN32add_firmware_test ("i440fx/firmware/bios" , request_bios);add_firmware_test ("i440fx/firmware/pflash" , request_pflash); +#endif return g_test_run (); }
Signature · 1 line
2.31.1
[PULL 12/23] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h
In reply to Thomas HuthFrom: Xuzhou Cheng <[email protected]>
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.
Message-Id: <[email protected]>
---
tests/qtest/libqos/generic-pcihost.h | 2 +-
tests/qtest/libqos/{malloc.h => libqos-malloc.h} | 0
tests/qtest/libqos/libqos.h | 2 +-
tests/qtest/libqos/malloc-pc.h | 2 +-
tests/qtest/libqos/malloc-spapr.h | 2 +-
tests/qtest/libqos/pci-pc.h | 2 +-
tests/qtest/libqos/pci-spapr.h | 2 +-
tests/qtest/libqos/qgraph.h | 2 +-
tests/qtest/libqos/qos_external.h | 2 +-
tests/qtest/libqos/rtas.h | 2 +-
tests/qtest/libqos/virtio.h | 2 +-
tests/qtest/e1000e-test.c | 2 +-
tests/qtest/fuzz/qos_fuzz.c | 2 +-
tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c | 2 +-
tests/qtest/libqos/arm-imx25-pdk-machine.c | 2 +-
tests/qtest/libqos/arm-n800-machine.c | 2 +-
tests/qtest/libqos/arm-raspi2-machine.c | 2 +-
tests/qtest/libqos/arm-sabrelite-machine.c | 2 +-
tests/qtest/libqos/arm-smdkc210-machine.c | 2 +-
tests/qtest/libqos/arm-virt-machine.c | 2 +-
tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c | 2 +-
tests/qtest/libqos/e1000e.c | 2 +-
tests/qtest/libqos/{malloc.c => libqos-malloc.c} | 2 +-
tests/qtest/libqos/qos_external.c | 2 +-
tests/qtest/libqos/virtio-mmio.c | 2 +-
tests/qtest/libqos/virtio-pci.c | 2 +-
tests/qtest/qos-test.c | 2 +-
tests/qtest/libqos/meson.build | 2 +-
28 files changed, 27 insertions(+), 27 deletions(-)
rename tests/qtest/libqos/{malloc.h => libqos-malloc.h} (100%)
rename tests/qtest/libqos/{malloc.c => libqos-malloc.c} (99%)tests/qtest/libqos/generic-pcihost.h +1 -1
@@ -14,7 +14,7 @@#define LIBQOS_GENERIC_PCIHOST_H #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" typedef struct QGenericPCIBus {
tests/qtest/libqos/libqos-malloc.h renamed from tests/qtest/libqos/malloc.h +0 -0
tests/qtest/libqos/libqos.h +1 -1
@@ -3,7 +3,7 @@#include "../libqtest.h" #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" typedef struct QOSState QOSState ;
tests/qtest/libqos/malloc-pc.h +1 -1
@@ -13,7 +13,7 @@#ifndef LIBQOS_MALLOC_PC_H #define LIBQOS_MALLOC_PC_H -#include "malloc.h" +#include "libqos-malloc.h" void pc_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags);
tests/qtest/libqos/malloc-spapr.h +1 -1
@@ -8,7 +8,7 @@#ifndef LIBQOS_MALLOC_SPAPR_H #define LIBQOS_MALLOC_SPAPR_H -#include "malloc.h" +#include "libqos-malloc.h" void spapr_alloc_init (QGuestAllocator *s,QTestState *qts,QAllocOpts flags);
tests/qtest/libqos/pci-pc.h +1 -1
@@ -14,7 +14,7 @@#define LIBQOS_PCI_PC_H #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" typedef struct QPCIBusPC {
tests/qtest/libqos/pci-spapr.h +1 -1
@@ -8,7 +8,7 @@#ifndef LIBQOS_PCI_SPAPR_H #define LIBQOS_PCI_SPAPR_H -#include "malloc.h" +#include "libqos-malloc.h" #include "pci.h" #include "qgraph.h"
tests/qtest/libqos/qgraph.h +1 -1
@@ -21,7 +21,7 @@#include <gmodule.h> #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" /* maximum path length */ #define QOS_PATH_MAX_ELEMENT_SIZE 50
tests/qtest/libqos/qos_external.h +1 -1
@@ -21,7 +21,7 @@#include "qgraph.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-qom.h"
tests/qtest/libqos/rtas.h +1 -1
@@ -5,7 +5,7 @@#ifndef LIBQOS_RTAS_H #define LIBQOS_RTAS_H -#include "malloc.h" +#include "libqos-malloc.h" int qrtas_get_time_of_day (QTestState *qts,QGuestAllocator *alloc,struct tm *tm,uint32_t *ns);
tests/qtest/libqos/virtio.h +1 -1
@@ -10,7 +10,7 @@#ifndef LIBQOS_VIRTIO_H #define LIBQOS_VIRTIO_H -#include "malloc.h" +#include "libqos-malloc.h" #include "standard-headers/linux/virtio_ring.h" #define QVIRTIO_F_BAD_FEATURE 0x40000000ull
tests/qtest/e1000e-test.c +1 -1
@@ -31,7 +31,7 @@#include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "libqos/malloc.h" +#include "libqos/libqos-malloc.h" #include "libqos/e1000e.h" static void e1000e_send_verify (QE1000E *d,int *test_sockets,QGuestAllocator *alloc)
tests/qtest/fuzz/qos_fuzz.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/main-loop.h" #include "tests/qtest/libqtest.h" -#include "tests/qtest/libqos/malloc.h" +#include "tests/qtest/libqos/libqos-malloc.h" #include "tests/qtest/libqos/qgraph.h" #include "tests/qtest/libqos/qgraph_internal.h" #include "tests/qtest/libqos/qos_external.h"
tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h"
tests/qtest/libqos/arm-imx25-pdk-machine.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "../libqtest.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "i2c.h"
tests/qtest/libqos/arm-n800-machine.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "../libqtest.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "i2c.h"
tests/qtest/libqos/arm-raspi2-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h"
tests/qtest/libqos/arm-sabrelite-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h"
tests/qtest/libqos/arm-smdkc210-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h"
tests/qtest/libqos/arm-virt-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "virtio-mmio.h" #include "generic-pcihost.h"
tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c +1 -1
@@ -19,7 +19,7 @@#include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h"
tests/qtest/libqos/e1000e.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "e1000e.h"
tests/qtest/libqos/libqos-malloc.c renamed from tests/qtest/libqos/malloc.c +1 -1
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qemu/host-utils.h" typedef struct MemBlock {
tests/qtest/libqos/qos_external.c +1 -1
@@ -24,7 +24,7 @@#include "qapi/qmp/qstring.h" #include "qemu/module.h" #include "qapi/qmp/qlist.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "qgraph_internal.h" #include "qos_external.h"
tests/qtest/libqos/virtio-mmio.c +1 -1
@@ -12,7 +12,7 @@#include "qemu/module.h" #include "virtio.h" #include "virtio-mmio.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "standard-headers/linux/virtio_ring.h"
tests/qtest/libqos/virtio-pci.c +1 -1
@@ -13,7 +13,7 @@#include "virtio-pci.h" #include "pci.h" #include "pci-pc.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "malloc-pc.h" #include "qgraph.h" #include "standard-headers/linux/virtio_ring.h"
tests/qtest/qos-test.c +1 -1
@@ -25,7 +25,7 @@#include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-visit-qom.h" -#include "libqos/malloc.h" +#include "libqos/libqos-malloc.h" #include "libqos/qgraph.h" #include "libqos/qgraph_internal.h" #include "libqos/qos_external.h"
tests/qtest/libqos/meson.build +1 -1
@@ -6,7 +6,7 @@ libqos_srcs = files( 'qos_external.c', 'pci.c', 'fw_cfg.c', - 'malloc.c', + 'libqos-malloc.c', 'libqos.c', 'sdhci-cmd.c',
Signature · 1 line
2.31.1
[PULL 01/23] tests/qtest: Use g_setenv()
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
Windows does not provide a setenv() API, but glib does. Replace setenv() call with the glib version.
Message-Id: <[email protected]>
--- tests/qtest/fuzz/generic_fuzz.c | 8 ++++---- tests/qtest/libqtest.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
tests/qtest/fuzz/generic_fuzz.c +4 -4
@@ -994,16 +994,16 @@ static GString *generic_fuzz_predefined_config_cmdline(FuzzTarget *t)g_assert (t->opaque); config = t->opaque; -setenv ("QEMU_AVOID_DOUBLE_FETCH" ,"1" ,1 ); +g_setenv ("QEMU_AVOID_DOUBLE_FETCH" ,"1" ,1 );if (config->argfunc) { args = config->argfunc (); -setenv ("QEMU_FUZZ_ARGS" , args,1 ); +g_setenv ("QEMU_FUZZ_ARGS" , args,1 );g_free (args); }else {g_assert_nonnull (config->args); -setenv ("QEMU_FUZZ_ARGS" , config->args,1 ); +g_setenv ("QEMU_FUZZ_ARGS" , config->args,1 ); } -setenv ("QEMU_FUZZ_OBJECTS" , config->objects,1 ); +g_setenv ("QEMU_FUZZ_OBJECTS" , config->objects,1 );return generic_fuzz_cmdline (t); }
tests/qtest/libqtest.c +1 -1
@@ -1424,7 +1424,7 @@ QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch,* way, qtest_get_arch works for inproc qtest. */ gchar *bin_path =g_strconcat ("/qemu-system-" , arch,NULL ); -setenv ("QTEST_QEMU_BINARY" , bin_path,0 ); +g_setenv ("QTEST_QEMU_BINARY" , bin_path,0 );g_free (bin_path);return qts;
Signature · 1 line
2.31.1
[PULL 16/23] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
Single quotes like -prom-env 'nvramrc=cafec0de 4000 l!' in the arguments are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU prom-env option parser codes.
Change to use double quotes which works fine on all platforms.
Message-Id: <[email protected]>
--- tests/qtest/prom-env-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qtest/prom-env-test.c +2 -2
@@ -58,8 +58,8 @@ static void test_machine(const void *machine)" -machine " PSERIES_DEFAULT_CAPABILITIES ; } - qts =qtest_initf ("-M %s -accel tcg %s -prom-env 'use-nvramrc?=true' " -"-prom-env 'nvramrc=%x %x l!' " , (const char *)machine, + qts =qtest_initf ("-M %s -accel tcg %s -prom-env \"use-nvramrc?=true\" " +"-prom-env \"nvramrc=%x %x l!\" " , (const char *)machine, extra_args,MAGIC ,ADDRESS );check_guest_memory (qts);qtest_quit (qts);
Signature · 1 line
2.31.1
[PULL 11/23] tests/qtest: libqos: Drop inclusion of <sys/wait.h>
In reply to Thomas HuthFrom: Xuzhou Cheng <[email protected]>
There is no <sys/wait.h> in the Windows build environment. Actually this is not needed in the non-win32 builds too. Drop it.
Message-Id: <[email protected]>
--- tests/qtest/libqos/libqos.c | 2 -- 1 file changed, 2 deletions(-)
tests/qtest/libqos/libqos.c +0 -2
@@ -1,6 +1,4 @@#include "qemu/osdep.h" -#include <sys/wait.h> -#include "../libqtest.h" #include "libqos.h" #include "pci.h"
Signature · 1 line
2.31.1
[PULL 18/23] tests/avocado: Do not run tests that require libslirp if it is not available
In reply to Thomas HuthSome avocado tests blindly assume that QEMU has been compiled with libslirp enabled and fail badly if it is missing. Add a proper check to cancel the tests in this case.
Message-Id: <[email protected]>
--- tests/avocado/avocado_qemu/__init__.py | 7 +++++++ tests/avocado/info_usernet.py | 1 + tests/avocado/replay_linux.py | 1 + 3 files changed, 9 insertions(+)
tests/avocado/avocado_qemu/__init__.py +7 -0
@@ -299,6 +299,12 @@ def require_accelerator(self, accelerator): self.cancel("%s accelerator does not seem to be " "available" % accelerator) + def require_netdev(self, netdevname): + netdevhelp = run_cmd([self.qemu_bin, + '-M', 'none', '-netdev', 'help'])[0]; + if netdevhelp.find('\n' + netdevname + '\n') < 0: + self.cancel('no support for user networking') + def _new_vm(self, name, *args): self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_") vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
@@ -550,6 +556,7 @@ def _set_distro(self): def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'): super().setUp() + self.require_netdev('user') self._set_distro() self.vm.add_args('-smp', self.smp) self.vm.add_args('-m', self.memory)
tests/avocado/info_usernet.py +1 -0
@@ -16,6 +16,7 @@ class InfoUsernet(QemuSystemTest): def test_hostfwd(self): + self.require_netdev('user') self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22') self.vm.launch() res = self.vm.command('human-monitor-command',
tests/avocado/replay_linux.py +1 -0
@@ -55,6 +55,7 @@ def vm_add_disk(self, vm, path, id, device): '%s,drive=disk%s-rr%s' % (device, id, bus_string)) def launch_and_wait(self, record, args, shift): + self.require_netdev('user') vm = self.get_vm() vm.add_args('-smp', '1') vm.add_args('-m', '1024')
Signature · 1 line
2.31.1
[PULL 10/23] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
The test case 'test_migrate_fd_proto' calls socketpair() which does not exist on win32. Exclude it. The helper function wait_command_fd() is not needed anymore, hence exclude it too.
Message-Id: <[email protected]>
--- tests/qtest/migration-helpers.h | 2 ++ tests/qtest/migration-helpers.c | 2 ++ tests/qtest/migration-test.c | 4 ++++ 3 files changed, 8 insertions(+)
tests/qtest/migration-helpers.h +2 -0
@@ -17,8 +17,10 @@extern bool got_stop; +#ifndef _WIN32 G_GNUC_PRINTF(3, 4)QDict *wait_command_fd (QTestState *who,int fd,const char *command, ...); +#endif G_GNUC_PRINTF(2, 3)QDict *wait_command (QTestState *who,const char *command, ...);
tests/qtest/migration-helpers.c +2 -0
@@ -34,6 +34,7 @@ static void check_stop_event(QTestState *who) } } +#ifndef _WIN32/* * Events can get in the way of responses we are actually waiting for. */
@@ -58,6 +59,7 @@ QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...) return ret; } +#endif /* * Events can get in the way of responses we are actually waiting for.
tests/qtest/migration-test.c +4 -0
@@ -1631,6 +1631,7 @@ static void test_precopy_tcp_tls_x509_reject_anon_client(void)#endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ +#ifndef _WIN32static void *test_migrate_fd_start_hook (QTestState *from,QTestState *to) {
@@ -1699,6 +1700,7 @@ static void test_migrate_fd_proto(void) };test_precopy_common (&args); } +#endif /* _WIN32 */ static void do_test_validate_uuid (MigrateStart *args,bool should_fail) {
@@ -2531,7 +2533,9 @@ int main(int argc, char **argv)#endif /* CONFIG_GNUTLS */ /* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */ +#ifndef _WIN32qtest_add_func ("/migration/fd_proto" , test_migrate_fd_proto); +#endif qtest_add_func ("/migration/validate_uuid" , test_validate_uuid);qtest_add_func ("/migration/validate_uuid_error" , test_validate_uuid_error); qtest_add_func("/migration/validate_uuid_src_not_set",
Signature · 1 line
2.31.1
[PULL 19/23] tests/avocado: Fix trivial typo
In reply to Thomas HuthThe intention was likely to use "intend" instead of "indent" here.
Message-Id: <[email protected]>
--- tests/avocado/avocado_qemu/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/avocado/avocado_qemu/__init__.py +1 -1
@@ -518,7 +518,7 @@ def default_kernel_params(self): class LinuxTest(LinuxSSHMixIn, QemuSystemTest): """Facilitates having a cloud-image Linux based available. - For tests that indent to interact with guests, this is a better choice + For tests that intend to interact with guests, this is a better choice to start with than the more vanilla `QemuSystemTest` class. """
Signature · 1 line
2.31.1
[PULL 14/23] tests/qtest: machine-none-test: Use double quotes to pass the cpu option
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=0') are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU CPU option parser codes.
Change to use double quotes which works fine on all platforms.
Message-Id: <[email protected]>
--- tests/qtest/machine-none-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/machine-none-test.c +1 -1
@@ -81,7 +81,7 @@ static void test_machine_cpu_cli(void) " add it to cpus_map\n", arch);return ;/* TODO: die here to force all targets have a test */ } - qts =qtest_initf ("-machine none -cpu '%s'" , cpu_model); + qts =qtest_initf ("-machine none -cpu \"%s\"" , cpu_model); response =qtest_qmp (qts,"{ 'execute': 'quit' }" );g_assert (qdict_haskey (response,"return" ));
Signature · 1 line
2.31.1
[PULL 22/23] tests/qtest/ac97-test: Correct reference to driver
In reply to Thomas HuthFrom: Akihiko Odaki <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/ac97-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/ac97-test.c +1 -1
@@ -28,7 +28,7 @@ static void *ac97_get_driver(void *obj, const char *interface)return &ac97->dev; } -fprintf (stderr,"%s not present in e1000e\n" , interface); +fprintf (stderr,"%s not present in ac97\n" , interface);g_assert_not_reached (); }
Signature · 1 line
2.31.1
[PULL 15/23] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32
In reply to Thomas HuthFrom: Bin Meng <[email protected]>
The test cases 'test_{tx,rx}' call socketpair() which does not exist on win32. Exclude them.
Message-Id: <[email protected]>
--- tests/qtest/npcm7xx_emc-test.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/qtest/npcm7xx_emc-test.c +8 -0
@@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod)return diff; } +#ifndef _WIN32static void packet_test_clear (void *sockets) {int *test_sockets = sockets;
@@ -243,6 +244,7 @@ static int *packet_test_init(int module_num, GString *cmd_line)g_test_queue_destroy (packet_test_clear, test_sockets); return test_sockets; } +#endif /* _WIN32 */ static uint32_t emc_read (QTestState *qts,const EMCModule *mod,NPCM7xxPWMRegister regno)
@@ -250,6 +252,7 @@ static uint32_t emc_read(QTestState *qts, const EMCModule *mod,return qtest_readl (qts, mod->base_addr + regno *sizeof (uint32_t )); } +#ifndef _WIN32static void emc_write (QTestState *qts,const EMCModule *mod,NPCM7xxPWMRegister regno,uint32_t value) {
@@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const EMCModule *mod)g_message ("%s: Timeout expired" , __func__); return false; } +#endif /* _WIN32 */ /* Check emc registers are reset to default value. */ static void test_init (gconstpointer test_data)
@@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data)qtest_quit (qts); } +#ifndef _WIN32static bool emc_wait_irq (QTestState *qts,const EMCModule *mod,int step,bool is_tx) {
@@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data) qtest_quit(qts); } +#endif /* _WIN32 */ static void emc_add_test (const char *name,const TestData * td,GTestDataFunc fn)
@@ -865,8 +871,10 @@ int main(int argc, char **argv) td->module = &emc_module_list[i];add_test (init, td); +#ifndef _WIN32add_test (tx, td);add_test (rx, td); +#endif }return g_test_run ();
Signature · 1 line
2.31.1
[PULL 23/23] tests/avocado/migration: Get find_free_port() from the ports
In reply to Thomas HuthIn upstream Avocado, the find_free_port() function is not available from "network" anymore, but must be used via "ports", see:
https://github.com/avocado-framework/avocado/commit/22fc98c6ff76cc55c48
To be able to update to a newer Avocado version later, let's use the new way for accessing the find_free_port() function here.
Message-Id: <[email protected]>
--- tests/avocado/migration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/avocado/migration.py +2 -2
@@ -14,7 +14,7 @@ from avocado_qemu import QemuSystemTest from avocado import skipUnless -from avocado.utils import network +from avocado.utils.network import ports from avocado.utils import wait from avocado.utils.path import find_command
@@ -57,7 +57,7 @@ def do_migrate(self, dest_uri, src_uri=None): self.assert_migration(source_vm, dest_vm) def _get_free_port(self): - port = network.find_free_port() + port = ports.find_free_port() if port is None: self.cancel('Failed to find a free port') return port
Signature · 1 line
2.31.1
[PULL 21/23] gitlab-ci: Only use one process in Windows jobs for compilation
In reply to Thomas HuthThe Windows jobs are currently aborting at weird places - and there's the suspicion that it's due to memory constraints in the Windows containers. Let's switch to single-threaded compilation to decrease the pressure on the memory load, and to make the job more deterministic for further investigations.
Message-Id: <[email protected]>
--- .gitlab-ci.d/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
.gitlab-ci.d/windows.yml +2 -2
@@ -61,7 +61,7 @@ msys2-64bit: - .\msys64\usr\bin\bash -lc './configure --target-list=x86_64-softmmu --enable-capstone --without-default-devices' - .\msys64\usr\bin\bash -lc "sed -i '/^ROMS=/d' build/config-host.mak" - - .\msys64\usr\bin\bash -lc 'make -j2' + - .\msys64\usr\bin\bash -lc 'make' - .\msys64\usr\bin\bash -lc 'make check' msys2-32bit:
@@ -94,5 +94,5 @@ msys2-32bit: - mkdir output - cd output - ..\msys64\usr\bin\bash -lc "../configure --target-list=ppc64-softmmu" - - ..\msys64\usr\bin\bash -lc 'make -j2' + - ..\msys64\usr\bin\bash -lc 'make' - ..\msys64\usr\bin\bash -lc 'make check'
Signature · 1 line
2.31.1
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.