[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms |
Date: |
Tue, 30 Apr 2019 17:42:24 +0200 |
From: Eric Blake <address@hidden>
When extracting a human-readable size formatter, we changed 'uint64_t
div' pre-patch to 'unsigned long div' post-patch. Which breaks on
32-bit platforms, resulting in 'inf' instead of intended values larger
than 999GB.
Fixes: 22951aaa
CC: address@hidden
Reported-by: Max Reitz <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
util/cutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/cutils.c b/util/cutils.c
index e098debdc0..d682c90901 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -825,7 +825,7 @@ const char *qemu_ether_ntoa(const MACAddr *mac)
char *size_to_str(uint64_t val)
{
static const char *suffixes[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei" };
- unsigned long div;
+ uint64_t div;
int i;
/*
--
2.20.1
- [Qemu-block] [PULL 00/27] Block layer patches, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 03/27] vpc: unlock Coroutine lock to make IO submit Concurrently, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 02/27] block: Fix AioContext switch for bs->drv == NULL, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 04/27] vmdk: Set vmdk parent backing_format to vmdk, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 05/27] block/vhdx: Remove redundant IEC binary prefixes definition, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 06/27] block/vhdx: Use IEC binary prefixes for size constants, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 01/27] tests/qemu-iotests: Fix output of qemu-io related tests, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms,
Kevin Wolf <=
- [Qemu-block] [PULL 09/27] qcow2: Avoid COW during metadata preallocation, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 11/27] qcow2: Fix full preallocation with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 10/27] qcow2: Add errp to preallocate_co(), Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 08/27] qemu-img: Saner printing of large file sizes, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 12/27] iotests: Perform the correct test in 082, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 14/27] qcow2: Fix qcow2_make_empty() with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 15/27] qcow2: Fix error handling in the compression code, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 16/27] block: introduce byte-based io helpers, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 13/27] qemu-img: Make create hint at protocol options, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 20/27] block/parallels: use buffer-based io, Kevin Wolf, 2019/04/30