diff options
author | Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> | 2020-08-06 22:35:54 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2020-08-21 08:56:09 -0500 |
commit | 2c6d9ca48c7133ceba45577e8ca567a524aeb3f0 (patch) | |
tree | 299900b5481d5d98604e8332348c2f25dd456ae9 /tests/qemu-iotests/qcow2_format.py | |
parent | 9427784124828e49bc95cfbcc13eb317dfc32773 (diff) |
qcow2.py: Introduce '-j' key to dump in JSON format
Add the command key to the qcow2.py arguments list to dump QCOW2
metadata in JSON format. Here is the suggested way to do that. The
implementation of the dump in JSON format is in the patch that follows.
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <1596742557-320265-9-git-send-email-andrey.shinkevich@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/qcow2_format.py')
-rw-r--r-- | tests/qemu-iotests/qcow2_format.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qemu-iotests/qcow2_format.py b/tests/qemu-iotests/qcow2_format.py index 574249bc46..de0adcbf9d 100644 --- a/tests/qemu-iotests/qcow2_format.py +++ b/tests/qemu-iotests/qcow2_format.py @@ -109,7 +109,7 @@ class Qcow2Struct(metaclass=Qcow2StructMeta): self.__dict__ = dict((field[2], values[i]) for i, field in enumerate(self.fields)) - def dump(self): + def dump(self, is_json=False): for f in self.fields: value = self.__dict__[f[2]] if isinstance(f[1], str): @@ -408,7 +408,7 @@ class QcowHeader(Qcow2Struct): buf = buf[0:header_bytes-1] fd.write(buf) - def dump_extensions(self): + def dump_extensions(self, is_json=False): for ex in self.extensions: print('Header extension:') ex.dump() |