[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: [PATCH, v4]: xl: randomly generate UUID's



On Monday 30 August 2010 14:51:23 Christoph Egger wrote:
> On Friday 27 August 2010 19:34:00 Gianni Tedesco wrote:
> > Changes since v3:
> >  - Fix LIBXL_UUID_BYTES on NetBSD. Note that the code assumes
> >    uint8_t[16] to always be interchangeable with libxl_uuid_t.

uuid_t is a struct in NetBSD. It is defined as:

#define __UUID_NODE_LEN  6 /* Length of a node address (an IEEE 802 address). 
*/
struct uuid {
    uint32_t time_low;
    uint16_t time_mid;
    uint16_t time_hi_and_version;
    uint8_t clock_seq_hi_and_reserved;
    uint8_t clock_seq_low;
    uint8_t node[_UUID_NODE_LEN];
};
typedef struct uuid uuid_t;

> >  - Return error messages when uuid_parse fails, spotted by Owen Smith
> >  - Implement "uuid" parameter in xl and exit with an error if parse
> >    fails
> > Changes since v2:
> >  - Re-based to remove orthogonal concern of UUID string formatting fixed
> >    in 22001:0b6f82eaaea9 "xl: make libxl_uuid2string internal to
> > libxenlight" - Incorporated Christoph Egger's suggestions
>
> I will test this.

gcc produces several warnings "return from incompatible pointer type"
and errors "cannot convert to a pointer type".

libxl_uuid.h:147: warning: return from incompatible pointer type
xl_cmdimpl.c:419: error: cannot convert to a pointer type

The assumption that uuid_t and uint8_t[16] being interchangeable
is wrong.

According to the manpage 
(http://netbsd.gw.com/cgi-bin/man-cgi?uuid++NetBSD-current),
what you probably want is uuid_enc_* and uuid_dec_* ?
The question is do want the binary representation in little endian
or big endian format?

Christoph



-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.