All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCHv2 5/6] block: add qemu-iotest for write-merge parameter
Date: Thu, 23 Oct 2014 11:59:34 +0200	[thread overview]
Message-ID: <5448D186.8030307@redhat.com> (raw)
In-Reply-To: <1413984120-21830-6-git-send-email-pl@kamp.de>

On 2014-10-22 at 15:21, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>   tests/qemu-iotests/108     |  108 ++++++++++++++++++++++++++++++++++++++++++++

It's a pity, but 108 is already taken (by me and on Kevin's block branch 
at least). 108 having 108 lines would have been nice, though.

>   tests/qemu-iotests/108.out |   63 ++++++++++++++++++++++++++
>   tests/qemu-iotests/group   |    1 +
>   3 files changed, 172 insertions(+)
>   create mode 100755 tests/qemu-iotests/108
>   create mode 100644 tests/qemu-iotests/108.out
>
> diff --git a/tests/qemu-iotests/108 b/tests/qemu-iotests/108
> new file mode 100755
> index 0000000..34da1fb
> --- /dev/null
> +++ b/tests/qemu-iotests/108
> @@ -0,0 +1,108 @@
> +#!/bin/bash
> +#
> +# Test if write-merging parameter is applied correctly
> +#
> +# Copyright (C) 2014 Peter Lieven <pl@kamp.de>
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +#
> +
> +# creator
> +owner=pl@kamp.de
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
> +
> +_supported_fmt raw
> +_supported_proto file
> +_supported_os Linux
> +
> +function do_run_qemu()
> +{
> +    echo Testing: "$@"
> +    $QEMU -nographic -qmp stdio -serial none "$@"
> +    echo
> +}
> +
> +function run_qemu()
> +{
> +    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp
> +}
> +
> +size=128M
> +
> +_make_test_img $size
> +
> +echo
> +echo === write-merging not specified ===
> +echo
> +
> +run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk,node-name=root,file.node-name=file -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF

Any reason you're creating a device? query-named-block-nodes works 
without, too.

> +{ "execute": "qmp_capabilities" }
> +{ "execute": "query-named-block-nodes" }
> +{ "execute": "quit" }
> +EOF
> +
> +echo
> +echo === write-merging set to on ===
> +echo
> +
> +run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk,node-name=root,file.node-name=file,write-merging=on -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF
> +{ "execute": "qmp_capabilities" }
> +{ "execute": "query-block" }
> +{ "execute": "quit" }
> +EOF
> +
> +echo
> +echo === write-merging set to off ===
> +echo
> +
> +run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk,node-name=root,file.node-name=file,write-merging=off -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF
> +{ "execute": "qmp_capabilities" }
> +{ "execute": "query-block" }
> +{ "execute": "quit" }
> +EOF
> +
> +echo
> +echo === file.write-merging set to on ===
> +echo
> +
> +run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk,node-name=root,file.node-name=file,file.write-merging=on -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF
> +{ "execute": "qmp_capabilities" }
> +{ "execute": "query-block" }

You should be using query-named-block-nodes here (and probably 
everywhere else, too). See the test output for the next case, which 
never says anything about write-merging being off (aside from the 
beautiful json file name). [0]

> +{ "execute": "quit" }
> +EOF
> +
> +echo
> +echo === file.write-merging set to off ===
> +echo
> +
> +run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk,node-name=root,file.node-name=file,file.write-merging=off -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF
> +{ "execute": "qmp_capabilities" }
> +{ "execute": "query-block" }
> +{ "execute": "quit" }
> +EOF
> +
> +# success, all done
> +echo "*** done"
> +rm -f $seq.full
> +status=0
> diff --git a/tests/qemu-iotests/108.out b/tests/qemu-iotests/108.out
> new file mode 100644
> index 0000000..4fa687a
> --- /dev/null
> +++ b/tests/qemu-iotests/108.out
> @@ -0,0 +1,63 @@
> +QA output created by 108
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> +
> +=== write-merging not specified ===
> +
> +Testing: -drive file=TEST_DIR/t.raw,format=raw,if=none,id=disk,node-name=root,file.node-name=file -device virtio-blk-pci,drive=disk,id=virtio0
> +QMP_VERSION
> +{"return": {}}
> +{"return": [{"iops_rd": 0, "detect_zeroes": "off", "write_merging": true, "image": {}, "iops_wr": 0, "ro": false, "node-name": "root", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.raw", "encryption_key_missing": false}, {"iops_rd": 0, "detect_zeroes": "off", "write_merging": true, "image": {}, "iops_wr": 0, "ro": false, "node-name": "file", "backing_file_depth": 0, "drv": "file", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.raw", "encryption_key_missing": false}]}
> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> +
> +
> +=== write-merging set to on ===
> +
> +Testing: -drive file=TEST_DIR/t.raw,format=raw,if=none,id=disk,node-name=root,file.node-name=file,write-merging=on -device virtio-blk-pci,drive=disk,id=virtio0
> +QMP_VERSION
> +{"return": {}}
> +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "write_merging": true, "image": {"virtual-size": 134217728, "filename": "json:{\"write-merging\": \"on\", \"driver\": \"raw\", \"file\": {\"driver\": \"file\", \"filename\": \"TEST_DIR/t.raw\"}}", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "root", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "json:{\"write-merging\": \"on\", \"driver\": \"raw\", \"file\": {\"driver\": \"file\", \"filename\": \"TEST_DIR/t.raw\"}}", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "remo
>   vable":
>   true, "tray_open": false, "type": "unknown"}]}

Just so you know, this line (and some more) has been split because of 
email™. Therefore, this patch doesn't apply until fixed manually. It 
might be worth specifying some branch on some repo where we can pull 
this series from.

> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> +
> +
> +=== write-merging set to off ===
> +
> +Testing: -drive file=TEST_DIR/t.raw,format=raw,if=none,id=disk,node-name=root,file.node-name=file,write-merging=off -device virtio-blk-pci,drive=disk,id=virtio0
> +QMP_VERSION
> +{"return": {}}
> +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "write_merging": false, "image": {"virtual-size": 134217728, "filename": "json:{\"write-merging\": \"off\", \"driver\": \"raw\", \"file\": {\"driver\": \"file\", \"filename\": \"TEST_DIR/t.raw\"}}", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "root", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "json:{\"write-merging\": \"off\", \"driver\": \"raw\", \"file\": {\"driver\": \"file\", \"filename\": \"TEST_DIR/t.raw\"}}", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "r
>   emovable
>   ": true, "tray_open": false, "type": "unknown"}]}
> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> +
> +
> +=== file.write-merging set to on ===
> +
> +Testing: -drive file=TEST_DIR/t.raw,format=raw,if=none,id=disk,node-name=root,file.node-name=file,file.write-merging=on -device virtio-blk-pci,drive=disk,id=virtio0
> +QMP_VERSION
> +{"return": {}}
> +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "write_merging": true, "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.raw", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "root", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.raw", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}
> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> +
> +
> +=== file.write-merging set to off ===
> +
> +Testing: -drive file=TEST_DIR/t.raw,format=raw,if=none,id=disk,node-name=root,file.node-name=file,file.write-merging=off -device virtio-blk-pci,drive=disk,id=virtio0
> +QMP_VERSION
> +{"return": {}}
> +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "write_merging": true, "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.raw", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "root", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.raw", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}

[0] No '"write_merging": false' here...

Max

> +{"return": {}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
> +{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
> +
> +*** done
> diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
> index b230996..be2054f 100644
> --- a/tests/qemu-iotests/group
> +++ b/tests/qemu-iotests/group
> @@ -106,3 +106,4 @@
>   103 rw auto quick
>   104 rw auto
>   105 rw auto quick
> +108 rw auto quick

  reply	other threads:[~2014-10-23  9:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 13:21 [Qemu-devel] [PATCHv2 0/6] multiwrite patches for 2.2 Peter Lieven
2014-10-22 13:21 ` [Qemu-devel] [PATCHv2 1/6] block: add accounting for merged requests Peter Lieven
2014-10-22 18:20   ` Eric Blake
2014-10-22 20:22     ` Peter Lieven
2014-10-22 13:21 ` [Qemu-devel] [PATCHv2 2/6] block: introduce bdrv_runtime_opts Peter Lieven
2014-10-22 13:21 ` [Qemu-devel] [PATCHv2 3/6] block: add a knob to disable multiwrite_merge Peter Lieven
2014-10-22 18:29   ` Eric Blake
2014-10-22 20:24     ` Peter Lieven
2014-10-22 13:21 ` [Qemu-devel] [PATCHv2 4/6] hw/virtio-blk: add a constant for max number of merged requests Peter Lieven
2014-10-22 13:21 ` [Qemu-devel] [PATCHv2 5/6] block: add qemu-iotest for write-merge parameter Peter Lieven
2014-10-23  9:59   ` Max Reitz [this message]
2014-10-22 13:22 ` [Qemu-devel] [PATCHv2 6/6] block: fix qemu-iotest reference output for test 067 Peter Lieven
2014-10-23 10:03   ` 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=5448D186.8030307@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pl@kamp.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.