mbox series

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

Message ID 20201221134931.1194806-1-david.edmondson@oracle.com (mailing list archive)
Headers show
Series block: report errno when flock fcntl fails | expand

Message

David Edmondson Dec. 21, 2020, 1:49 p.m. UTC
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(-)