block-helpers.h 535 B

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