[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection fo
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32 |
Date: |
Wed, 24 Aug 2022 19:53:10 +0100 |
User-agent: |
Mutt/2.2.6 (2022-06-05) |
* Bin Meng (bmeng.cn@gmail.com) wrote:
> From: Bin Meng <bin.meng@windriver.com>
>
> On Windows the QEMU executable is created via CreateProcess() and IO
> redirection does not work, so we need to set MigrateStart::hide_stderr
> to false to disable adding IO redirection to the command line.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
Isn't it easier just to change the one place that tests this?
Dave
> ---
>
> tests/qtest/migration-test.c | 39 +++++++++++++++++++++++-------------
> 1 file changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index 2ae7498d5d..125d48d855 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -53,6 +53,17 @@ static bool uffd_feature_thread_id;
> */
> #define DIRTYLIMIT_TOLERANCE_RANGE 25 /* MB/s */
>
> +/*
> + * On Windows the QEMU executable is created via CreateProcess() and IO
> + * redirection does not work, so we need to set MigrateStart::hide_stderr
> + * to false to disable adding IO redirection to the command line.
> + */
> +#ifndef _WIN32
> +# define HIDE_STDERR true
> +#else
> +# define HIDE_STDERR false
> +#endif
> +
> #if defined(__linux__)
> #include <sys/syscall.h>
> #include <sys/vfs.h>
> @@ -1186,7 +1197,7 @@ static void test_postcopy_recovery_common(MigrateCommon
> *args)
> g_autofree char *uri = NULL;
>
> /* Always hide errors for postcopy recover tests since they're expected
> */
> - args->start.hide_stderr = true;
> + args->start.hide_stderr = HIDE_STDERR;
>
> if (migrate_postcopy_prepare(&from, &to, args)) {
> return;
> @@ -1287,7 +1298,7 @@ static void test_postcopy_preempt_all(void)
> static void test_baddest(void)
> {
> MigrateStart args = {
> - .hide_stderr = true
> + .hide_stderr = HIDE_STDERR
> };
> QTestState *from, *to;
>
> @@ -1410,7 +1421,7 @@ static void
> test_precopy_unix_tls_x509_default_host(void)
> g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .connect_uri = uri,
> .listen_uri = uri,
> @@ -1526,7 +1537,7 @@ static void test_precopy_tcp_tls_psk_mismatch(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "tcp:127.0.0.1:0",
> .start_hook = test_migrate_tls_psk_start_mismatch,
> @@ -1564,7 +1575,7 @@ static void
> test_precopy_tcp_tls_x509_mismatch_host(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "tcp:127.0.0.1:0",
> .start_hook = test_migrate_tls_x509_start_mismatch_host,
> @@ -1590,7 +1601,7 @@ static void
> test_precopy_tcp_tls_x509_hostile_client(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "tcp:127.0.0.1:0",
> .start_hook = test_migrate_tls_x509_start_hostile_client,
> @@ -1616,7 +1627,7 @@ static void
> test_precopy_tcp_tls_x509_reject_anon_client(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "tcp:127.0.0.1:0",
> .start_hook = test_migrate_tls_x509_start_reject_anon_client,
> @@ -1747,7 +1758,7 @@ static void test_validate_uuid_error(void)
> MigrateStart args = {
> .opts_source = "-uuid 11111111-1111-1111-1111-111111111111",
> .opts_target = "-uuid 22222222-2222-2222-2222-222222222222",
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> };
>
> do_test_validate_uuid(&args, true);
> @@ -1757,7 +1768,7 @@ static void test_validate_uuid_src_not_set(void)
> {
> MigrateStart args = {
> .opts_target = "-uuid 22222222-2222-2222-2222-222222222222",
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> };
>
> do_test_validate_uuid(&args, false);
> @@ -1767,7 +1778,7 @@ static void test_validate_uuid_dst_not_set(void)
> {
> MigrateStart args = {
> .opts_source = "-uuid 11111111-1111-1111-1111-111111111111",
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> };
>
> do_test_validate_uuid(&args, false);
> @@ -1990,7 +2001,7 @@ static void test_multifd_tcp_tls_psk_mismatch(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "defer",
> .start_hook = test_migrate_multifd_tcp_tls_psk_start_mismatch,
> @@ -2038,7 +2049,7 @@ static void
> test_multifd_tcp_tls_x509_mismatch_host(void)
> */
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "defer",
> .start_hook = test_migrate_multifd_tls_x509_start_mismatch_host,
> @@ -2062,7 +2073,7 @@ static void
> test_multifd_tcp_tls_x509_reject_anon_client(void)
> {
> MigrateCommon args = {
> .start = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> },
> .listen_uri = "defer",
> .start_hook = test_migrate_multifd_tls_x509_start_reject_anon_client,
> @@ -2088,7 +2099,7 @@ static void
> test_multifd_tcp_tls_x509_reject_anon_client(void)
> static void test_multifd_tcp_cancel(void)
> {
> MigrateStart args = {
> - .hide_stderr = true,
> + .hide_stderr = HIDE_STDERR,
> };
> QTestState *from, *to, *to2;
> QDict *rsp;
> --
> 2.34.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [PATCH 39/51] tests/qtest: virtio-net-failover: Disable migration tests for win32, (continued)
- [PATCH 39/51] tests/qtest: virtio-net-failover: Disable migration tests for win32, Bin Meng, 2022/08/24
- [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32, Bin Meng, 2022/08/24
- [PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files, Bin Meng, 2022/08/24
- [PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode, Bin Meng, 2022/08/24
- [PATCH 35/51] tests/qtest: device-plug-test: Reverse the usage of double/single quotes, Bin Meng, 2022/08/24
- [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32, Bin Meng, 2022/08/24
- Re: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32,
Dr. David Alan Gilbert <=
- [PATCH 42/51] hw/ppc: spapr: Use qemu_vfree() to free spapr->htab, Bin Meng, 2022/08/24
- [PATCH 41/51] tests/qtest: migration-test: Kill "to" after migration is canceled, Bin Meng, 2022/08/24
- [PATCH 45/51] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option, Bin Meng, 2022/08/24
- [PATCH 46/51] tests/qtest: libqtest: Replace the call to close a socket with closesocket(), Bin Meng, 2022/08/24
- [PATCH 36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option, Bin Meng, 2022/08/24