qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 02/11] iotests: Do not redirect qemu's stderr
Date: Wed, 25 Feb 2015 15:04:21 +0800	[thread overview]
Message-ID: <20150225070421.GF5293@ad.nay.redhat.com> (raw)
In-Reply-To: <1424792164-2130-3-git-send-email-mreitz@redhat.com>

On Tue, 02/24 10:35, Max Reitz wrote:
> Redirecting qemu's stderr to stdout makes working with the stderr output
> difficult due to the other file descriptor magic performed in
> _launch_qemu ("ambiguous redirect").
> 
> There is no harm in leaving stderr on stderr, so do it.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> If someone has a better solution, especially regarding the redirection
> to a subshell here (tests 091 and 109) and in the next patch, I'd be
> very grateful. All of my efforts to pipe the output of the _launch_qemu
> function resulted in said error ("ambiguous redirect"), so I had to keep
> it on stderr and I did not find another way to pipe stderr to another
> program.

It will be much less hacky if we compare to a separate stderr reference
(tests/qemu-iotests/109.err), similiar to QAPI tests, or just ignore stderr
where we don't really care.

> ---
>  tests/qemu-iotests/091         |  3 +-
>  tests/qemu-iotests/109         |  3 +-
>  tests/qemu-iotests/109.out     | 66 +++++++++++++++++++++---------------------
>  tests/qemu-iotests/common.qemu |  1 -
>  4 files changed, 37 insertions(+), 36 deletions(-)
> 
> diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091
> index 32bbd56..caea1ce 100755
> --- a/tests/qemu-iotests/091
> +++ b/tests/qemu-iotests/091
> @@ -68,7 +68,8 @@ echo
>  echo === Starting QEMU VM2 ===
>  echo
>  _launch_qemu -drive file="${TEST_IMG}",cache=${CACHEMODE},id=disk \
> -             -incoming "exec: cat '${MIG_FIFO}'"
> +             -incoming "exec: cat '${MIG_FIFO}'" \
> +    2> >(grep -v 'cat: write error')
>  h2=$QEMU_HANDLE
>  
>  echo
> diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
> index 0b668da..5a23862 100755
> --- a/tests/qemu-iotests/109
> +++ b/tests/qemu-iotests/109
> @@ -53,7 +53,8 @@ function run_qemu()
>      local qmp_format="$3"
>      local qmp_event="$4"
>  
> -    _launch_qemu -drive file="${source_img}",format=raw,cache=${CACHEMODE},id=src
> +    _launch_qemu -drive file="${source_img}",format=raw,cache=${CACHEMODE},id=src \
> +        2> >(_filter_testdir | _filter_imgfmt)
>      _send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'qmp_capabilities' }" "return"
>  
>      _send_qemu_cmd $QEMU_HANDLE \
> diff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out
> index 7db92c9..9dd1d19 100644
> --- a/tests/qemu-iotests/109.out
> +++ b/tests/qemu-iotests/109.out
> @@ -5,13 +5,13 @@ QA output created by 109
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 1024, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -26,13 +26,13 @@ Images are identical.
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 197120, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -47,13 +47,13 @@ Images are identical.
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -68,13 +68,13 @@ Images are identical.
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 1024, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -89,13 +89,13 @@ Images are identical.
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 65536, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -110,13 +110,13 @@ Images are identical.
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -130,13 +130,13 @@ Images are identical.
>  
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -151,13 +151,13 @@ Images are identical.
>  
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 31457280, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -172,13 +172,13 @@ Images are identical.
>  
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -193,13 +193,13 @@ Images are identical.
>  
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_ERROR", "data": {"device": "src", "operation": "write", "action": "report"}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2048, "offset": 0, "speed": 0, "type": "mirror", "error": "Operation not permitted"}}
>  {"return": []}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  read 65536/65536 bytes at offset 0
>  64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  {"return": {}}
> @@ -214,12 +214,12 @@ Images are identical.
>  
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
>  {"return": {}}
> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
> -Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
> -Specify the 'raw' format explicitly to remove the restrictions.
>  {"return": {}}
>  {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 512, "offset": 512, "speed": 0, "type": "mirror"}}
>  {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 512, "offset": 512, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]}
> +WARNING: Image format was not specified for 'TEST_DIR/t.IMGFMT' and probing guessed IMGFMT.
> +         Automatically detecting the format is dangerous for IMGFMT images, write operations on block 0 will be restricted.
> +         Specify the 'IMGFMT' format explicitly to remove the restrictions.
>  Warning: Image size mismatch!
>  Images are identical.
>  {"return": {}}
> diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
> index 4e1996c..5f10c1e 100644
> --- a/tests/qemu-iotests/common.qemu
> +++ b/tests/qemu-iotests/common.qemu
> @@ -155,7 +155,6 @@ function _launch_qemu()
>  
>      "${QEMU}" -nographic -serial none ${comm} -machine accel=qtest "${@}" \
>                                                                  >"${fifo_out}" \
> -                                                                2>&1 \
>                                                                  <"${fifo_in}" &
>      QEMU_PID[${_QEMU_HANDLE}]=$!
>  
> -- 
> 2.1.0
> 
> 

  reply	other threads:[~2015-02-25  7:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 15:35 [Qemu-devel] [PATCH v3 00/11] block: Rework bdrv_close_all() Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 01/11] iotests: Move _filter_nbd into common.filter Max Reitz
2015-02-25  6:46   ` Fam Zheng
2015-02-25 13:53     ` Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 02/11] iotests: Do not redirect qemu's stderr Max Reitz
2015-02-25  7:04   ` Fam Zheng [this message]
2015-02-25 14:01     ` Max Reitz
2015-02-26  2:29       ` Fam Zheng
2015-02-26 14:03         ` Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 03/11] iotests: Add test for eject under NBD server Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 04/11] quorum: Fix close path Max Reitz
2015-02-25  7:12   ` Fam Zheng
2015-02-25 14:08     ` Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 05/11] block: Move BDS close notifiers into BB Max Reitz
2015-02-25  7:52   ` Fam Zheng
2015-02-25 14:12     ` Max Reitz
2015-02-26  2:19       ` Fam Zheng
2015-02-26 13:59         ` Max Reitz
2015-02-24 15:35 ` [Qemu-devel] [PATCH v3 06/11] block: Use blk_remove_bs() in blk_delete() Max Reitz
2015-02-24 15:36 ` [Qemu-devel] [PATCH v3 07/11] blockdev: Use blk_remove_bs() in do_drive_del() Max Reitz
2015-02-24 15:36 ` [Qemu-devel] [PATCH v3 08/11] block: Make bdrv_close() static Max Reitz
2015-02-24 15:36 ` [Qemu-devel] [PATCH v3 09/11] blockdev: Keep track of monitor-owned BDS Max Reitz
2015-02-24 15:36 ` [Qemu-devel] [PATCH v3 10/11] block: Eject BDS tree from BB at bdrv_close_all() Max Reitz
2015-02-24 15:36 ` [Qemu-devel] [PATCH v3 11/11] iotests: Add test for multiple BB on BDS tree Max Reitz

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=20150225070421.GF5293@ad.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).