summaryrefslogtreecommitdiff
path: root/block/vhdx.h
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2019-03-27 10:56:34 +0100
committerKevin Wolf <kwolf@redhat.com>2019-04-30 15:29:00 +0200
commit0cb98af2187a5c7e1723fc28f8ed359634dff550 (patch)
tree8b30d2fe9ae5b31e97aee692fe6844861a1c5e91 /block/vhdx.h
parente9991e29ea5efb91324a1b1e10fbf553867964df (diff)
block/vhdx: Use IEC binary prefixes for size constants
Using IEC binary prefixes in order to make the code more readable, with the exception of DEFAULT_LOG_SIZE because it's passed to stringify(). Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vhdx.h')
-rw-r--r--block/vhdx.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/block/vhdx.h b/block/vhdx.h
index bf72090c8f..0b74924cee 100644
--- a/block/vhdx.h
+++ b/block/vhdx.h
@@ -20,6 +20,8 @@
#include "qemu/units.h"
#define DEFAULT_LOG_SIZE 1048576 /* 1MiB */
+/* Note: can't use 1 * MiB, because it's passed to stringify() */
+
/* Structures and fields present in the VHDX file */
/* The header section has the following blocks,
@@ -32,7 +34,7 @@
* 0.........64KB...........128KB........192KB..........256KB................1MB
*/
-#define VHDX_HEADER_BLOCK_SIZE (64 * 1024)
+#define VHDX_HEADER_BLOCK_SIZE (64 * KiB)
#define VHDX_FILE_ID_OFFSET 0
#define VHDX_HEADER1_OFFSET (VHDX_HEADER_BLOCK_SIZE * 1)
@@ -81,7 +83,7 @@ typedef struct QEMU_PACKED MSGUID {
#define guid_eq(a, b) \
(memcmp(&(a), &(b), sizeof(MSGUID)) == 0)
-#define VHDX_HEADER_SIZE (4 * 1024) /* although the vhdx_header struct in disk
+#define VHDX_HEADER_SIZE (4 * KiB) /* although the vhdx_header struct in disk
is only 582 bytes, for purposes of crc
the header is the first 4KB of the 64KB
block */
@@ -157,8 +159,8 @@ typedef struct QEMU_PACKED VHDXRegionTableEntry {
/* ---- LOG ENTRY STRUCTURES ---- */
-#define VHDX_LOG_MIN_SIZE (1024 * 1024)
-#define VHDX_LOG_SECTOR_SIZE 4096
+#define VHDX_LOG_MIN_SIZE (1 * MiB)
+#define VHDX_LOG_SECTOR_SIZE (4 * KiB)
#define VHDX_LOG_HDR_SIZE 64
#define VHDX_LOG_SIGNATURE 0x65676f6c
typedef struct QEMU_PACKED VHDXLogEntryHeader {