[PATCH v2 0/4] improve do_strtosz precision

Eric Blake posted 4 patches 4 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210211204438.1184395-1-eblake@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
docs/system/deprecated.rst       |  17 ++++
tests/test-cutils.c              | 168 ++++++++++++++++++++++++++-----
tests/test-keyval.c              |  39 ++++---
tests/test-qemu-opts.c           |  37 ++++---
util/cutils.c                    | 103 +++++++++++++++----
tests/qemu-iotests/049.out       |  14 ++-
tests/qemu-iotests/178.out.qcow2 |   3 +-
tests/qemu-iotests/178.out.raw   |   3 +-
8 files changed, 305 insertions(+), 79 deletions(-)
[PATCH v2 0/4] improve do_strtosz precision
Posted by Eric Blake 4 years, 7 months ago
Parsing sizes with only 53 bits of precision is surprising; it's time
to fix it to use a full 64 bits of precision.

v1 was here:
https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg01800.html

Since then:
- split testsuite improvements from code changes [Vladimir]
- more tests for more corner cases [Vladimir, Rich, Dan]
- fix handling of '123-45' when endptr is non-NULL [Vladimir]
- fix handling of '1.k'
- actually enable deprecation of '0x1k' [Vladimir]
- include missing deprecation text for rounded fractions
- improved commit messages

I'm still not sure I like patch 4, but it's at least worth considering.

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

 docs/system/deprecated.rst       |  17 ++++
 tests/test-cutils.c              | 168 ++++++++++++++++++++++++++-----
 tests/test-keyval.c              |  39 ++++---
 tests/test-qemu-opts.c           |  37 ++++---
 util/cutils.c                    | 103 +++++++++++++++----
 tests/qemu-iotests/049.out       |  14 ++-
 tests/qemu-iotests/178.out.qcow2 |   3 +-
 tests/qemu-iotests/178.out.raw   |   3 +-
 8 files changed, 305 insertions(+), 79 deletions(-)

-- 
2.30.1


Re: [PATCH v2 0/4] improve do_strtosz precision
Posted by Eric Blake 4 years, 7 months ago
On 2/11/21 2:44 PM, Eric Blake wrote:
> Parsing sizes with only 53 bits of precision is surprising; it's time
> to fix it to use a full 64 bits of precision.
> 
> v1 was here:
> https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg01800.html
> 
> Since then:
> - split testsuite improvements from code changes [Vladimir]
> - more tests for more corner cases [Vladimir, Rich, Dan]
> - fix handling of '123-45' when endptr is non-NULL [Vladimir]
> - fix handling of '1.k'
> - actually enable deprecation of '0x1k' [Vladimir]
> - include missing deprecation text for rounded fractions
> - improved commit messages
> 
> I'm still not sure I like patch 4, but it's at least worth considering.

Ping. I've also just realized that this series will fix:
https://bugzilla.redhat.com/show_bug.cgi?id=1909185
"The error message of "qemu-img convert -r" should advertise the correct
maximum number"

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