| 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 | bool check_block_size(const char *name, int64_t value, Error **errp); |
| 17 | |
| 18 | #endif /* BLOCK_HELPERS_H */ |