[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/15] qemu-img: Use IEC binary prefixes for size con
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 07/15] qemu-img: Use IEC binary prefixes for size constants |
Date: |
Fri, 10 May 2019 18:16:06 +0200 |
From: Stefano Garzarella <address@hidden>
Using IEC binary prefixes in order to make the code more readable.
Signed-off-by: Stefano Garzarella <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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
- [Qemu-devel] [PULL 00/15] Block layer patches, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 01/15] block: remove bs from lists before closing, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 02/15] MAINTAINERS: Downgrade status of block sections without "M:" to "Odd Fixes", Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 03/15] MAINTAINERS: Add an entry for the Parallel NOR Flash devices, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 04/15] qemu-iotests: Fix cleanup for 192, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 05/15] blockjob: Fix coroutine thread after AioContext change, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 06/15] test-block-iothread: Job coroutine thread after AioContext switch, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 07/15] qemu-img: Use IEC binary prefixes for size constants,
Kevin Wolf <=
- [Qemu-devel] [PULL 08/15] qcow2: Replace bdrv_write() with bdrv_pwrite(), Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 09/15] vdi: Replace bdrv_{read, write}() with bdrv_{pread, pwrite}(), Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 11/15] block: Remove bdrv_read() and bdrv_write(), Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 10/15] vvfat: Replace bdrv_{read, write}() with bdrv_{pread, pwrite}(), Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 12/15] qcow2: Remove BDRVQcow2State.cluster_sectors, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 14/15] qemu-img: Use zero writes after source backing EOF, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 13/15] qemu-img: Allow rebase with no input base, Kevin Wolf, 2019/05/10
- [Qemu-devel] [PULL 15/15] iotests: Add test for rebase without input base, Kevin Wolf, 2019/05/10
- Re: [Qemu-devel] [PULL 00/15] Block layer patches, Peter Maydell, 2019/05/13