xref: /openbmc/qemu/util/block-helpers.h (revision f6476697)
1 #ifndef BLOCK_HELPERS_H
2 #define BLOCK_HELPERS_H
3 
4 #include "qemu/units.h"
5 
6 /* lower limit is sector size */
7 #define MIN_BLOCK_SIZE          INT64_C(512)
8 #define MIN_BLOCK_SIZE_STR      "512 B"
9 /*
10  * upper limit is arbitrary, 2 MiB looks sufficient for all sensible uses, and
11  * matches qcow2 cluster size limit
12  */
13 #define MAX_BLOCK_SIZE          (2 * MiB)
14 #define MAX_BLOCK_SIZE_STR      "2 MiB"
15 
16 void check_block_size(const char *id, const char *name, int64_t value,
17                       Error **errp);
18 
19 #endif /* BLOCK_HELPERS_H */
20