On 2012年02月10日 07:05, Eric Blake wrote:
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?
Basically it's the request from customer so that the admins don't
have to specify the WWNs manually when using their management apps,
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.
That's the way this patch goes. :)
Thanks, now I pushed the patch.
Osier