<html><body>
<p>Pragmatically, I think a simple parser that only handles simple xm config files would probably be fine 98% of the time, especially if you expect in most situations the VMs will be created via libvirt anyway. The issue for us with our old libxm interface was for for our particular product offering we just didnt have the option to say "also supports most existing xm configurations" [in terms of official marketing product support statements it was 'better' to say we dont support any...]. If you are OK with recommending to users to use libvirt-based tools to create DomUs, but that most other typical xm config files are supported too (if you put them in such and such place) then I dont see a problem. <br>
<br>
At the *very* worst, is there a way you can pipe an arbitrary xm config file thru xm and have it spit out what it would have done, without actually doing it? That could be a reliable fallback migration path perhaps.<br>
<br>
- Gareth<br>
<br>
Dr. Gareth S. Bestor<br>
IBM Linux Technology Center<br>
M/S DES2-01<br>
15300 SW Koll Parkway, Beaverton, OR 97006<br>
503-578-3186, T/L 775-3186, Fax 503-578-3186 <br>
<br>
<img width="16" height="16" src="cid:1__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for "Daniel P. Berrange" <berrange@redhat.com>">"Daniel P. Berrange" <berrange@redhat.com><br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:2__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">"Daniel P. Berrange" <berrange@redhat.com></font></b><font size="2"> </font><br>
<font size="2">Sent by: libvir-list-bounces@redhat.com</font>
<p><font size="2">08/23/06 05:23 PM</font>
<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center"><font size="2">Please respond to<br>
"Daniel P. Berrange" <berrange@redhat.com></font></div></td></tr>
</table>
</ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Daniel Veillard <veillard@redhat.com></font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">libvir-list@redhat.com</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">Re: [Libvir] Semantics for ListDomains/ ListDefinedDomains</font></td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:3__=07BBFB47DF9A7BE78f9e8a93df938@us.ibm.com" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<tt>On Wed, Aug 23, 2006 at 05:15:26PM -0400, Daniel Veillard wrote:<br>
> On Wed, Aug 23, 2006 at 09:22:08PM +0100, Daniel P. Berrange wrote:<br>
> > Now it would be pretty easy for libvirt to convert the XML file passed<br>
> > into virDefineDomain into a config file for xend & stuf it in /etc/xen<br>
> > The hard part is the reverse - enumerating the config files in the<br>
> > dir & turning them back into XML. I fear we may have to tackle that<br>
> > hard part sooner rather than later so I've been trying to thing of<br>
> > ways we could attack it. Now the key problem is that the xm config<br>
> > files can contain/are in fact python code.<br>
> <br>
>   I could see a problem with random apps writing to /etc/ , even if run<br>
> as root that won't fly in general. But well if the goal is compatibility<br>
> with existing xen tools, that may be a sufficient reason.<br>
<br>
Well there's unlikely to be random apps writing into /etc/xen unless<br>
they're related to Xen config. We can ust blacklisted the 'xend-config.sxp'<br>
file (& perhaps the xmexample* files)<br>
<br>
> >  * Write a tiny parser for a trivial subset - basically enough to<br>
> >    handle the (key, string) pairs & (key, list of string) pairs.<br>
> >    Certainly doable - depending on how general purpose we want to<br>
> >    get - do we care about the 'if..else' conditional used in the<br>
> >    sample /etc/xen/xmexample.vti config file ? We can certainly<br>
> >    make a valid case saying we don't care about this because the<br>
> >    libvirt XML -> xm config conversion would not generate config<br>
> >    using that capability <br>
> <br>
>    I'm not too concerned by handling only a subset, this should be data<br>
> and processed as such IMHO.<br>
<br>
Sounds good.<br>
<br>
> > Not a perfect solution, but would satisfy a great deal of common<br>
> > use cases pretty easily without being intrusive into existing code<br>
> > base & pretty secure.<br>
> <br>
>   We are basically in agreement :-)<br>
> So I write that parser ? <br>
<br>
Sounds like we should, unless anyone (CIM guys ?) listening in has better <br>
suggestions ?<br>
<br>
Regards,<br>
Dan.<br>
-- <br>
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|<br>
|=-           Perl modules: </tt><tt><a href="http://search.cpan.org/~danberr/">http://search.cpan.org/~danberr/</a></tt><tt>              -=|<br>
|=-               Projects: </tt><tt><a href="http://freshmeat.net/~danielpb/">http://freshmeat.net/~danielpb/</a></tt><tt>               -=|<br>
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| <br>
<br>
--<br>
Libvir-list mailing list<br>
Libvir-list@redhat.com<br>
</tt><tt><a href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a></tt><tt><br>
</tt><br>
</body></html>