Re: [Qemu-devel] [PATCH v5 1/9] util: Add UUID API

2016-08-11 Thread Fam Zheng
On Fri, 08/12 07:24, Richard Henderson wrote: > On 08/12/2016 05:52 AM, Fam Zheng wrote: > >+/* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */ > >+ > >+typedef struct { > >+union { > >+unsigned char data[16]; > >+struct { > >+/* Generated in BE endian, can b

Re: [Qemu-devel] [PATCH v5 1/9] util: Add UUID API

2016-08-11 Thread Richard Henderson
On 08/12/2016 05:52 AM, Fam Zheng wrote: +/* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */ + +typedef struct { +union { +unsigned char data[16]; +struct { +/* Generated in BE endian, can be swapped with qemu_uuid_bswap. */ Nit: BE endian is redundant.

[Qemu-devel] [PATCH v5 1/9] util: Add UUID API

2016-08-11 Thread Fam Zheng
A number of different places across the code base use CONFIG_UUID. Some of them are soft dependency, some are not built if libuuid is not available, some come with dummy fallback, some throws runtime error. It is hard to maintain, and hard to reason for users. Since UUID is a simple standard with