[PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata

Vladimir Sementsov-Ogievskiy posted 12 patches 3 years, 11 months ago
Test docker-mingw@fedora passed
Test checkpatch failed
Test asan passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200604174135.11042-1-vsementsov@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
There is a newer version of this series
tests/qemu-iotests/031.out         |  22 +--
tests/qemu-iotests/036.out         |   4 +-
tests/qemu-iotests/061.out         |  14 +-
tests/qemu-iotests/291             |   4 +
tests/qemu-iotests/291.out         |  33 ++++
tests/qemu-iotests/qcow2.py        | 200 ++++------------------
tests/qemu-iotests/qcow2_format.py | 260 +++++++++++++++++++++++++++++
7 files changed, 348 insertions(+), 189 deletions(-)
create mode 100644 tests/qemu-iotests/qcow2_format.py
[PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
Posted by Vladimir Sementsov-Ogievskiy 3 years, 11 months ago
Hi all!

Here is my suggestion to substitute only first three patches :) of
Andrey's [PATCH v3 0/6] iotests: Dump QCOW2 dirty bitmaps metadata

so, I called it v4 for convenience.

What is here:
1. First, update code style
2. Next, try to refactor in a manner which will make adding new data
structures simple (look at Qcow2BitmapExt class in last patch)

I think, next step is to add type hints. Then add more structures.
And, anyway, at some point we should move it into python/ directory (at
least qcow2_format.py lib)

Vladimir Sementsov-Ogievskiy (12):
  qcow2.py: python style fixes
  qcow2.py: move qcow2 format classes to separate module
  qcow2_format.py: drop new line printing at end of dump()
  qcow2_format.py: use tuples instead of lists for fields
  qcow2_format.py: use modern string formatting
  qcow2_format.py: use strings to specify c-type of struct fields
  qcow2_format.py: separate generic functionality of structure classes
  qcow2_format.py: add field-formatting class
  qcow2_format.py: QcowHeaderExtension: add dump method
  qcow2_format: refactor QcowHeaderExtension as a subclass of
    Qcow2Struct
  qcow2: QcowHeaderExtension print names for extension magics
  qcow2_format.py: dump bitmaps header extension

 tests/qemu-iotests/031.out         |  22 +--
 tests/qemu-iotests/036.out         |   4 +-
 tests/qemu-iotests/061.out         |  14 +-
 tests/qemu-iotests/291             |   4 +
 tests/qemu-iotests/291.out         |  33 ++++
 tests/qemu-iotests/qcow2.py        | 200 ++++------------------
 tests/qemu-iotests/qcow2_format.py | 260 +++++++++++++++++++++++++++++
 7 files changed, 348 insertions(+), 189 deletions(-)
 create mode 100644 tests/qemu-iotests/qcow2_format.py

-- 
2.21.0


Re: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200604174135.11042-1-vsementsov@virtuozzo.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200604174135.11042-1-vsementsov@virtuozzo.com
Subject: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
ff3d0e0 qcow2_format.py: dump bitmaps header extension
1ca4b4b qcow2: QcowHeaderExtension print names for extension magics
4894f85 qcow2_format: refactor QcowHeaderExtension as a subclass of Qcow2Struct
5d2d3ea qcow2_format.py: QcowHeaderExtension: add dump method
7848f52 qcow2_format.py: add field-formatting class
4f0473f qcow2_format.py: separate generic functionality of structure classes
78964d2 qcow2_format.py: use strings to specify c-type of struct fields
492b753 qcow2_format.py: use modern string formatting
7fef737 qcow2_format.py: use tuples instead of lists for fields
8fae4ab qcow2_format.py: drop new line printing at end of dump()
c0b4e4b qcow2.py: move qcow2 format classes to separate module
32668ba qcow2.py: python style fixes

=== OUTPUT BEGIN ===
1/12 Checking commit 32668ba94cf1 (qcow2.py: python style fixes)
ERROR: line over 90 characters
#219: FILE: tests/qemu-iotests/qcow2.py:256:
+    ['dump-header',          cmd_dump_header,          0, 'Dump image header and header extensions'],

WARNING: line over 80 characters
#220: FILE: tests/qemu-iotests/qcow2.py:257:
+    ['dump-header-exts',     cmd_dump_header_exts,     0, 'Dump image header extensions'],

WARNING: line over 80 characters
#221: FILE: tests/qemu-iotests/qcow2.py:258:
+    ['set-header',           cmd_set_header,           2, 'Set a field in the header'],

WARNING: line over 80 characters
#222: FILE: tests/qemu-iotests/qcow2.py:259:
+    ['add-header-ext',       cmd_add_header_ext,       2, 'Add a header extension'],

ERROR: line over 90 characters
#223: FILE: tests/qemu-iotests/qcow2.py:260:
+    ['add-header-ext-stdio', cmd_add_header_ext_stdio, 1, 'Add a header extension, data from stdin'],

WARNING: line over 80 characters
#224: FILE: tests/qemu-iotests/qcow2.py:261:
+    ['del-header-ext',       cmd_del_header_ext,       1, 'Delete a header extension'],

total: 2 errors, 4 warnings, 217 lines checked

Patch 1/12 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/12 Checking commit c0b4e4bcc692 (qcow2.py: move qcow2 format classes to separate module)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#186: 
new file mode 100644

total: 0 errors, 1 warnings, 324 lines checked

Patch 2/12 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/12 Checking commit 8fae4ab6b058 (qcow2_format.py: drop new line printing at end of dump())
4/12 Checking commit 7fef73761e63 (qcow2_format.py: use tuples instead of lists for fields)
5/12 Checking commit 492b753d310e (qcow2_format.py: use modern string formatting)
6/12 Checking commit 78964d206cab (qcow2_format.py: use strings to specify c-type of struct fields)
7/12 Checking commit 4f0473f3cf7f (qcow2_format.py: separate generic functionality of structure classes)
8/12 Checking commit 7848f5283863 (qcow2_format.py: add field-formatting class)
9/12 Checking commit 5d2d3ea44d93 (qcow2_format.py: QcowHeaderExtension: add dump method)
10/12 Checking commit 4894f859e63d (qcow2_format: refactor QcowHeaderExtension as a subclass of Qcow2Struct)
11/12 Checking commit 1ca4b4b795d8 (qcow2: QcowHeaderExtension print names for extension magics)
12/12 Checking commit ff3d0e0f471a (qcow2_format.py: dump bitmaps header extension)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200604174135.11042-1-vsementsov@virtuozzo.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
Posted by Vladimir Sementsov-Ogievskiy 3 years, 11 months ago
04.06.2020 22:14, no-reply@patchew.org wrote:
> Patchew URL: https://patchew.org/QEMU/20200604174135.11042-1-vsementsov@virtuozzo.com/
> 
> 
> 
> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Message-id: 20200604174135.11042-1-vsementsov@virtuozzo.com
> Subject: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
> Type: series
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> git rev-parse base > /dev/null || exit 0
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> git config --local diff.algorithm histogram
> ./scripts/checkpatch.pl --mailback base..
> === TEST SCRIPT END ===
> 
> Switched to a new branch 'test'
> ff3d0e0 qcow2_format.py: dump bitmaps header extension
> 1ca4b4b qcow2: QcowHeaderExtension print names for extension magics
> 4894f85 qcow2_format: refactor QcowHeaderExtension as a subclass of Qcow2Struct
> 5d2d3ea qcow2_format.py: QcowHeaderExtension: add dump method
> 7848f52 qcow2_format.py: add field-formatting class
> 4f0473f qcow2_format.py: separate generic functionality of structure classes
> 78964d2 qcow2_format.py: use strings to specify c-type of struct fields
> 492b753 qcow2_format.py: use modern string formatting
> 7fef737 qcow2_format.py: use tuples instead of lists for fields
> 8fae4ab qcow2_format.py: drop new line printing at end of dump()
> c0b4e4b qcow2.py: move qcow2 format classes to separate module
> 32668ba qcow2.py: python style fixes
> 
> === OUTPUT BEGIN ===
> 1/12 Checking commit 32668ba94cf1 (qcow2.py: python style fixes)
> ERROR: line over 90 characters
> #219: FILE: tests/qemu-iotests/qcow2.py:256:
> +    ['dump-header',          cmd_dump_header,          0, 'Dump image header and header extensions'],
> 
> WARNING: line over 80 characters
> #220: FILE: tests/qemu-iotests/qcow2.py:257:
> +    ['dump-header-exts',     cmd_dump_header_exts,     0, 'Dump image header extensions'],
> 
> WARNING: line over 80 characters
> #221: FILE: tests/qemu-iotests/qcow2.py:258:
> +    ['set-header',           cmd_set_header,           2, 'Set a field in the header'],
> 
> WARNING: line over 80 characters
> #222: FILE: tests/qemu-iotests/qcow2.py:259:
> +    ['add-header-ext',       cmd_add_header_ext,       2, 'Add a header extension'],
> 
> ERROR: line over 90 characters
> #223: FILE: tests/qemu-iotests/qcow2.py:260:
> +    ['add-header-ext-stdio', cmd_add_header_ext_stdio, 1, 'Add a header extension, data from stdin'],
> 
> WARNING: line over 80 characters
> #224: FILE: tests/qemu-iotests/qcow2.py:261:
> +    ['del-header-ext',       cmd_del_header_ext,       1, 'Delete a header extension'],
> 
> total: 2 errors, 4 warnings, 217 lines checked
> 
> Patch 1/12 has style problems, please review.  If any of these errors


Preexisting. And it will look worse if wrap lines.


-- 
Best regards,
Vladimir

Re: [PATCH v4 00/12] iotests: Dump QCOW2 dirty bitmaps metadata
Posted by Eric Blake 3 years, 11 months ago
On 6/4/20 12:41 PM, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> Here is my suggestion to substitute only first three patches :) of
> Andrey's [PATCH v3 0/6] iotests: Dump QCOW2 dirty bitmaps metadata
> 
> so, I called it v4 for convenience.
> 
> What is here:
> 1. First, update code style
> 2. Next, try to refactor in a manner which will make adding new data
> structures simple (look at Qcow2BitmapExt class in last patch)
> 
> I think, next step is to add type hints. Then add more structures.
> And, anyway, at some point we should move it into python/ directory (at
> least qcow2_format.py lib)

My python reviewing skills are weak, but in general this series makes 
sense.  I had enough comments that you're probably better off spinning a 
v5, but it looks like it is probably close enough that I can include 
this in my next bitmaps pull request, and we can work on rebasing the 
remainder of Andrey's patches on top of it.

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