On 02/03/2012 11:05 AM, Eric Blake wrote:
>> +   if (virAsprintf(wwn, "%x%s%x%02x%02x%02x%02x", 0x5, QUMRANET_OUI,
> 
> Why not just:
> 
> if (virAsprintf(wwn, "5" QUMRANET_OUI "%010llx",
>                 (unsigned long long) virRandomBits(36)) < 0)

Correction - %09llx, for 36 bits of output from your random number.

I suppose you could also use

"5" QUMRANET_OUI "%09" PRIx64, virRandomBits(36)

to avoid the cast.

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to