<br><tt><font size=2>Eric Blake <eblake@redhat.com> wrote on 04/21/2010
10:59:35 AM:<br>
<br>
<br>
> On 04/20/2010 05:50 PM, Stefan Berger wrote:<br>
> <br>
> I've done a quick style review, but have not looked closely at the<br>
> locking algorithm to see if it is sane, so you'll have to wait for<br>
> another review (possibly by me, if I have a longer chunk of time to<br>
> spend on it) before you get an ack.<br>
> <br>
> >  #define VIR_FROM_THIS VIR_FROM_NWFILTER<br>
> >  <br>
> > +#define IFINDEX2STR(VARNAME, ifindex) \<br>
> > +    char VARNAME[20]; \<br>
> > +    snprintf(VARNAME, sizeof(VARNAME), "%d",
ifindex);<br>
> <br>
> Use gnulib's intprops.h for INT_BUFSIZE_BOUND(ifindex) instead of<br>
> hard-coding an array of 20 bytes.  At which point you could safely
use<br>
> sprintf instead of snprintf, for a micro-optimization (although I'm<br>
> still fine seeing snprintf).</font></tt>
<br>
<br><tt><font size=2>I was looking for a #define like that. Thanks for
pointing me to this one.</font></tt>
<br><tt><font size=2><br>
> <br>
> > +<br>
> > +static bool threadsTerminate = false;<br>
> <br>
> Explicit initialization to false is not necessary; the language<br>
> guarantees 0-initialization of variables at file scope.</font></tt>
<br>
<br><tt><font size=2>I know. I will remove it.</font></tt>
<br><tt><font size=2><br>
> <br>
> > @@ -77,6 +78,7 @@ virNWFilterTearNWFilter(virDomainNetDefP<br>
> >  static inline void<br>
> >  virNWFilterTearVMNWFilters(virDomainObjPtr vm) {<br>
> >      int i;<br>
> > +<br>
> >      for (i = 0; i < vm->def->nnets;
i++)<br>
> <br>
> As long as you are making a cosmetic-only change here, does it make<br>
> sense to switch to 'unsigned int i' for the iterator?</font></tt>
<br>
<br><tt><font size=2>Also def->nnets is defined as 'int', so that's
why I am using int also here.</font></tt>
<br>
<br><tt><font size=2>Regards,</font></tt>
<br><tt><font size=2>   Stefan</font></tt>
<br>
<br><tt><font size=2><br>
> <br>
> I didn't notice anything else in my rapid style read-through.<br>
> <br>
> -- <br>
> Eric Blake   eblake@redhat.com    +1-801-349-2682<br>
> Libvirt virtualization library </font></tt><a href=http://libvirt.org/><tt><font size=2>http://libvirt.org</font></tt></a><tt><font size=2><br>
> <br>
> [attachment "signature.asc" deleted by Stefan Berger/Watson/IBM]
</font></tt>