* [Qemu-devel] [PATCH] qemu-img: Use IEC binary prefixes for size constants
@ 2019-05-08 10:43 Stefano Garzarella
2019-05-08 12:17 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Garzarella @ 2019-05-08 10:43 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Kevin Wolf, qemu-block, Max Reitz
Using IEC binary prefixes in order to make the code more readable.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
qemu-img.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index e6ad5978e0..71c92f142a 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -37,6 +37,7 @@
#include "qemu/option.h"
#include "qemu/error-report.h"
#include "qemu/log.h"
+#include "qemu/units.h"
#include "qom/object_interfaces.h"
#include "sysemu/sysemu.h"
#include "sysemu/block-backend.h"
@@ -1216,7 +1217,7 @@ static int compare_buffers(const uint8_t *buf1, const uint8_t *buf2,
return res;
}
-#define IO_BUF_SIZE (2 * 1024 * 1024)
+#define IO_BUF_SIZE (2 * MiB)
/*
* Check if passed sectors are empty (not allocated or contain only 0 bytes)
@@ -2960,7 +2961,7 @@ static int img_map(int argc, char **argv)
int64_t n;
/* Probe up to 1 GiB at a time. */
- n = MIN(1 << 30, length - offset);
+ n = MIN(1 * GiB, length - offset);
ret = get_block_status(bs, offset, n, &next);
if (ret < 0) {
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-img: Use IEC binary prefixes for size constants
2019-05-08 10:43 [Qemu-devel] [PATCH] qemu-img: Use IEC binary prefixes for size constants Stefano Garzarella
@ 2019-05-08 12:17 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2019-05-08 12:17 UTC (permalink / raw)
To: Stefano Garzarella; +Cc: qemu-trivial, qemu-devel, qemu-block, Max Reitz
Am 08.05.2019 um 12:43 hat Stefano Garzarella geschrieben:
> Using IEC binary prefixes in order to make the code more readable.
>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-08 12:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 10:43 [Qemu-devel] [PATCH] qemu-img: Use IEC binary prefixes for size constants Stefano Garzarella
2019-05-08 12:17 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).