All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PULL 00/17] NBD patches through 2021-03-09
Date: Thu, 11 Mar 2021 13:21:06 -0600	[thread overview]
Message-ID: <35c04e37-eb1d-e2dc-db3c-5e77d4181071@redhat.com> (raw)
In-Reply-To: <CAFEAcA9dSR_yvsxERtFcC1BApWMH0vqqcn1d89bgW1S_9xmYPQ@mail.gmail.com>

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



  reply	other threads:[~2021-03-11 19:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 15:51 [PULL 00/17] NBD patches through 2021-03-09 Eric Blake
2021-03-09 15:51 ` [PULL 01/17] MAINTAINERS: add Vladimir as co-maintainer of NBD Eric Blake
2021-03-09 15:51 ` [PULL 02/17] nbd: server: Report holes for raw images Eric Blake
2021-03-09 15:51 ` [PULL 03/17] utils: Enhance testsuite for do_strtosz() Eric Blake
2021-03-09 15:51 ` [PULL 04/17] utils: Improve qemu_strtosz() to have 64 bits of precision Eric Blake
2021-03-09 15:51 ` [PULL 05/17] utils: Deprecate hex-with-suffix sizes Eric Blake
2021-03-09 15:51 ` [PULL 06/17] block: check return value of bdrv_open_child and drop error propagation Eric Blake
2021-03-09 15:51 ` [PULL 07/17] blockdev: fix drive_backup_prepare() missed error Eric Blake
2021-03-09 15:51 ` [PULL 08/17] block: drop extra error propagation for bdrv_set_backing_hd Eric Blake
2021-03-09 15:51 ` [PULL 09/17] block/mirror: drop extra error propagation in commit_active_start() Eric Blake
2021-03-09 15:51 ` [PULL 10/17] blockjob: return status from block_job_set_speed() Eric Blake
2021-03-09 15:51 ` [PULL 11/17] block/qcow2: qcow2_get_specific_info(): drop error propagation Eric Blake
2021-03-09 15:51 ` [PULL 12/17] block/qcow2-bitmap: improve qcow2_load_dirty_bitmaps() interface Eric Blake
2021-03-09 15:51 ` [PULL 13/17] block/qcow2-bitmap: return status from qcow2_store_persistent_dirty_bitmaps Eric Blake
2021-03-09 15:51 ` [PULL 14/17] block/qcow2: read_cache_sizes: return status value Eric Blake
2021-03-09 15:52 ` [PULL 15/17] block/qcow2: simplify qcow2_co_invalidate_cache() Eric Blake
2021-03-09 15:52 ` [PULL 16/17] block/qed: bdrv_qed_do_open: deal with errp Eric Blake
2021-03-09 15:52 ` [PULL 17/17] block/qcow2: refactor qcow2_update_options_prepare error paths Eric Blake
2021-03-11 16:20 ` [PULL 00/17] NBD patches through 2021-03-09 Peter Maydell
2021-03-11 19:02 ` Peter Maydell
2021-03-11 19:21   ` Eric Blake [this message]
2021-03-11 20:40     ` Peter Maydell
2021-03-17 11:17   ` Thomas Huth
2021-03-17 11:28     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35c04e37-eb1d-e2dc-db3c-5e77d4181071@redhat.com \
    --to=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.