Bug 697808
Summary: | Improve error message when passing XML doc with wrong root element to define/create APIs. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Vivian Bian <vbian> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.1 | CC: | berrange, dallan, dyuan, eblake, jyang, mzhan, rwu, whuang, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.9.9-1.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause: Passing a XML with incorrect root element throws an wrong and useless error.
Consequence: Users were confused.
Change: Change error strings (from "incorrect root element" to "unexpected root element X expecting to see Y") and error codes (from "internal error" to "xml error").
Result: Users are no longer confused even when they provide incorrect XML.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2012-06-20 06:27:10 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: |
Description
Vivian Bian
2011-04-19 10:46:46 UTC
> # virsh define mypool-duplicate
> error: Failed to define domain from mypool-duplicate
> error: internal error incorrect root element
You are using the wrong command here. You need 'pool-define', not 'define'.
I would close this NOTABUG, but I think we could actually improve the error message
a. It is not an 'internal error', it is a user error
b. 'incorrect root element' should really say 'unexpected root element <pool>, expecting to see <domain>'
I expect all the other virXXXXDefine and virXXXCreate methods which accept an XML doc could benefit from same improved error messages.
Patches sent upstream: https://www.redhat.com/archives/libvir-list/2011-April/msg01183.html Moving to POST: commit a6916977bb4d3b1d765ceccd614f6514b0ce355a Author: Michal Privoznik <mprivozn> AuthorDate: Fri Nov 25 13:23:03 2011 +0100 Commit: Michal Privoznik <mprivozn> CommitDate: Mon Nov 28 15:12:37 2011 +0100 conf: Improve incorrect root element error messages When user pass wrong root element, it is not 'internal error' and we can give him hint what we are expecting. v0.9.7-167-ga691697 I can reproduce this bug with libvirt-0.8.7-18.el6_1.3.x86_64 verify on: libvirt-0.9.9-1.el6.x86_64 step: # virsh pool-list --all Name State Autostart ----------------------------------------- default active yes dir active yes testiqn active yes #virsh pool-dumpxml dir > dir-duplicate #virsh define dir-duplicate error: Failed to define domain from dir-duplicate error: XML error: unexpected root element <pool>, expecting <domain> the error message improved. move to verified. 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: Cause: Passing a XML with incorrect root element throws an wrong and useless error. Consequence: Users were confused. Change: Change error strings (from "incorrect root element" to "unexpected root element X expecting to see Y") and error codes (from "internal error" to "xml error"). Result: Users are no longer confused even when they provide incorrect XML. 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 |