<html><body>
<p><tt>libvirt-cim-bounces@redhat.com wrote on 10/02/2011 12:41:09 PM:<br>
<br>
> Chip Vincent <cvincent@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 10/02/11 12:41 PM</tt><br>
<tt>> <br>
> Please respond to<br>
> cvincent@linux.vnet.ibm.com; Please respond to<br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> To</tt><br>
<tt>> <br>
> libvirt-cim@redhat.com</tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> Re: [Libvirt-cim] [PATCH] VirtualSystemManagementService: Avoid <br>
> extra connection to libvirt</tt><br>
<tt>> <br>
> Actually, this change only prevents a 'nested' connection. There are <br>
> still 2 connects; one in update_dominfo() and one in _resource_dynamic().</tt><br>
<br>
<tt>There should not be 2 connects here. One connection will be created in update_dominfo which will be closed on exiting that function and a new one created later in _resource_dynamic().</tt><br>
<tt><br>
> <br>
> Also, moving the call to update_dominfo() up negates the check<br>
> done by the code block that begins with<br>
> 'dom = virDomainLookupByName(conn, dominfo->name);'</tt><br>
<br>
<tt>There is a similar check in update_dominfo too.</tt><br>
<br>
<tt>In my opinion this patch makes sense.</tt><br>
<br>
<tt>-Sharad Mishra</tt><br>
<tt><br>
> <br>
> I don't see the real value of the change. Am I missing something?<br>
> <br>
> On 09/28/2011 04:44 PM, Eduardo Lima (Etrunko) wrote:<br>
> >   src/Virt_VirtualSystemManagementService.c |  4 ++--<br>
> >   1 files changed, 2 insertions(+), 2 deletions(-)<br>
> ><br>
> ><br>
> > # HG changeset patch<br>
> > # User Eduardo Lima (Etrunko)<eblima@br.ibm.com><br>
> > # Date 1317242639 10800<br>
> > # Node ID e02b7fef37d7f1f6a18d68991dc1409eef8905ec<br>
> > # Parent  942e9fa22bcb2681884cb39e1dcfc459c67ce197<br>
> > VirtualSystemManagementService: Avoid extra connection to libvirt<br>
> ><br>
> > Function update_device_info() has been called in after a creating <br>
> a connection<br>
> > to libvirt, while the itself creates a new connection. Moving the <br>
> function call<br>
> > a few lines above adresses this issue.<br>
> ><br>
> > Signed-off-by: Eduardo Lima (Etrunko)<eblima@br.ibm.com><br>
> ><br>
> > diff --git a/src/Virt_VirtualSystemManagementService.c b/src/<br>
> Virt_VirtualSystemManagementService.c<br>
> > --- a/src/Virt_VirtualSystemManagementService.c<br>
> > +++ b/src/Virt_VirtualSystemManagementService.c<br>
> > @@ -2331,6 +2331,8 @@<br>
> >                   return s;<br>
> >           }<br>
> ><br>
> > +        update_dominfo(dominfo, refcn);<br>
> > +<br>
> >           conn = connect_by_classname(_BROKER, refcn,&s);<br>
> >           if (conn == NULL) {<br>
> >                   CU_DEBUG("Failed to connect");<br>
> > @@ -2347,8 +2349,6 @@<br>
> >                   goto out;<br>
> >           }<br>
> ><br>
> > -        update_dominfo(dominfo, refcn);<br>
> > -<br>
> >           if (!domain_online(dom)) {<br>
> >                   CU_DEBUG("VS `%s' not online; skipping dynamic update",<br>
> >                            dominfo->name);<br>
> ><br>
> > _______________________________________________<br>
> > Libvirt-cim mailing list<br>
> > Libvirt-cim@redhat.com<br>
> > <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
> <br>
> -- <br>
> Chip Vincent<br>
> Open Virtualization<br>
> IBM Linux Technology Center<br>
> cvincent@linux.vnet.ibm.com<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
</tt></body></html>