This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 208545 - Make virsh return useful error messages for not-well-formed XML
Make virsh return useful error messages for not-well-formed XML
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-29 06:54 EDT by Mark McLoughlin
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-08 11:01:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mark McLoughlin 2006-09-29 06:54:36 EDT
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 11:01:26 EST
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 11:01:52 EST
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.