[PATCH v2 0/2] block: report errno when flock fcntl fails

David Edmondson posted 2 patches 4 years, 11 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201221134931.1194806-1-david.edmondson@oracle.com
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
block/file-posix.c               | 20 ++++-----
tests/qemu-iotests/153.out       | 76 ++++++++++++++++----------------
tests/qemu-iotests/182.out       |  2 +-
tests/qemu-iotests/common.filter |  6 +++
tests/qemu-iotests/common.qemu   |  2 +-
5 files changed, 56 insertions(+), 50 deletions(-)
[PATCH v2 0/2] block: report errno when flock fcntl fails
Posted by David Edmondson 4 years, 11 months ago
As Kevin pointed out, adding the error reported by fcntl to the
reported error required updates to the tests.

When running the tests there were lots of failures due to output
comparison problems, such as:

@@ -6,7 +6,9 @@
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
 { 'execute': 'qmp_capabilities' }
 {"return": {}}
-{'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
+{'execute':'drive-mirror', 'arguments':{
+            'device': 'src', 'target': 'TEST_DIR/t.IMGFMT',
+            'mode': 'existing', 'sync': 'full'}}
 WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
          Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
          Specify the 'raw' format explicitly to remove the restrictions.

To avoid this, the second patch flattens the input command that will
be sent to the tool before it is echoed back for later comparison.

v2:
- Update the tests appropriately (Kevin).
- Removed qemu-trivial given that there was debate.
- Filter the input echoed before sending to qemu* during testing such
  that comparisons succeed.

David Edmondson (2):
  block: report errno when flock fcntl fails
  tests: Collapse echoed JSON input to a single line

 block/file-posix.c               | 20 ++++-----
 tests/qemu-iotests/153.out       | 76 ++++++++++++++++----------------
 tests/qemu-iotests/182.out       |  2 +-
 tests/qemu-iotests/common.filter |  6 +++
 tests/qemu-iotests/common.qemu   |  2 +-
 5 files changed, 56 insertions(+), 50 deletions(-)

-- 
2.29.2