<br>
<br><tt><font size=2>libvir-list-bounces@redhat.com wrote on 02/04/2010
08:50:29 AM:<br>
<br>
> <br>
> libvir-list, Gerhard Stenzel, Vivek Kashyap</font></tt>
<br><tt><font size=2>> <br>
> 2010/2/4 Gerhard Stenzel <gstenzel@linux.vnet.ibm.com>:<br>
> > On Mon, 2010-01-25 at 14:59 +0000, Daniel P. Berrange wrote:<br>
> >> The shear size of the ruleset inside the <interface>
element is<br>
> >> rather alarming to me. Imagine if you have a guest with more<br>
> >> than one NIC.  I'm inclined to suggest that the <interface><br>
> >> element in the domain XML description should only have a
single<br>
> >> rule<br>
> >><br>
> >>    <filter name='BLAH'/><br>
> >><br>
> >> and if apps wish to construct a filter, from multiple independant<br>
> >> sub-filters, then that should be done against the filter
object's<br>
> >> config, rather than the domain object's config.<br>
> ><br>
> > Daniel,<br>
> > we could achieve something similar with the following construct:<br>
> ><br>
> > <xi:include href="demofilter.xml"<br>
> > xmlns:xi="</font></tt><a href=http://www.w3.org/2001/XInclude><tt><font size=2>http://www.w3.org/2001/XInclude</font></tt></a><tt><font size=2>"/><br>
> ><br>
> > This would also have the advantage that the filter rules do not
clutter<br>
> > up the domain xml, but the migration of the rules might be simpler
to<br>
> > implement.<br>
> > What is your thinking about this approach?<br>
> ><br>
> > --<br>
> > Best regards,<br>
> ><br>
> > Gerhard Stenzel,<br>
> <br>
> Such an include mechanism was suggest by Dan before, but I don't think<br>
> that XInclude is a good approach, because this will make the XML<br>
> handling more complicated.<br>
> <br>
> The main libvirt functions to define/create a new guest are<br>
> virDomainDefineXML and virDomainCreateXML. Both take the domain XML<br>
> description a string. They don't take filenames. Using XInclude<br>
> introduces the need for filenames to be able to reference them by
the<br>
> href attribute of an XInclude element. Even if libvirt stores the<br>
> filter rules as files internally this should be considered as an<br>
> implementation detail. IMHO exposing paths to internal files isn't
a<br>
> good design decision. The same is true for virDomainGetXMLDesc, it<br>
> would have to expose paths to internal files to be read by management<br>
> applications using libvirt.<br>
> <br>
> I think the best approach to handle the filter setup while being able<br>
> build complex filter from simpler parts is an include mechanism, but<br>
> not using XInclude or reference the filter parts by filename, but
by<br>
> filter name.</font></tt>
<br>
<br><tt><font size=2>The problem with the references is the migratability.
In my opinion, the filters attached to a virtual machine's interface should
migrate to a destination host completely transparently using 'virsh migrate'
and allow migration to fail if the instantiation of the rule fails due
to for example a missing ebtables/iptables support module, but not due
to missing filter XML. This means that in the simple case where the VM
had a filter rule no-ip-spoofing active on an interface on the source this
same filtering should become active on the destination. However, most VMs
will have much more complex rules and may use references to existing templates
and add their own interface specific rules on top of that. Now how do you
migrate that? How do you handle cases where a template on the source was
referenced and may be missing on the destination or if the template on
the destination is different (ignore it?). I guess the more involved solution
would be to migrate the whole tree of referenced filters and using internal
APIs to again make them available on the host, failing if filters with
same names already exists, succeeding for others. Not sure whether the
migration protocol can handle that...</font></tt>
<br><tt><font size=2><br>
> <br>
> <domain><br>
>   <devices><br>
>     <interface><br>
>       <filter name='demofilter'/><br>
>     </interface><br>
>   </devices><br>
> </domain><br>
> <br>
> <filter name='demofilter'><br>
>   <include filter='dropall'/><br>
>   ...<br>
> </filter><br>
> <br>
> <filter name='dropall'><br>
>   ...<br>
> </filter><br>
> <br>
> libvirt would have API to handle filters by name and their XML<br>
> description in string form, no file handling involved. Maybe something<br>
> like this in line with the rest of the libvirt API:<br>
> <br>
> virConnectListFilters to list all known filters<br>
> virFilterDefineXML to define a filter from an XML description in string
form<br>
> virFilterUndefine to undefine an existing filter<br>
> virFilterGetXMLDesc to get the XML description in string form of an<br>
> existing filter<br>
> virFilterLookupByName to find a filter by name<br>
> ...</font></tt>
<br>
<br><tt><font size=2>Yes, initial prototype provides similar functions
but does not solve the migration problem ...</font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br>
<br><tt><font size=2><br>
> </font></tt>
<br><tt><font size=2><br>
> Matthias<br>
> <br>
> --<br>
> libvir-list mailing list<br>
> libvir-list@redhat.com<br>
> </font></tt><a href="https://www.redhat.com/mailman/listinfo/libvir-list"><tt><font size=2>https://www.redhat.com/mailman/listinfo/libvir-list</font></tt></a>