[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Fix messages using VIR_ERR_XML_ERROR



On 05/12/2011 03:47 PM, Cole Robinson wrote:
> This error code has existed since the dawn of time, yet the messages it
> generates are almost universally busted. Here's a small sampling:
> 
> src/conf/domain_conf.c:4889 : XML description for missing root element is not well formed or invalid
> src/conf/domain_conf.c:4951 : XML description for unknown device type is not well formed or invalid
> src/conf/domain_conf.c:5460 : XML description for maximum vcpus must be an integer is not well formed or invalid
> src/conf/domain_conf.c:5468 : XML description for invalid maxvcpus %(count)lu is not well formed or invalid
> 
> Fix up the error code to instead be
> 
> XML error: <msg>
> 
> Adjust the few locations that we using the original correctly (or shouldn't

s/we/were/

> have been using the error code at all).
> 
> Signed-off-by: Cole Robinson <crobinso redhat com>
> ---
>  src/test/test_driver.c |   21 ++++++++++++++-------
>  src/util/virterror.c   |    4 ++--
>  src/xen/xm_internal.c  |    5 +++--
>  3 files changed, 19 insertions(+), 11 deletions(-)

ACK; even if we further improve things later, this patch is a definite
improvement on its own merits.

> +++ b/src/util/virterror.c
> @@ -925,9 +925,9 @@ virErrorMsg(virErrorNumber error, const char *info)
>              break;
>          case VIR_ERR_XML_ERROR:
>              if (info == NULL)
> -                errmsg = _("XML description not well formed or invalid");
> +                errmsg = _("XML description is not well formed or invalid");

The placement of "not" makes this a bit ambiguous; is it worth using:

"XML description is invalid or not well formed"

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]