WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

On Friday 27 August 2010 15:56:35 Gianni Tedesco wrote:
> On Thu, 2010-08-26 at 16:41 +0100, Christoph Egger wrote:
> > @@ -2219,8 +2224,11 @@ static void list_domains(int verbose, co
> >                  info[i].dying ? 'd' : '-',
> >                  ((float)info[i].cpu_time / 1e9));
> >          free(domname);
> > -        if (verbose)
> > -            printf(" " LIBXL_UUID_FMT,
> > LIBXL_UUID_BYTES(info[i].uuid));
> > +        if (verbose) {
> > +            char buf[LIBXL_UUID_LEN];
> > +            libxl_uuido_string(&info[i].uuid, buf, sizeof(buf));
> > +            printf(" %s", buf);
> > +        }
> >          putchar('\n');
> >      }
> >  }
>
> Really? There's no way to keep the macro approach and get at the thing
> like an array of bytes?

Yes. gcc complains about 'subscripted value is neither array nor pointer'.

> If that's the case then how can libxl_uuid_bytearray() that I introduced
> work correctly? 

I removed it because its redundant to libxl_uuido_string().
A bytearray and a string is the same in C unless you use unicode.

> I cannot tell because your patch does not include libxl_uuid.h ...

Then it does implicit. gcc would have complained otherwise.
We should use -Wmissing-declaration to be sure.

> Also I am not sure about the ocaml wrapper stuff but I will look in to
> it for next time. I have to re-spin the patch to detect UUID parse
> errors anyway.

Thanks.

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