[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 4/5] iotests: Add iotests.image_size
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 4/5] iotests: Add iotests.image_size |
Date: |
Wed, 20 Apr 2016 17:03:31 +0200 |
From: Fam Zheng <address@hidden>
This retrieves the virtual size of the image out of qemu-img info.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/iotests.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index d9ef60e..56f988a 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)
--
1.8.3.1
- [Qemu-block] [PULL 0/5] Mirror block job fixes for 2.6.0-rc3, Kevin Wolf, 2016/04/20
- [Qemu-block] [PULL 5/5] iotests: Test case for drive-mirror with unaligned image size, Kevin Wolf, 2016/04/20
- [Qemu-block] [PULL 1/5] block/mirror: Revive dead yielding code, Kevin Wolf, 2016/04/20
- [Qemu-block] [PULL 3/5] mirror: Don't extend the last sub-chunk, Kevin Wolf, 2016/04/20
- [Qemu-block] [PULL 2/5] block/mirror: Refresh stale bitmap iterator cache, Kevin Wolf, 2016/04/20
- [Qemu-block] [PULL 4/5] iotests: Add iotests.image_size,
Kevin Wolf <=
- Re: [Qemu-block] [PULL 0/5] Mirror block job fixes for 2.6.0-rc3, Peter Maydell, 2016/04/20