Bug 278931

Summary: Invalid config files and ordinary text files in /etc/xen cause libvirt error messages
Product: Red Hat Enterprise Linux 5 Reporter: Jan Mark Holzer <jmh>
Component: libvirtAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 5.4CC: berrange, nzhang, syeghiay, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 09:21:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 475821    
Bug Blocks:    
Attachments:
Description Flags
libvirt-0.3.3-xm-conf-errors.patch none

Description Jan Mark Holzer 2007-09-05 17:57:56 UTC
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):

libvirt-0.2.3-8.el5

How reproducible:

Always 

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 16:10:59 UTC
I could not reproduce this in Update 2 with virt-manager, but 
it shows with virsh:

[root@test2 ~]# cat /etc/xen/foo 
#!/bin/sh
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.

Daniel

Comment 2 Daniel Berrangé 2008-05-22 16:39:11 UTC
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 09:28:54 UTC
Moved to 5.4, see discussion here:
http://post-office.corp.redhat.com/archives/virtualist/2008-September/thread.html#00173)

Setting to POST because we have a patch available.

Comment 5 Richard W.M. Jones 2008-09-17 09:30:14 UTC
Created attachment 316931 [details]
libvirt-0.3.3-xm-conf-errors.patch

Proposed patch to improve error message reporting.

Comment 8 Daniel Berrangé 2009-03-30 11:04:30 UTC
This bug is addressed by the 0.6.1 rebase for 5.4

Comment 11 Nan Zhang 2009-05-27 07:21:57 UTC
This has been verified in libvirt 0.6.3-3 on rhel-5.4. Already fixed.

Comment 12 Nan Zhang 2009-05-27 08:57:54 UTC
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 09:21:39 UTC
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.

http://rhn.redhat.com/errata/RHEA-2009-1269.html