Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 726771 - libvirt does not specify problem file if persistent xml is invalid
libvirt does not specify problem file if persistent xml is invalid
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.2
All All
low Severity low
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-29 14:38 EDT by Dave Allan
Modified: 2016-04-26 10:26 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Bug Fix
Doc Text:
Libvirt made a lot of improvements in reporting errors in XML file parsing that make identifying error easier.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:29:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Dave Allan 2011-07-29 14:38:48 EDT
If a user mistakenly edits the persistent XML on disk instead of using API editing commands, it's possible for the persistent XML on disk to become invalid.  Of course, users should not be editing the XML on disk, so this situation should not happen(™).  Since users frequently do edit the on disk XML, we should try to let them know what they broke.  Currently if I break the XML for a qemu domain, the result in /var/log/libvirt/libvirtd.log is:

10:53:14.690: 793: error : catchXMLError:653 : at line 28: Opening and ending tag mismatch: memory line 11 and domain

which is great if I know what I'm looking for, because it tells me what's wrong with the XML.  However, if all I know is that my VM suddenly vanished, it doesn't help me much in figuring out why.  I would like to see additionally an error message along the lines of:

failed to parse domain [or network, etc] XML from /etc/libvirt/qemu/goat.xml

which would tell me what file is broken.
Comment 3 Peter Krempa 2011-09-06 10:56:46 EDT
Fixed in upstream:

commit 9fd3bb7a88bd41a5cf4830529b3b3c87260be62e
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Sep 6 15:48:22 2011 +0800

    XML: Improve XML parsing error messages
Comment 6 yanbing du 2012-01-10 02:04:51 EST
Test this bug on libvirt-0.9.9-1.el6.x86_64.
Edit the persistent XML file of a guest on disk, such as:
----<snip>----

<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6_x86_64_qcow2.img --->here, delete the end tag(" '/> ").
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

----</snip>----
then restart libvirtd, the guest disappeared in virsh list, and we can find the following error message in libvirtd log:
----<snip>----

2012-01-10 07:02:26.415+0000: 9309: error : virCommandWait:2271 : internal error Child process (/sbin/iscsiadm --mode session) status unexpected: exit status 21
2012-01-10 07:02:26.773+0000: 9309: error : catchXMLError:711 : /etc/libvirt/qemu/test.xml:32: Unescaped '<' not allowed in attributes values
      <target dev='vda' bus='virtio'/>
------^

----</snip>----

So move bug to VERIFIED
Comment 7 Peter Krempa 2012-05-02 09:49:23 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Libvirt made a lot of improvements in reporting errors in XML file parsing that make identifying error easier.
Comment 9 errata-xmlrpc 2012-06-20 02:29:43 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html

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