mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
Block layer patches
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJazM/UAAoJEH8JsnLIjy/WOawP/3Y7LeEcINgDmGUc5qjmmsuT MQ9E3rFK14FWUjpqj+eXVuHPLIeTZRP6BFsoAh0oS1PkgxSbZkznjO0DeuNAbtZj RgUqRjq74UZeTqmCJ/J4bvDVgkA+h/xIf8Sp8lnV8ILaLzzy1JZNj/y8W+E3r9fQ 9zadVAhvpr0P60wCzPKqCZh5EKovf79uWxccdKonE5dweK1emzyM1W9jkoI0Acr8 MJ6P54I/xh8yc/3kavDpFJaUI9wEXOqRvhykQYJCjsCk6EOjy841kkx/01bx4Tty IhItPR9l4rgELezj/nqRYwp+sFkmdpmycuOuVvD1p4ScvE9ExG19rnGY3YQhZSUw oTUFhRNcCqaP2kmaQgwzMgXgQcfpNa3HX5E9gou85MMabfF51xWTgngj5d0iWtYT HrjbeBNLh+nijpodSergMD7/3jownabKGn3YgHekx2bZqTraw7LiMz52lFYpax/0 xOmDrxglTCNPODUgs10I8D1vPEgmInnDjYlTw4KSR/ZeD8bg1FaROVs2gTq3xFx7 p2iOQmKknmYEwfQMYKbyHES43bbyyqBMhSvKGJUCut1eNtWLIUiyBeWC90jLRKHN /TLo1hWBywhKEO+L/4cYoK/nEU2e9gq2i+c23dzaaICbdvYQJYJHo+irXFlK8rRo ImrG952WiKuNXL0NQBEo =EvpH -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging Block layer patches # gpg: Signature made Tue 10 Apr 2018 15:53:08 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: qemu-iotests: update 185 output commit/stream: Reset delay_ns qemu-iotests: Remove _supported_fmt dmg iotests: blacklist bochs and cloop for 205 and 208 iotests.py: improve verify_image_format helper hw/block/pflash_cfi: fix off-by-one error iotests.py: support unsupported_fmts in main() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
9d2a090639
11 changed files with 44 additions and 28 deletions
|
@ -43,7 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
|||
. ./common.filter
|
||||
. ./common.qemu
|
||||
|
||||
_supported_fmt qcow2 raw qed dmg quorum
|
||||
_supported_fmt qcow2 raw qed quorum
|
||||
_supported_proto file
|
||||
_supported_os Linux
|
||||
|
||||
|
|
|
@ -92,9 +92,8 @@ echo === Start commit job and exit qemu ===
|
|||
echo
|
||||
|
||||
# Note that the reference output intentionally includes the 'offset' field in
|
||||
# BLOCK_JOB_CANCELLED events for all of the following block jobs. They are
|
||||
# predictable and any change in the offsets would hint at a bug in the job
|
||||
# throttling code.
|
||||
# BLOCK_JOB_* events for all of the following block jobs. They are predictable
|
||||
# and any change in the offsets would hint at a bug in the job throttling code.
|
||||
#
|
||||
# In order to achieve these predictable offsets, all of the following tests
|
||||
# use speed=65536. Each job will perform exactly one iteration before it has
|
||||
|
@ -102,11 +101,14 @@ echo
|
|||
# command to be received (after receiving the command, the rest runs
|
||||
# synchronously, so jobs can arbitrarily continue or complete).
|
||||
#
|
||||
# Jobs present while QEMU is terminating iterate once more due to
|
||||
# bdrv_drain_all().
|
||||
#
|
||||
# The buffer size for commit and streaming is 512k (waiting for 8 seconds after
|
||||
# the first request), for active commit and mirror it's large enough to cover
|
||||
# the full 4M, and for backup it's the qcow2 cluster size, which we know is
|
||||
# 64k. As all of these are at least as large as the speed, we are sure that the
|
||||
# offset doesn't advance after the first iteration before qemu exits.
|
||||
# offset advances exactly twice before qemu exits.
|
||||
|
||||
_send_qemu_cmd $h \
|
||||
"{ 'execute': 'block-commit',
|
||||
|
|
|
@ -20,7 +20,7 @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.q
|
|||
{"return": {}}
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 524288, "speed": 65536, "type": "commit"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 1048576, "speed": 65536, "type": "commit"}}
|
||||
|
||||
=== Start active commit job and exit qemu ===
|
||||
|
||||
|
@ -28,16 +28,18 @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.q
|
|||
{"return": {}}
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "commit"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "commit"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "commit"}}
|
||||
|
||||
=== Start mirror job and exit qemu ===
|
||||
|
||||
{"return": {}}
|
||||
Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}}
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}}
|
||||
|
||||
=== Start backup job and exit qemu ===
|
||||
|
||||
|
@ -46,7 +48,7 @@ Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 l
|
|||
{"return": {}}
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 65536, "speed": 65536, "type": "backup"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 131072, "speed": 65536, "type": "backup"}}
|
||||
|
||||
=== Start streaming job and exit qemu ===
|
||||
|
||||
|
@ -54,6 +56,6 @@ Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 l
|
|||
{"return": {}}
|
||||
{"return": {}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 524288, "speed": 65536, "type": "stream"}}
|
||||
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 1048576, "speed": 65536, "type": "stream"}}
|
||||
No errors were found on the image.
|
||||
*** done
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
import iotests
|
||||
|
||||
iotests.verify_image_format(supported_fmts=['qcow2', 'qed', 'raw', 'dmg'])
|
||||
iotests.verify_image_format(supported_fmts=['qcow2', 'qed', 'raw'])
|
||||
iotests.verify_platform(['linux'])
|
||||
|
||||
with iotests.FilePath('source.img') as source_img_path, \
|
||||
|
|
|
@ -153,4 +153,4 @@ class TestNbdServerRemove(iotests.QMPTestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
iotests.main()
|
||||
iotests.main(supported_fmts=['generic'])
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
import iotests
|
||||
|
||||
iotests.verify_image_format(supported_fmts=['generic'])
|
||||
|
||||
with iotests.FilePath('disk.img') as disk_img_path, \
|
||||
iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \
|
||||
iotests.FilePath('nbd.sock') as nbd_sock_path, \
|
||||
|
|
|
@ -529,9 +529,17 @@ def notrun(reason):
|
|||
sys.exit(0)
|
||||
|
||||
def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
|
||||
if supported_fmts and (imgfmt not in supported_fmts):
|
||||
notrun('not suitable for this image format: %s' % imgfmt)
|
||||
if unsupported_fmts and (imgfmt in unsupported_fmts):
|
||||
assert not (supported_fmts and unsupported_fmts)
|
||||
|
||||
if 'generic' in supported_fmts and \
|
||||
os.environ.get('IMGFMT_GENERIC', 'true') == 'true':
|
||||
# similar to
|
||||
# _supported_fmt generic
|
||||
# for bash tests
|
||||
return
|
||||
|
||||
not_sup = supported_fmts and (imgfmt not in supported_fmts)
|
||||
if not_sup or (imgfmt in unsupported_fmts):
|
||||
notrun('not suitable for this image format: %s' % imgfmt)
|
||||
|
||||
def verify_platform(supported_oses=['linux']):
|
||||
|
@ -550,7 +558,8 @@ def verify_quorum():
|
|||
if not supports_quorum():
|
||||
notrun('quorum support missing')
|
||||
|
||||
def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[]):
|
||||
def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[],
|
||||
unsupported_fmts=[]):
|
||||
'''Run tests'''
|
||||
|
||||
global debug
|
||||
|
@ -565,7 +574,7 @@ def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[]):
|
|||
|
||||
debug = '-d' in sys.argv
|
||||
verbosity = 1
|
||||
verify_image_format(supported_fmts)
|
||||
verify_image_format(supported_fmts, unsupported_fmts)
|
||||
verify_platform(supported_oses)
|
||||
verify_cache_mode(supported_cache_modes)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue