[libvirt] [PATCH] virsh edit command

Daniel Veillard veillard at redhat.com
Wed Jul 30 11:54:46 UTC 2008


On Wed, Jul 30, 2008 at 12:49:20PM +0100, Richard W.M. Jones wrote:
> On Wed, Jul 30, 2008 at 06:04:23AM -0400, Daniel Veillard wrote:
> > On Wed, Jul 30, 2008 at 10:56:48AM +0100, Richard W.M. Jones wrote:
> > > On Wed, Jul 30, 2008 at 05:43:44AM -0400, Daniel Veillard wrote:
> > > >   Hum, I would check for basic well-formedness here because it just
> > > > too easy to break the XML file while editing with a text editor
> > > 
> > > But the subsequent call to virDomainDefineXML should fail if the XML
> > > isn't well-formed.
> > 
> >   Right, but you're taking a risk and not giving a chance for the
> > user to escape while being safe.
> 
> As it stands, this is the error message that users get if they edit
> the XML so that it is not well-formed:
> 
>   # virsh edit RHEL5U2
>   libvir: QEMU error : XML description not well formed or invalid
> 
> and the XML isn't changed.

  and they don't see the error information from libxml2 and the line number ?
if that's the case that's one more argument for doing that separated
well formedness checking. Could be a good time to check against the RNG
too because those are not things easilly doable from the library itself.
If you don't like this, don't do it, but i think it's wrong from an user POV

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list