
3 Feb
2012
3 Feb
'12
6:13 p.m.
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 eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org