Bug 208545 - Make virsh return useful error messages for not-well-formed XML
Summary: Make virsh return useful error messages for not-well-formed XML
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-29 10:54 UTC by Mark McLoughlin
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-08 16:01:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mark McLoughlin 2006-09-29 10:54:36 UTC
i.e. atm with not-well-formed XML, you get

$> virsh create ./Test1-diskless.xml
error: Failed to create domain from ./Test1-diskless.xml

because:

       xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
                        XML_PARSE_NOENT | XML_PARSE_NONET |
                        XML_PARSE_NOERROR | XML_PARSE_NOWARNING);

it'd be nice to get the real libxml warning:

domain.xml:11: parser error : expected '>'
  <devices><interface><mac address="00:16:3E:6C:05:FB"/></interface</devices>

Comment 1 Daniel Veillard 2006-11-08 16:01:26 UTC
Okay, makes sense, but need to be hooked with care as the program embedding 
libvirt may use libxml2 for other operations. Seems fixed in libvirt CVS:

---------------------------------
[root@paphio src]# ./virsh create bug.xml 
libvir: XML error : line 10: Opening and ending tag mismatch: os line 5 and s
libvir: Xen Daemon error : XML description for domain is not well formed or invalid
error: Failed to create domain from bug.xml

[root@paphio src]# 
------------------------------

  thanks !

Daniel

Comment 2 Daniel Veillard 2006-11-08 16:01:52 UTC
Okay, makes sense, but need to be hooked with care as the program embedding 
libvirt may use libxml2 for other operations. Seems fixed in libvirt CVS:

---------------------------------
[root@paphio src]# ./virsh create bug.xml 
libvir: XML error : line 10: Opening and ending tag mismatch: os line 5 and s
libvir: Xen Daemon error : XML description for domain is not well formed or invalid
error: Failed to create domain from bug.xml

[root@paphio src]# 
------------------------------

  thanks !

Daniel


Note You need to log in before you can comment on or make changes to this bug.