
On Fri, Oct 13, 2017 at 14:45:05 -0400, John Ferlan wrote:
In any case, the 'ModelIsAllowed" now feels overloaded returning more than just true/false that a typical "Is" type function would return. Sorry, I don't have suggestions, so unless someone else is looking and has a better name, then just go with it.
Hmm, I have a suggestion. I should just create a separate function virDomainCapsCPUModelsGet or *Find which would just return a pointer to the CPU model structure from the models array and change virCPUModelIsAllowed into a simple wrapper around the new function. The callers which would pass non-NULL hvModel pointer would just call the underlying virDomainCapsCPUModelsGet function directly.
That would seem to work and Get would perhaps also imply it's not a copy but rather a pointer to something existing.
Yeah, I think it looks better. See v2 of this series. Jirka