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

2016-08-11 Thread Richard Henderson
On 08/12/2016 03:01 AM, Fam Zheng wrote: On Thu, 08/11 23:21, Richard Henderson wrote: On 08/11/2016 05:50 AM, Fam Zheng wrote: +void qemu_uuid_bswap(QemuUUID *uuid) +{ +bswap32s((uint32_t *)&uuid->data[0]); +bswap16s((uint16_t *)&uuid->data[4]); +bswap16s((uint16_t *)&uuid->data[6]

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

2016-08-11 Thread Fam Zheng
On Thu, 08/11 23:21, Richard Henderson wrote: > On 08/11/2016 05:50 AM, Fam Zheng wrote: > >+void qemu_uuid_bswap(QemuUUID *uuid) > >+{ > >+bswap32s((uint32_t *)&uuid->data[0]); > >+bswap16s((uint16_t *)&uuid->data[4]); > >+bswap16s((uint16_t *)&uuid->data[6]); > >+} > > You have align

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

2016-08-11 Thread Richard Henderson
On 08/11/2016 05:50 AM, Fam Zheng wrote: +void qemu_uuid_bswap(QemuUUID *uuid) +{ +bswap32s((uint32_t *)&uuid->data[0]); +bswap16s((uint16_t *)&uuid->data[4]); +bswap16s((uint16_t *)&uuid->data[6]); +} You have alignment problems here too. Perhaps you really did want to add uint32

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

2016-08-10 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