Bug 278931 - Invalid config files and ordinary text files in /etc/xen cause libvirt error messages
Invalid config files and ordinary text files in /etc/xen cause libvirt error ...
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
All Linux
medium Severity low
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
Depends On: 475821
  Show dependency treegraph
Reported: 2007-09-05 13:57 EDT by Jan Mark Holzer
Modified: 2009-12-14 16:12 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 05:21:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
libvirt-0.3.3-xm-conf-errors.patch (9.44 KB, patch)
2008-09-17 05:30 EDT, Richard W.M. Jones
no flags Details | Diff

  None (edit)
Description Jan Mark Holzer 2007-09-05 13:57:56 EDT
Description of problem:

With the introduction of inactive domain management we now scan all
 text files in  /etc/xen .
However if there's an invalid file or a config file with missing
 configuration information an error message will be generated like
  the following :

libvir: error : configuration file syntax error: expecting an assignment

    In order to identify the offending file causing the error
    it would be helpful if the error message would also
    include the file name . This would make troubleshooting
    much easier and moving the offending file somewhere else.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Copy a random shell script/text file to /etc/xen 
2. Start virt-manager
3. watch the error message appear
4. move the offending file to a different location
5. error message gone
Actual results:

libvirt error message

Expected results:

Make the file name part of the error message to aid in diagnosis

Additional info:

Richard Jones has already looked at the issues and identified the code in
libvirt it is in xenXMConfigCacheRefresh it just looks for any file in /etc/xen
Comment 1 Daniel Veillard 2008-05-22 12:10:59 EDT
I could not reproduce this in Update 2 with virt-manager, but 
it shows with virsh:

[root@test2 ~]# cat /etc/xen/foo 
echo hello world
[root@test2 ~]# virsh list --all
libvir: error : configuration file syntax error: expecting an assignment
 Id Name                 State
  0 Domain-0             running
  2 backup               blocked
  - fedora8              shut off
  - freeipa              shut off
  - migr5                shut off
  - rawhide              shut off

[root@test2 ~]# 

  I'm not sure there is a proper way to really separate an error in
a xen config file and a shell script put there by mistake.

Comment 2 Daniel Berrange 2008-05-22 12:39:11 EDT
We can't prevent people putting random files in this directory. The only
improvement I'd suggest is that we make the error message include the filename
of the config file, so its clear which file they need to remove.
Comment 4 Richard W.M. Jones 2008-09-17 05:28:54 EDT
Moved to 5.4, see discussion here:

Setting to POST because we have a patch available.
Comment 5 Richard W.M. Jones 2008-09-17 05:30:14 EDT
Created attachment 316931 [details]

Proposed patch to improve error message reporting.
Comment 8 Daniel Berrange 2009-03-30 07:04:30 EDT
This bug is addressed by the 0.6.1 rebase for 5.4
Comment 11 Nan Zhang 2009-05-27 03:21:57 EDT
This has been verified in libvirt 0.6.3-3 on rhel-5.4. Already fixed.
Comment 12 Nan Zhang 2009-05-27 04:57:54 EDT
Verified steps:

1. Copy text file and shell script into /etc/xen
2. Start virt-manager, and no any error message appears
3. Check ~/.virt-manager/virt-manager.log, no errors found
Comment 14 errata-xmlrpc 2009-09-02 05:21:39 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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