aboutsummaryrefslogtreecommitdiff
path: root/hmp-commands-info.hx
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-10-27 20:05:54 +0100
committerKevin Wolf <kwolf@redhat.com>2020-12-11 17:52:40 +0100
commitd2d5310c8e892b8b3e853e762f0d1785257e05e5 (patch)
treea12cb9d69d6e993c8809a64a2453947f2fe5db16 /hmp-commands-info.hx
parenteda7a9c5740ffe72442ce8d078f95d5fd7449c5c (diff)
downloadqemu-d2d5310c8e892b8b3e853e762f0d1785257e05e5.zip
qemu-d2d5310c8e892b8b3e853e762f0d1785257e05e5.tar.gz
qemu-d2d5310c8e892b8b3e853e762f0d1785257e05e5.tar.bz2
iotests: Let _make_test_img guess $TEST_IMG_FILE
When most iotests want to create a test image that is named differently from the default $TEST_IMG, they do something like this: TEST_IMG="$TEST_IMG.base" _make_test_img $options This works fine with the "file" protocol, but not so much for anything else: _make_test_img tries to create an image under $TEST_IMG_FILE first, and only under $TEST_IMG if the former is not set; and on everything but "file", $TEST_IMG_FILE is set. There are two ways we can fix this: First, we could make all tests adjust not only TEST_IMG, but also TEST_IMG_FILE if that is present (e.g. with something like _set_test_img_suffix $suffix that would affect not only TEST_IMG but also TEST_IMG_FILE, if necessary). This is a pretty clean solution, and this is maybe what we should have done from the start. But it would also require changes to most existing bash tests. So the alternative is this: Let _make_test_img see whether $TEST_IMG_FILE still points to the original value. If so, it is possible that the caller has adjusted $TEST_IMG but not $TEST_IMG_FILE. In such a case, we can (for most protocols) derive the corresponding $TEST_IMG_FILE value from $TEST_IMG value and thus work around what technically is the caller misbehaving. This second solution is less clean, but it is robust against people keeping their old habit of adjusting TEST_IMG only, and requires much less changes. So this patch implements it. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20201027190600.192171-15-mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hmp-commands-info.hx')
0 files changed, 0 insertions, 0 deletions