On Thu, 08/04 11:33, Jeff Cody wrote: > > +void qemu_uuid_generate(qemu_uuid_t out) > > +{ > > + /* Version 4 UUID, RFC4122 4.4. */ > > + QEMU_BUILD_BUG_ON(sizeof(qemu_uuid_t) != 16); > > + *((guint32 *)out + 0) = g_random_int(); > > + *((guint32 *)out + 1) = g_random_int(); > > + *((guint32 *)out + 2) = g_random_int(); > > + *((guint32 *)out + 3) = g_random_int(); > > + out[7] = (out[7] & 0xf) | 0x40; > > Hi Fam, > > I think this gets the endianness wrong of the time_hi_and_version field. > > I believe this should be: > out[6] = (out[6] & 0xf) | 0x40; > > (but I don't think we should generate it this way, see below)
Right, I'm using a wrong endianness. Will fix this. Fam