[libvirt] [PATCH 3/4] Improve incorrect root element error messages

Cole Robinson crobinso at redhat.com
Thu May 19 14:38:12 UTC 2011


On 05/18/2011 11:47 AM, Michal Privoznik wrote:
> ---
>  src/conf/cpu_conf.c           |    7 ++++---
>  src/conf/domain_conf.c        |   12 ++++++++----
>  src/conf/interface_conf.c     |    6 ++++--
>  src/conf/network_conf.c       |    6 ++++--
>  src/conf/node_device_conf.c   |    6 ++++--
>  src/conf/secret_conf.c        |    6 ++++--
>  src/conf/storage_conf.c       |   12 ++++++++----
>  src/security/virt-aa-helper.c |    3 ++-
>  src/test/test_driver.c        |   13 ++++++++++---
>  src/util/xml.c                |    2 +-
>  10 files changed, 49 insertions(+), 24 deletions(-)
> 

I think most of these error messages as well can be consolidated in
virXMLParseFile. The caller can pass in the root element name, and
virXMLParseFile can just do all this validation, and return a
XPathContext pointer. If any caller needs the xmlDocPtr, it's stored in
ctxt->doc.

Thanks,
Cole




More information about the libvir-list mailing list