summary refs log tree commit diff stats
path: root/include/qemu/uuid.h
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2023-10-26 09:06:34 +0200
committerCédric Le Goater <clg@redhat.com>2023-11-03 09:20:31 +0100
commit721da0396cfa0a4859cefb57e32cc79d19d80f54 (patch)
tree567f65bca8df6e5006bf9d3376d0411717fc5739 /include/qemu/uuid.h
parentba7d12eb8ce2d7367615071c0569947457d36803 (diff)
downloadfocaccia-qemu-721da0396cfa0a4859cefb57e32cc79d19d80f54.tar.gz
focaccia-qemu-721da0396cfa0a4859cefb57e32cc79d19d80f54.zip
util/uuid: Add UUID_STR_LEN definition
qemu_uuid_unparse() includes a trailing NUL when writing the uuid
string and the buffer size should be UUID_FMT_LEN + 1 bytes. Add a
define for this size and use it where required.

Cc: Fam Zheng <fam@euphon.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: "Denis V. Lunev" <den@openvz.org>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/qemu/uuid.h')
-rw-r--r--include/qemu/uuid.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h
index e24a1099e4..4e7afaf1d5 100644
--- a/include/qemu/uuid.h
+++ b/include/qemu/uuid.h
@@ -79,6 +79,7 @@ typedef struct {
                  "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
 
 #define UUID_FMT_LEN 36
+#define UUID_STR_LEN (UUID_FMT_LEN + 1)
 
 #define UUID_NONE "00000000-0000-0000-0000-000000000000"