qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: qemu-devel@nongnu.org, Bin Meng <bin.meng@windriver.com>,
	Juan Quintela <quintela@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32
Date: Wed, 24 Aug 2022 19:53:10 +0100	[thread overview]
Message-ID: <YwZzlkoJOFxs7Uyy@work-vm> (raw)
In-Reply-To: <20220824094029.1634519-38-bmeng.cn@gmail.com>

* 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



  reply	other threads:[~2022-08-24 18:54 UTC|newest]

Thread overview: 174+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  9:39 [PATCH 00/51] tests/qtest: Enable running qtest on Windows Bin Meng
2022-08-24  9:39 ` [PATCH 01/51] tests/qtest: Use g_setenv() Bin Meng
2022-08-24 11:45   ` Thomas Huth
2022-09-04 14:10   ` Philippe Mathieu-Daudé via
2022-08-24  9:39 ` [PATCH 02/51] tests/qtest: Use g_mkdtemp() Bin Meng
2022-08-24 14:42   ` Thomas Huth
2022-08-24  9:39 ` [PATCH 03/51] block: Unify the get_tmp_filename() implementation Bin Meng
2022-08-31 12:54   ` Marc-André Lureau
2022-08-31 13:19     ` Daniel P. Berrangé
2022-09-01  6:41     ` Bin Meng
2022-08-24  9:39 ` [PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp Bin Meng
2022-08-31 12:59   ` Marc-André Lureau
2022-09-01  7:11     ` Bin Meng
2022-09-01  9:20       ` Richard Henderson
2022-08-24  9:39 ` [PATCH 05/51] tcg: " Bin Meng
2022-08-31 13:02   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 06/51] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files Bin Meng
2022-08-31 13:05   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases Bin Meng
2022-08-24 17:51   ` Dr. David Alan Gilbert
2022-08-25  8:41   ` Thomas Huth
2022-08-24  9:39 ` [PATCH 08/51] block/vvfat: Unify the mkdir() call Bin Meng
2022-08-31 13:08   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents() Bin Meng
2022-08-26 10:09   ` Christian Schoenebeck
2022-08-26 10:30     ` Bin Meng
2022-08-26 11:16       ` Christian Schoenebeck
2022-08-26 12:38         ` Bin Meng
2022-08-26 13:27           ` Christian Schoenebeck
2022-08-24  9:39 ` [PATCH 10/51] hw/usb: dev-mtp: " Bin Meng
2022-08-31 13:09   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 11/51] qga/commands-posix-ssh: " Bin Meng
2022-08-24 14:41   ` Konstantin Kostiuk
2022-08-26 14:46     ` Bin Meng
2022-08-24  9:39 ` [PATCH 12/51] tests: " Bin Meng
2022-08-24 17:58   ` Dr. David Alan Gilbert
2022-08-26 14:49     ` Bin Meng
2022-08-24  9:39 ` [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32 Bin Meng
2022-08-24 18:41   ` Dr. David Alan Gilbert
2022-08-24  9:39 ` [PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32 Bin Meng
2022-08-24 12:35   ` Stefan Berger
2022-08-31 13:20     ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 15/51] tests/qtest: Adapt {m48t59,rtc}-test cases for win32 Bin Meng
2022-08-25  8:20   ` Thomas Huth
2022-08-24  9:39 ` [PATCH 16/51] tests/qtest: Build e1000e-test for posix only Bin Meng
2022-08-25 10:59   ` Thomas Huth
2022-08-24  9:39 ` [PATCH 17/51] tests/qtest: Build virtio-net-test " Bin Meng
2022-08-25 11:27   ` Thomas Huth
2022-08-31 13:25   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 18/51] tests/qtest: Build cases that use memory-backend-file " Bin Meng
2022-08-25 12:39   ` Thomas Huth
2022-08-24  9:39 ` [PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases " Bin Meng
2022-08-25 11:37   ` Thomas Huth
2022-08-31 13:27   ` Marc-André Lureau
2022-08-24  9:39 ` [PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32 Bin Meng
2022-08-25 11:40   ` [PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios,pflash} " Thomas Huth
2022-08-31 13:40   ` [PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios, pflash} " Marc-André Lureau
2022-09-02  8:29     ` Bin Meng
2022-08-24  9:39 ` [PATCH 21/51] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32 Bin Meng
2022-08-24 18:49   ` Dr. David Alan Gilbert
2022-09-04 14:15   ` Philippe Mathieu-Daudé via
2022-08-24  9:40 ` [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32 Bin Meng
2022-08-25 11:45   ` Thomas Huth
2022-08-29 13:14   ` Markus Armbruster
2022-08-29 14:23     ` Bin Meng
2022-08-29 15:06       ` Markus Armbruster
2022-09-04 14:07         ` Philippe Mathieu-Daudé via
2022-08-24  9:40 ` [PATCH 23/51] accel/qtest: Support qtest accelerator for Windows Bin Meng
2022-08-31 13:49   ` Marc-André Lureau
2022-09-02  8:28     ` Bin Meng
2022-08-24  9:40 ` [PATCH 24/51] tests/qtest: libqos: Drop inclusion of <sys/wait.h> Bin Meng
2022-08-25 11:55   ` Thomas Huth
2022-08-31 13:50   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 25/51] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h Bin Meng
2022-08-25 11:51   ` Thomas Huth
2022-08-31 13:51   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 26/51] tests/qtest: libqtest: Move global_qtest definition back to libqtest.c Bin Meng
2022-08-25 11:59   ` Thomas Huth
2022-08-24  9:40 ` [PATCH 27/51] tests/qtest: Use send/recv for socket communication Bin Meng
2022-08-25 13:04   ` Thomas Huth
2022-08-26 14:59     ` Bin Meng
2022-08-26 18:26       ` Thomas Huth
2022-08-31 14:05         ` Marc-André Lureau
2022-08-31 14:19           ` Daniel P. Berrangé
2022-09-02 14:24           ` Bin Meng
2022-08-24  9:40 ` [PATCH 28/51] tests/qtest: libqtest: Exclude the *_fds APIs for win32 Bin Meng
2022-08-31 14:10   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 29/51] tests/qtest: libqtest: Install signal handler via signal() Bin Meng
2022-08-31 14:16   ` Marc-André Lureau
2022-09-02 15:49     ` Bin Meng
2022-08-24  9:40 ` [PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices' Bin Meng
2022-08-25 12:03   ` Thomas Huth
2022-09-02 15:18     ` Bin Meng
2022-08-24  9:40 ` [PATCH 31/51] tests/qtest: Support libqtest to build and run on Windows Bin Meng
2022-08-31 16:28   ` Marc-André Lureau
2022-09-19 10:00     ` Bin Meng
2022-09-01 11:38   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32 Bin Meng
2022-08-25 12:06   ` Thomas Huth
2022-09-02 10:59     ` Bin Meng
2022-09-01  8:42   ` Marc-André Lureau
2022-09-02 11:02     ` Bin Meng
2022-08-24  9:40 ` [PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files Bin Meng
2022-09-01  8:58   ` Marc-André Lureau
2022-09-03 13:30     ` Bin Meng
2022-08-24  9:40 ` [PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32 Bin Meng
2022-08-24 12:42   ` Ani Sinha
2022-08-26 10:38     ` Bin Meng
2022-09-01  9:05   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 35/51] tests/qtest: device-plug-test: Reverse the usage of double/single quotes Bin Meng
2022-08-25 12:20   ` Thomas Huth
2022-08-24  9:40 ` [PATCH 36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option Bin Meng
2022-08-25 12:22   ` Thomas Huth
2022-08-24  9:40 ` [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32 Bin Meng
2022-08-24 18:53   ` Dr. David Alan Gilbert [this message]
2022-08-26 10:48     ` Bin Meng
2022-08-24  9:40 ` [PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode Bin Meng
2022-08-25 12:28   ` Thomas Huth
2022-09-01  9:08   ` [PATCH 38/51] tests/qtest: {ahci, ide}-test: " Marc-André Lureau
2022-08-24  9:40 ` [PATCH 39/51] tests/qtest: virtio-net-failover: Disable migration tests for win32 Bin Meng
2022-08-24  9:40 ` [PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file " Bin Meng
2022-08-25  7:58   ` Marc-André Lureau
2022-08-26 13:15     ` Bin Meng
2022-08-26 13:23       ` Marc-André Lureau
2022-08-27 23:19         ` Bin Meng
2022-08-30 12:30           ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 41/51] tests/qtest: migration-test: Kill "to" after migration is canceled Bin Meng
2022-08-24 18:56   ` Dr. David Alan Gilbert
2022-09-01 11:35     ` Marc-André Lureau
2022-09-02 16:33       ` Bin Meng
2022-08-24  9:40 ` [PATCH 42/51] hw/ppc: spapr: Use qemu_vfree() to free spapr->htab Bin Meng
2022-08-24 17:32   ` Daniel Henrique Barboza
2022-09-01 11:40   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32 Bin Meng
2022-08-25 12:32   ` [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx,rx} " Thomas Huth
2022-08-25 16:40   ` [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} " Hao Wu
2022-08-24  9:40 ` [PATCH 44/51] tests/qtest: microbit-test: Fix socket access for win32 Bin Meng
2022-09-01 11:44   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 45/51] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option Bin Meng
2022-08-25 12:33   ` Thomas Huth
2022-08-24  9:40 ` [PATCH 46/51] tests/qtest: libqtest: Replace the call to close a socket with closesocket() Bin Meng
2022-09-01 11:46   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 47/51] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32 Bin Meng
2022-09-01 11:57   ` Marc-André Lureau
2022-08-24  9:40 ` [PATCH 48/51] io/channel-watch: Drop a superfluous '#ifdef WIN32' Bin Meng
2022-09-01 12:24   ` Marc-André Lureau
2022-10-17 12:34   ` Daniel P. Berrangé
2022-08-24  9:40 ` [PATCH 49/51] io/channel-watch: Fix socket watch on Windows Bin Meng
2022-09-01 12:58   ` Marc-André Lureau
2022-09-04  6:24     ` Bin Meng
2022-09-05  6:04       ` Marc-André Lureau
2022-09-05  6:13         ` Bin Meng
2022-09-05  8:10           ` Clément Chigot
2022-09-06  7:00             ` Bin Meng
2022-09-06  7:41               ` Clément Chigot
2022-09-06  8:14                 ` Bin Meng
2022-09-06 12:06                   ` Clément Chigot
2022-09-07  5:07                     ` Bin Meng
2022-09-14  8:08                       ` Bin Meng
2022-09-21  1:02                         ` Bin Meng
2022-09-28  6:10                           ` Bin Meng
2022-10-06  3:03                             ` Bin Meng
2022-10-11 10:42                               ` Bin Meng
2022-10-17 12:21                                 ` Bin Meng
2022-10-17 12:30                                   ` Daniel P. Berrangé
2022-10-17 13:03                                     ` Bin Meng
2022-10-17 13:29                                       ` Daniel P. Berrangé
2022-10-17 12:35   ` Daniel P. Berrangé
2022-08-24  9:40 ` [PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit Bin Meng
2022-08-25  8:18   ` Thomas Huth
2022-08-26 11:25     ` Bin Meng
2022-08-26 11:33     ` Daniel P. Berrangé
2022-08-24  9:40 ` [PATCH 51/51] docs/devel: testing: Document writing portable test cases Bin Meng
2022-09-01 13:02   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YwZzlkoJOFxs7Uyy@work-vm \
    --to=dgilbert@redhat.com \
    --cc=bin.meng@windriver.com \
    --cc=bmeng.cn@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).