Jay Gagnon wrote:
The move to connect_by_classname() work looks good, and in general I
like the cleanup of reg_prof_instance(), but I have one question about
it. You added a virConnectPtr to the argument list, and I'll grant the
function does need a connection it doesn't already have in there,
I have
reviewed the code before this change and all function do already
have this connection pointer. They even have to have this connection, as
this is now the provider entry point - first check is if the requested
class is equal to the installed hypervisor. So this is a performance
optimization, as it avoids establishing a second connection to libvirt,
while there is already one that can be used.
by why
not pass in a CMPIObjectPath so that it used to make the connection?
That way all the callers don't have to bother creating their own
connections just to pass them in, and since reg_prof_instance is already
being given a CMPIBroker and creates its own CMPIStatus, giving it the
ref will give it everything it needs to make the appropriate connection
and do the same "if (conn == NULL) goto out;" that the calling functions
do right now.
--
Regards
Heidi Eckhart
Software Engineer
Linux Technology Center - Open Hypervisor
heidieck(a)linux.vnet.ibm.com
**************************************************
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294