From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 30/48] iotests: Add test for multiple BB on BDS tree
Date: Fri, 29 Jan 2016 18:37:36 +0100 [thread overview]
Message-ID: <1454089074-4819-31-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1454089074-4819-1-git-send-email-kwolf@redhat.com>
From: Max Reitz <mreitz@redhat.com>
This adds a test for having multiple BlockBackends in one BDS tree. In
this case, there is one BB for the protocol BDS and one BB for the
format BDS in a simple two-BDS tree (with the protocol BDS and BB added
first).
When bdrv_close_all() is executed, no cached data from any BDS should be
lost; the protocol BDS may not be closed until the format BDS is closed.
Otherwise, metadata updates may be lost.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/117 | 86 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/117.out | 14 ++++++++
tests/qemu-iotests/group | 1 +
3 files changed, 101 insertions(+)
create mode 100755 tests/qemu-iotests/117
create mode 100644 tests/qemu-iotests/117.out
diff --git a/tests/qemu-iotests/117 b/tests/qemu-iotests/117
new file mode 100755
index 0000000..969750d
--- /dev/null
+++ b/tests/qemu-iotests/117
@@ -0,0 +1,86 @@
+#!/bin/bash
+#
+# Test case for shared BDS between backend trees
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# 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=mreitz@redhat.com
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+_supported_fmt qcow2
+_supported_proto file
+_supported_os Linux
+
+_make_test_img 64k
+
+_launch_qemu
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{ 'execute': 'qmp_capabilities' }" \
+ 'return'
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{ 'execute': 'blockdev-add',
+ 'arguments': { 'options': { 'id': 'protocol',
+ 'driver': 'file',
+ 'filename': '$TEST_IMG' } } }" \
+ 'return'
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{ 'execute': 'blockdev-add',
+ 'arguments': { 'options': { 'id': 'format',
+ 'driver': '$IMGFMT',
+ 'file': 'protocol' } } }" \
+ 'return'
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{ 'execute': 'human-monitor-command',
+ 'arguments': { 'command-line': 'qemu-io format \"write -P 42 0 64k\"' } }" \
+ 'return'
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{ 'execute': 'quit' }" \
+ 'return'
+
+wait=1 _cleanup_qemu
+
+_check_test_img
+
+$QEMU_IO -c 'read -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io
+
+# success, all done
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/117.out b/tests/qemu-iotests/117.out
new file mode 100644
index 0000000..f52dc1a
--- /dev/null
+++ b/tests/qemu-iotests/117.out
@@ -0,0 +1,14 @@
+QA output created by 117
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536
+{"return": {}}
+{"return": {}}
+{"return": {}}
+wrote 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+{"return": ""}
+{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
+No errors were found on the image.
+read 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index ff1ff0d..e89f076 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -122,6 +122,7 @@
114 rw auto quick
115 rw auto
116 rw auto quick
+117 rw auto
118 rw auto
119 rw auto quick
120 rw auto quick
--
1.8.3.1
next prev parent reply other threads:[~2016-01-29 17:38 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 17:37 [Qemu-devel] [PULL 00/48] Block patches Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 01/48] block: Add blk_dev_has_tray() Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 02/48] blockdev: Fix 'change' for slot devices Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 03/48] Revert "hw/block/fdc: Implement tray status" Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 04/48] block/qapi: Emit tray_open only if there is a tray Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 05/48] vmdk: Fix converting to streamOptimized Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 06/48] iotests: Limit supported formats for 118 Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 07/48] nbd: client_close on error in nbd_co_client_start Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 08/48] iotests: Rename filter_nbd to _filter_nbd in 083 Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 09/48] iotests: Change coding style of " Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 10/48] iotests: Move _filter_nbd into common.filter Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 11/48] iotests: Make _filter_nbd drop log lines Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 12/48] iotests: Make _filter_nbd support more URL types Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 13/48] iotests: Make redirecting qemu's stderr optional Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 14/48] iotests: Add test for a nonexistent NBD export Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 15/48] block: Remove unused struct definition BlockFinishData Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 16/48] block: Release named dirty bitmaps in bdrv_close() Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 17/48] iotests: Add test for eject under NBD server Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 18/48] block: Add BB-BDS remove/insert notifiers Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 19/48] virtio-blk: Functions for op blocker management Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 20/48] virtio-scsi: Catch BDS-BB removal/insertion Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 21/48] nbd: Switch from close to eject notifier Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 22/48] block: Remove BDS close notifier Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 23/48] block: Use blk_remove_bs() in blk_delete() Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 24/48] blockdev: Use blk_remove_bs() in do_drive_del() Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 25/48] block: Make bdrv_close() static Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 26/48] block: Add list of all BlockDriverStates Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 27/48] blockdev: Keep track of monitor-owned BDS Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 28/48] block: Add blk_remove_all_bs() Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 29/48] block: Rewrite bdrv_close_all() Kevin Wolf
2016-01-29 17:37 ` Kevin Wolf [this message]
2016-01-29 17:37 ` [Qemu-devel] [PULL 31/48] iotests: Add test for block jobs and BDS ejection Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 32/48] block: acquire in bdrv_query_image_info Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 33/48] block: Add "file" output parameter to block status query functions Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 34/48] qcow: Assign bs->file->bs to file in qcow_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 35/48] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 36/48] raw: Assign bs to file in raw_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 37/48] iscsi: Assign bs to file in iscsi_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 38/48] parallels: Assign bs->file->bs to file in parallels_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 39/48] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 40/48] sheepdog: Assign bs to file in sd_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 41/48] vdi: Assign bs->file->bs to file in vdi_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 42/48] vpc: Assign bs->file->bs to file in vpc_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 43/48] vmdk: Fix calculation of block status's offset Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 44/48] vmdk: Return extent's file in bdrv_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 45/48] block: Use returned *file in bdrv_co_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 46/48] qemu-img: In "map", use the returned "file" from bdrv_get_block_status Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 47/48] qemu-img: Make MapEntry a QAPI struct Kevin Wolf
2016-01-29 17:37 ` [Qemu-devel] [PULL 48/48] iotests: Add "qemu-img map" test for VMDK extents Kevin Wolf
2016-01-29 17:59 ` [Qemu-devel] [PULL 00/48] Block patches Peter Maydell
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=1454089074-4819-31-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).