Eric Blake b87ac96651 cutils: Use parse_uint in qemu_strtosz for negative rejection
Rather than open-coding two different ways to check for an unwanted
negative sign, reuse the same code in both functions.  That way, if we
decide down the road to accept "-0" instead of rejecting it, we have
fewer places to change.  Also, it means we now get ERANGE instead of
EINVAL for negative values in qemu_strtosz, which is reasonable for
what it represents.  This in turn changes the expected output of a
couple of iotests.

The change is not quite complete: negative fractional scaled values
can trip us up.  This will be fixed in a later patch addressing other
issues with fractional scaled values.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230522190441.64278-18-eblake@redhat.com>
2023-06-02 12:29:27 -05:00
..
2023-05-30 17:37:26 +02:00
2023-03-20 12:43:50 +01:00
2023-05-23 16:51:18 -07:00
2023-05-23 15:20:15 +08:00
2023-03-20 12:43:50 +01:00
2022-12-20 17:09:41 -08:00
2022-04-21 17:03:51 +04:00
2023-03-08 00:37:48 +01:00
2023-05-23 16:51:18 -07:00
2023-04-24 11:29:00 +02:00
2023-03-13 15:23:37 +04:00
2022-06-29 10:56:12 +03:00
2023-02-02 11:48:20 +00:00
2023-03-28 15:23:10 -07:00
2023-05-08 11:10:49 +02:00
2023-04-27 16:39:43 +02:00