Patchwork block: vpc initialize the uuid footer field

login
register
mail settings
Submitter Charles Arnold
Date Nov. 2, 2012, 3:54 p.m.
Message ID <5093985002000091000828A4@novprvoes0310.provo.novell.com>
Download mbox | patch
Permalink /patch/196583/
State New
Headers show

Comments

Charles Arnold - Nov. 2, 2012, 3:54 p.m.
block/vpc: Initialize the uuid field in the footer with a generated uuid.

Signed-off-by: Charles Arnold <carnold@suse.com>
Stefan Hajnoczi - Nov. 19, 2012, 11:42 a.m.
On Fri, Nov 02, 2012 at 09:54:24AM -0600, Charles Arnold wrote:
> block/vpc: Initialize the uuid field in the footer with a generated uuid.
> 
> Signed-off-by: Charles Arnold <carnold@suse.com>

Thanks, applied to the block-next tree:
https://github.com/stefanha/qemu/commits/block-next

Stefan

Patch

diff --git a/block/vpc.c b/block/vpc.c
index b6bf52f..f14c6ae 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -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));