X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=generator%2Fgenerator_utils.ml;h=aa7fcba3c6888dc4282903c3a7f266b9139cd7d5;hb=7708d3e04f6ec3985fd74ee1a44a5615d43065e2;hp=f62b195661c9b60acf78902aaffba2de8e4b9f68;hpb=8037da06feea097716ce700f38c0eac0d5411a7c;p=libguestfs.git diff --git a/generator/generator_utils.ml b/generator/generator_utils.ml index f62b195..aa7fcba 100644 --- a/generator/generator_utils.ml +++ b/generator/generator_utils.ml @@ -55,6 +55,14 @@ let string_of_errcode = function *) let uuidgen () = let s = Digest.to_hex (Digest.file "generator/generator_actions.ml") in + + (* In util-linux <= 2.19, mkswap -U cannot handle the first byte of + * the UUID being zero, so we artificially rewrite such UUIDs. + * http://article.gmane.org/gmane.linux.utilities.util-linux-ng/4273 + *) + if s.[0] = '0' && s.[1] = '0' then + s.[0] <- '1'; + String.sub s 0 8 ^ "-" ^ String.sub s 8 4 ^ "-" ^ String.sub s 12 4 ^ "-" @@ -256,6 +264,7 @@ let seq_of_test = function | TestOutputStruct (s, _) | TestOutputFileMD5 (s, _) | TestOutputDevice (s, _) + | TestOutputHashtable (s, _) | TestLastFail s -> s let c_quote str =