iotests: nbd: Stop qemu-nbd before remaking image
commit2f9d4083f7fdafe82138e983a24ef30b81b029d7
authorFam Zheng <famz@redhat.com>
Wed, 11 Jul 2018 06:40:46 +0000 (11 14:40 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 12 Jul 2018 16:24:08 +0000 (12 18:24 +0200)
treea06c561293fa1ab2debbe45718b7e474d3ba8de2
parent0e1a582750269d3dde0481ca034b08a5784e430c
iotests: nbd: Stop qemu-nbd before remaking image

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