summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-04-20 16:43:53 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-04-20 16:43:53 +0100
commitbefbaf51ced6702170d568b07e2551399223ca3b (patch)
treea9745ff80384cca194d1c6123e8c7366cf33ed46 /tests/qemu-iotests/iotests.py
parentfa59dd95829bc33d591274e98db5bb762ba1a2a0 (diff)
parent8ca92f3c069558897269e609e4f47bd6255d6339 (diff)
downloadqemu-befbaf51ced6702170d568b07e2551399223ca3b.tar.gz
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Mirror block job fixes for 2.6.0-rc3 # gpg: Signature made Wed 20 Apr 2016 15:56:43 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: iotests: Test case for drive-mirror with unaligned image size iotests: Add iotests.image_size mirror: Don't extend the last sub-chunk block/mirror: Refresh stale bitmap iterator cache block/mirror: Revive dead yielding code Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index d9ef60ef03..56f988ab3d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -28,6 +28,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts', '
import qmp
import qtest
import struct
+import json
# This will not work if arguments contain spaces but is necessary if we
@@ -103,6 +104,11 @@ def create_image(name, size):
i = i + 512
file.close()
+def image_size(img):
+ '''Return image's virtual size'''
+ r = qemu_img_pipe('info', '--output=json', '-f', imgfmt, img)
+ return json.loads(r)['virtual-size']
+
test_dir_re = re.compile(r"%s" % test_dir)
def filter_test_dir(msg):
return test_dir_re.sub("TEST_DIR", msg)