aboutsummaryrefslogtreecommitdiff
path: root/migration/savevm.c
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 /migration/savevm.c
parentba7d12eb8ce2d7367615071c0569947457d36803 (diff)
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 'migration/savevm.c')
-rw-r--r--migration/savevm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index bc98c2ea6f..eec5503a42 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -471,8 +471,8 @@ static bool vmstate_uuid_needed(void *opaque)
static int vmstate_uuid_post_load(void *opaque, int version_id)
{
SaveState *state = opaque;
- char uuid_src[UUID_FMT_LEN + 1];
- char uuid_dst[UUID_FMT_LEN + 1];
+ char uuid_src[UUID_STR_LEN];
+ char uuid_dst[UUID_STR_LEN];
if (!qemu_uuid_set) {
/*