[PULL 00/17] NBD patches through 2021-03-09

Eric Blake posted 17 patches 4 years, 6 months ago
Test checkpatch passed
Failed in applying to current master (apply log)
docs/system/deprecated.rst       |   8 ++
block/qcow2.h                    |   9 ++-
include/block/blockjob.h         |   2 +-
block.c                          |   6 +-
block/blkdebug.c                 |   6 +-
block/blklogwrites.c             |  10 +--
block/blkreplay.c                |   6 +-
block/blkverify.c                |  11 +--
block/mirror.c                   |  12 ++-
block/qcow2-bitmap.c             |  65 ++++++++-------
block/qcow2.c                    |  65 +++++++--------
block/qed.c                      |  24 +++---
block/quorum.c                   |   6 +-
blockdev.c                       |   4 +-
blockjob.c                       |  18 ++---
nbd/server.c                     |   4 +-
tests/test-cutils.c              | 168 ++++++++++++++++++++++++++++++++-------
tests/test-keyval.c              |  35 +++++---
tests/test-qemu-opts.c           |  33 +++++---
util/cutils.c                    |  98 ++++++++++++++++++-----
MAINTAINERS                      |   2 +
tests/qemu-iotests/049.out       |  14 +++-
tests/qemu-iotests/178.out.qcow2 |   3 +-
tests/qemu-iotests/178.out.raw   |   3 +-
tests/qemu-iotests/241.out       |   4 +-
25 files changed, 408 insertions(+), 208 deletions(-)
[PULL 00/17] NBD patches through 2021-03-09
Posted by Eric Blake 4 years, 6 months ago
The following changes since commit 0436c55edf6b357ff56e2a5bf688df8636f83456:

  Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-03-08 13:51:41 +0000)

are available in the Git repository at:

  https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2021-03-09

for you to fetch changes up to 1184b411016bce7590723170aa6b5984518707ec:

  block/qcow2: refactor qcow2_update_options_prepare error paths (2021-03-08 16:04:46 -0600)

----------------------------------------------------------------
nbd patches for 2021-03-09

- Add Vladimir as NBD co-maintainer
- Fix reporting of holes in NBD_CMD_BLOCK_STATUS
- Improve command-line parsing accuracy of large numbers (anything going
through qemu_strtosz), including the deprecation of hex+suffix
- Improve some error reporting in the block layer

----------------------------------------------------------------
Eric Blake (3):
      utils: Enhance testsuite for do_strtosz()
      utils: Improve qemu_strtosz() to have 64 bits of precision
      utils: Deprecate hex-with-suffix sizes

Nir Soffer (1):
      nbd: server: Report holes for raw images

Vladimir Sementsov-Ogievskiy (13):
      MAINTAINERS: add Vladimir as co-maintainer of NBD
      block: check return value of bdrv_open_child and drop error propagation
      blockdev: fix drive_backup_prepare() missed error
      block: drop extra error propagation for bdrv_set_backing_hd
      block/mirror: drop extra error propagation in commit_active_start()
      blockjob: return status from block_job_set_speed()
      block/qcow2: qcow2_get_specific_info(): drop error propagation
      block/qcow2-bitmap: improve qcow2_load_dirty_bitmaps() interface
      block/qcow2-bitmap: return status from qcow2_store_persistent_dirty_bitmaps
      block/qcow2: read_cache_sizes: return status value
      block/qcow2: simplify qcow2_co_invalidate_cache()
      block/qed: bdrv_qed_do_open: deal with errp
      block/qcow2: refactor qcow2_update_options_prepare error paths

 docs/system/deprecated.rst       |   8 ++
 block/qcow2.h                    |   9 ++-
 include/block/blockjob.h         |   2 +-
 block.c                          |   6 +-
 block/blkdebug.c                 |   6 +-
 block/blklogwrites.c             |  10 +--
 block/blkreplay.c                |   6 +-
 block/blkverify.c                |  11 +--
 block/mirror.c                   |  12 ++-
 block/qcow2-bitmap.c             |  65 ++++++++-------
 block/qcow2.c                    |  65 +++++++--------
 block/qed.c                      |  24 +++---
 block/quorum.c                   |   6 +-
 blockdev.c                       |   4 +-
 blockjob.c                       |  18 ++---
 nbd/server.c                     |   4 +-
 tests/test-cutils.c              | 168 ++++++++++++++++++++++++++++++++-------
 tests/test-keyval.c              |  35 +++++---
 tests/test-qemu-opts.c           |  33 +++++---
 util/cutils.c                    |  98 ++++++++++++++++++-----
 MAINTAINERS                      |   2 +
 tests/qemu-iotests/049.out       |  14 +++-
 tests/qemu-iotests/178.out.qcow2 |   3 +-
 tests/qemu-iotests/178.out.raw   |   3 +-
 tests/qemu-iotests/241.out       |   4 +-
 25 files changed, 408 insertions(+), 208 deletions(-)

-- 
2.30.1


Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Peter Maydell 4 years, 6 months ago
On Tue, 9 Mar 2021 at 16:23, Eric Blake <eblake@redhat.com> wrote:
>
> The following changes since commit 0436c55edf6b357ff56e2a5bf688df8636f83456:
>
>   Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-03-08 13:51:41 +0000)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2021-03-09
>
> for you to fetch changes up to 1184b411016bce7590723170aa6b5984518707ec:
>
>   block/qcow2: refactor qcow2_update_options_prepare error paths (2021-03-08 16:04:46 -0600)
>
> ----------------------------------------------------------------
> nbd patches for 2021-03-09
>
> - Add Vladimir as NBD co-maintainer
> - Fix reporting of holes in NBD_CMD_BLOCK_STATUS
> - Improve command-line parsing accuracy of large numbers (anything going
> through qemu_strtosz), including the deprecation of hex+suffix
> - Improve some error reporting in the block layer
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM

Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Peter Maydell 4 years, 6 months ago
On Tue, 9 Mar 2021 at 16:23, Eric Blake <eblake@redhat.com> wrote:
>
> The following changes since commit 0436c55edf6b357ff56e2a5bf688df8636f83456:
>
>   Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-03-08 13:51:41 +0000)
>
> are available in the Git repository at:
>
>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2021-03-09
>
> for you to fetch changes up to 1184b411016bce7590723170aa6b5984518707ec:
>
>   block/qcow2: refactor qcow2_update_options_prepare error paths (2021-03-08 16:04:46 -0600)
>
> ----------------------------------------------------------------
> nbd patches for 2021-03-09
>
> - Add Vladimir as NBD co-maintainer
> - Fix reporting of holes in NBD_CMD_BLOCK_STATUS
> - Improve command-line parsing accuracy of large numbers (anything going
> through qemu_strtosz), including the deprecation of hex+suffix
> - Improve some error reporting in the block layer
>
> ----------------------------------------------------------------

This broke the gitlab cross-i386-user job:
https://gitlab.com/qemu-project/qemu/-/jobs/1090685134

ERROR:../tests/test-cutils.c:2290:test_qemu_strtosz_metric: assertion
failed (res == 12345000): (12344999 == 12345000)

Could you have a look, please?

(It's in master anyway, because at the time gitlab CI was lagging
massively and I wasn't waiting around for it to finish before merging.)

thanks
-- PMM

Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Eric Blake 4 years, 6 months ago
On 3/11/21 1:02 PM, Peter Maydell wrote:
> On Tue, 9 Mar 2021 at 16:23, Eric Blake <eblake@redhat.com> wrote:
>>
>> The following changes since commit 0436c55edf6b357ff56e2a5bf688df8636f83456:
>>
>>   Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-03-08 13:51:41 +0000)
>>
>> are available in the Git repository at:
>>
>>   https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2021-03-09
>>
>> for you to fetch changes up to 1184b411016bce7590723170aa6b5984518707ec:
>>
>>   block/qcow2: refactor qcow2_update_options_prepare error paths (2021-03-08 16:04:46 -0600)
>>
>> ----------------------------------------------------------------
>> nbd patches for 2021-03-09
>>
>> - Add Vladimir as NBD co-maintainer
>> - Fix reporting of holes in NBD_CMD_BLOCK_STATUS
>> - Improve command-line parsing accuracy of large numbers (anything going
>> through qemu_strtosz), including the deprecation of hex+suffix
>> - Improve some error reporting in the block layer
>>
>> ----------------------------------------------------------------
> 
> This broke the gitlab cross-i386-user job:
> https://gitlab.com/qemu-project/qemu/-/jobs/1090685134
> 
> ERROR:../tests/test-cutils.c:2290:test_qemu_strtosz_metric: assertion
> failed (res == 12345000): (12344999 == 12345000)

Sounds like a floating point rounding error: the string was 12.345M, but
0.345 is not an exactly-representable double (the closest 32-bit IEEE
754 float is 0.3449999988079071044921875, while nextafter() gives
0.34500002861).  Multiplying that value by 1000000.0 can then round down
in some situations instead of producing the desired 345000.0.  The
rounding is less obvious with 64-bit doubles.  I'm not sure why
cross-i386-user seems to be prone to the rounding errors while other
builds are not.

> 
> Could you have a look, please?

Yes, I'll propose a followup patch soon.  Easiest would be to relax the
test to allow the imprecision, nicer would be tweaking qemu_strtosz() to
add in a fudge factor (probably based on DBL_EPSILON from <float.h>) to
let any multiplication errors tend to overshoot rather than undershoot
when close to an integer value.

> 
> (It's in master anyway, because at the time gitlab CI was lagging
> massively and I wasn't waiting around for it to finish before merging.)
> 
> thanks
> -- PMM
> 

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


Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Peter Maydell 4 years, 6 months ago
On Thu, 11 Mar 2021 at 19:21, Eric Blake <eblake@redhat.com> wrote:
>
> On 3/11/21 1:02 PM, Peter Maydell wrote:
> > ERROR:../tests/test-cutils.c:2290:test_qemu_strtosz_metric: assertion
> > failed (res == 12345000): (12344999 == 12345000)
>
> Sounds like a floating point rounding error: the string was 12.345M, but
> 0.345 is not an exactly-representable double (the closest 32-bit IEEE
> 754 float is 0.3449999988079071044921875, while nextafter() gives
> 0.34500002861).  Multiplying that value by 1000000.0 can then round down
> in some situations instead of producing the desired 345000.0.  The
> rounding is less obvious with 64-bit doubles.  I'm not sure why
> cross-i386-user seems to be prone to the rounding errors while other
> builds are not.

My guess would be x87 FPU vs SSE...

-- PMM

Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Thomas Huth 4 years, 6 months ago
On 11/03/2021 20.02, Peter Maydell wrote:
> On Tue, 9 Mar 2021 at 16:23, Eric Blake <eblake@redhat.com> wrote:
>>
>> The following changes since commit 0436c55edf6b357ff56e2a5bf688df8636f83456:
>>
>>    Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-03-08 13:51:41 +0000)
>>
>> are available in the Git repository at:
>>
>>    https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2021-03-09
>>
>> for you to fetch changes up to 1184b411016bce7590723170aa6b5984518707ec:
>>
>>    block/qcow2: refactor qcow2_update_options_prepare error paths (2021-03-08 16:04:46 -0600)
>>
>> ----------------------------------------------------------------
>> nbd patches for 2021-03-09
>>
>> - Add Vladimir as NBD co-maintainer
>> - Fix reporting of holes in NBD_CMD_BLOCK_STATUS
>> - Improve command-line parsing accuracy of large numbers (anything going
>> through qemu_strtosz), including the deprecation of hex+suffix
>> - Improve some error reporting in the block layer
>>
>> ----------------------------------------------------------------
> 
> This broke the gitlab cross-i386-user job:
> https://gitlab.com/qemu-project/qemu/-/jobs/1090685134
> 
> ERROR:../tests/test-cutils.c:2290:test_qemu_strtosz_metric: assertion
> failed (res == 12345000): (12344999 == 12345000)

A different failure shows up in the MSYS2 builds now, too:

https://cirrus-ci.com/task/5180846782021632?command=test#L543

  Thomas


Re: [PULL 00/17] NBD patches through 2021-03-09
Posted by Eric Blake 4 years, 6 months ago
On 3/17/21 6:17 AM, Thomas Huth wrote:

>> ERROR:../tests/test-cutils.c:2290:test_qemu_strtosz_metric: assertion
>> failed (res == 12345000): (12344999 == 12345000)
> 
> A different failure shows up in the MSYS2 builds now, too:
> 
> https://cirrus-ci.com/task/5180846782021632?command=test#L543

A bug in mingw's libc for strtoull() that parses "0x" incorrectly (the
correct parse is "0" with the endptr pointing to 'x', and NOT pointing
beyond x).  Also a weakness in our testsuite - many of the tests are not
asserting sane values of err, or whether res is left unchanged on error.

I'm working on a patch now that I have more awareness of what's going on...

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