On Wed, 08/10 16:25, Richard Henderson wrote:
> On 08/09/2016 12:19 PM, Fam Zheng wrote:
> >+/* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */
> >+
> >+typedef struct {
> >+unsigned char data[16];
> >+} QemuUUID;
> ...
> >+void qemu_uuid_generate(QemuUUID *uuid)
> >+{
> >+int i;
>
On 08/09/2016 12:19 PM, Fam Zheng wrote:
+/* Version 4 UUID (pseudo random numbers), RFC4122 4.4. */
+
+typedef struct {
+unsigned char data[16];
+} QemuUUID;
...
+void qemu_uuid_generate(QemuUUID *uuid)
+{
+int i;
+uint32_t *out = (uint32_t *)&uuid->data[0];
You can't do this cas
On Tue, 08/09 15:46, Jeff Cody wrote:
> So the short of it: I think this new function should be explicitly called
> something like "qemu_uuid_bswap()", and do blind bswaps. That makes it a
> drop in replacement for VDI.
Right, I should make it bswap.
Fam
On Tue, Aug 09, 2016 at 02:49:59PM +0800, Fam Zheng wrote:
> 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
On Tue, Aug 09, 2016 at 02:49:59PM +0800, Fam Zheng wrote:
> 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
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