<br><tt><font size=2>Eric Blake <eblake@redhat.com> wrote on 09/28/2010
03:19:42 PM:<br>
<br>
</font></tt>
<br><tt><font size=2>> <br>
> On 09/27/2010 02:26 PM, Stefan Berger wrote:<br>
> >>> The patch below extends the XML parser and generator
so that every<br>
> > protocol<br>
> >>> now can have a comment node. Comments are limited to
256 characters<br>
> > and are<br>
> >>> tested to only contain printable characters or spaces.<br>
> >><br>
> >> Literal spaces, or generic blanks (space and tab for sure,
but what<br>
> >> about newline, not to mention vertical tab, form feed, ...),
all of<br>
> >> which are technically printable according to c_isprint()?<br>
> ><br>
> > I have been doing some testing using 'virsh nwfilter-edit'. I
edited a<br>
> > comment and put horizontal tabs into it or newlines or a combination
of<br>
> > both. Both of these seem to automatically be converted to space,
 meaning<br>
> > that when the XML is generated after the parsing, the tab or
newline now<br>
> > are shown as simple space. I also wrote the XML into a file using
'virsh<br>
> > nwfilter-dumpxml', added a newline in the comment, ran unix2dos
on it to<br>
> > get '\r' and used 'virsh nwfilter-define' on it again, and the
'\r'<br>
> > disappeared. From that I took that the XML parser does the correct<br>
> > replacement already and I don't need to worry about it  --
assuming it<br>
> > would do the same for vertical tab as well.<br>
> <br>
> Tab seems like it would be most likely for people to want, but I'm
okay <br>
> with leaving it unsupported for now until someone complains (and even
<br>
> then, it depends on whether XML parsing can even preserve tabs).<br>
> <br>
> Patch 1 #defines MAX_COMMENT_LENGTH 256 in nwfilter_conf.c, patch
2 <br>
> #defines IPTABLES_MAX_COMMENT_SIZE  256 MAX_COMMENT_LENGTH 256
in <br>
> nwfilter_ebiptables_driver.h.  Should these two values be consolidated
<br>
> into a single name in a common .h file in patch 1?</font></tt>
<br>
<br><tt><font size=2>I chose two independent constants to reflect that
the parser and the (iptables) driver should be somewhat loosely coupled.
The iptables driver could cut the size of the comment down to what it can
handle, though in this case the sizes match.</font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br>