block: vpc initialize the uuid footer field
authorCharles Arnold <carnold@suse.com>
Fri, 2 Nov 2012 15:54:24 +0000 (09:54 -0600)
committerKevin Wolf <kwolf@redhat.com>
Tue, 11 Dec 2012 10:04:25 +0000 (11:04 +0100)
Initialize the uuid field in the footer with a generated uuid.

Signed-off-by: Charles Arnold <carnold@suse.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/vpc.c

index b6bf52f1406e31b335731d294d2af6cb64af591c..f14c6ae196d4c66d17254f48511cef9f5842ac66 100644 (file)
@@ -26,6 +26,9 @@
 #include "block_int.h"
 #include "module.h"
 #include "migration.h"
+#if defined(CONFIG_UUID)
+#include <uuid/uuid.h>
+#endif
 
 /**************************************************************/
 
@@ -739,7 +742,9 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options)
 
     footer->type = be32_to_cpu(disk_type);
 
-    /* TODO uuid is missing */
+#if defined(CONFIG_UUID)
+    uuid_generate(footer->uuid);
+#endif
 
     footer->checksum = be32_to_cpu(vpc_checksum(buf, HEADER_SIZE));