From: Cédric Le Goater Date: Wed, 25 Oct 2023 10:12:44 +0000 (+0200) Subject: util/uuid: Define UUID_STR_LEN from UUID_NONE string X-Git-Tag: pull-xenfv.for-upstream-20231107~19^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5fe51934b1cd94a75007dd456fecc2ff6ee622e7;p=users%2Fdwmw2%2Fqemu.git util/uuid: Define UUID_STR_LEN from UUID_NONE string Cc: Fam Zheng Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 356efe7b57..869f84af09 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -78,9 +78,10 @@ typedef struct { "%02hhx%02hhx-" \ "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" -#define UUID_STR_LEN (36 + 1) - #define UUID_NONE "00000000-0000-0000-0000-000000000000" +QEMU_BUILD_BUG_ON(sizeof(UUID_NONE) - 1 != 36); + +#define UUID_STR_LEN sizeof(UUID_NONE) void qemu_uuid_generate(QemuUUID *out);