
On 02/07/2012 07:03 AM, Osier Yang wrote:
I don't like this interface - it makes virrandom.c know too much. A better interface would be:
virRandomGenerateWWN(char **wwn, const char *oui)
where the caller is responsible for determining the appropriate OUI for the hypervisor to be passed in.
I have thought this, but the problem is we want auto-generate the WWN, the nodedevice driver doesn't known which OUI should be passed to virRandomGenerateWWN in this case, unless we extend the API virNodeDeviceCreateXML to accept a flag, or introduce a new API. I guess we won't want to see this in this period. :-)
I'm okay if we ditch this for now. But I guess I still don't understand the motivation behind this patch - what's the original scenario where we are parsing XML where auto-generating a WWN would prove useful? If it is done through a connection, then we know what hypervisor we are targetting, and that hypervisor should have the information on what OUI to prefer. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org