[Qemu-devel] [PATCH v13 06/31] iotests.py: Add filter_imgfmt()

Max Reitz posted 31 patches 7 years ago
Maintainers: Ari Sundholm <ari@tuxera.com>, Wen Congyang <wencongyang2@huawei.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>, Xie Changlong <xiechanglong.d@gmail.com>, Josh Durgin <jdurgin@redhat.com>, Alberto Garcia <berto@igalia.com>, Jeff Cody <jcody@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Liu Yuan <namei.unix@gmail.com>, Eric Blake <eblake@redhat.com>, Peter Lieven <pl@kamp.de>, Stefan Hajnoczi <stefanha@redhat.com>, Ronnie Sahlberg <ronniesahlberg@gmail.com>, "Richard W.M. Jones" <rjones@redhat.com>, Max Reitz <mreitz@redhat.com>
[Qemu-devel] [PATCH v13 06/31] iotests.py: Add filter_imgfmt()
Posted by Max Reitz 7 years ago
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/iotests.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index c323c62d20..8c5dd40f83 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -312,6 +312,16 @@ def filter_img_info(output, filename):
         lines.append(line)
     return '\n'.join(lines)
 
+def filter_imgfmt(msg):
+    return msg.replace(imgfmt, 'IMGFMT')
+
+def filter_qmp_imgfmt(qmsg):
+    def _filter(key, value):
+        if is_str(value):
+            return filter_imgfmt(value)
+        return value
+    return filter_qmp(qmsg, _filter)
+
 def log(msg, filters=[], indent=None):
     '''Logs either a string message or a JSON serializable message (like QMP).
     If indent is provided, JSON serializable messages are pretty-printed.'''
-- 
2.20.1


Re: [Qemu-devel] [PATCH v13 06/31] iotests.py: Add filter_imgfmt()
Posted by Eric Blake 7 years ago
On 2/1/19 1:29 PM, Max Reitz wrote:
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/iotests.py | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org