From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/7] iotests: nbd: Stop qemu-nbd before remaking image
Date: Thu, 12 Jul 2018 18:31:47 +0200 [thread overview]
Message-ID: <20180712163152.12521-3-kwolf@redhat.com> (raw)
In-Reply-To: <20180712163152.12521-1-kwolf@redhat.com>
From: Fam Zheng <famz@redhat.com>
197 is one example where _make_test_img is used twice without stopping
the NBD server in between. An error will occur like this:
@@ -26,9 +26,13 @@
=== Partial final cluster ===
+qemu-img: TEST_DIR/t.IMGFMT: Failed to get "resize" lock
+Is another process using the image?
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024
+Failed to find an available port: Address already in use
read 1024/1024 bytes at offset 0
Patch _make_test_img to stop the old qemu-nbd before starting a new one,
which fixes this problem, and similarly 215.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/common.rc | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index d054cb97fc..44bee16a5e 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -195,6 +195,16 @@ _use_sample_img()
fi
}
+_stop_nbd_server()
+{
+ if [ -f "${QEMU_TEST_DIR}/qemu-nbd.pid" ]; then
+ local QEMU_NBD_PID
+ read QEMU_NBD_PID < "${QEMU_TEST_DIR}/qemu-nbd.pid"
+ kill ${QEMU_NBD_PID}
+ rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid"
+ fi
+}
+
_make_test_img()
{
# extra qemu-img options can be added by tests
@@ -234,6 +244,10 @@ _make_test_img()
extra_img_options="-o $optstr $extra_img_options"
fi
+ if [ $IMGPROTO = "nbd" ]; then
+ _stop_nbd_server
+ fi
+
# XXX(hch): have global image options?
(
if [ $use_backing = 1 ]; then
@@ -274,12 +288,7 @@ _cleanup_test_img()
case "$IMGPROTO" in
nbd)
- if [ -f "${QEMU_TEST_DIR}/qemu-nbd.pid" ]; then
- local QEMU_NBD_PID
- read QEMU_NBD_PID < "${QEMU_TEST_DIR}/qemu-nbd.pid"
- kill ${QEMU_NBD_PID}
- rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid"
- fi
+ _stop_nbd_server
rm -f "$TEST_IMG_FILE"
;;
vxhs)
--
2.13.6
next prev parent reply other threads:[~2018-07-12 16:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 16:31 [Qemu-devel] [PULL 0/7] Block layer fixes for 3.0-rc1 Kevin Wolf
2018-07-12 16:31 ` [Qemu-devel] [PULL 1/7] iotests: 153: Fix dead code Kevin Wolf
2018-07-12 16:31 ` Kevin Wolf [this message]
2018-07-12 16:31 ` [Qemu-devel] [PULL 3/7] qemu-img: Document copy offloading implications with -S and -c Kevin Wolf
2018-07-12 16:31 ` [Qemu-devel] [PULL 4/7] file-posix: specify expected filetypes Kevin Wolf
2018-07-12 16:31 ` [Qemu-devel] [PULL 5/7] iotests: add test 226 for file driver types Kevin Wolf
2018-07-12 16:31 ` [Qemu-devel] [PULL 6/7] scsi-disk: Block Device Characteristics emulation fix Kevin Wolf
2018-07-12 16:31 ` [Qemu-devel] [PULL 7/7] qemu-img: align result of is_allocated_sectors Kevin Wolf
2018-07-12 17:24 ` [Qemu-devel] [PULL 0/7] Block layer fixes for 3.0-rc1 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=20180712163152.12521-3-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--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).