From: Benjamin Cama Date: Thu, 23 Feb 2012 16:37:30 +0000 (+0100) Subject: virterror: Misleading error message when name is missing X-Git-Tag: v0.9.11-rc1~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff5573da22bfdc0db9d90d6a3a25a520cb1b955;p=thirdparty%2Flibvirt.git virterror: Misleading error message when name is missing [forwarding this here from RH bug #796732] When creating a network (virsh net-create) with an erroneous XML containing an empty element, the error message is misleading: error: Failed to create network from foo.xml error: missing domain name information It took me a bit of time to figure out that it was the *network* name that was missing (I generate this xml and didn't look at it, first). I realized that the same message is used for missing name when creating a domain, network, or device node. --- diff --git a/AUTHORS b/AUTHORS index 1769e8abed..32d5173e90 100644 --- a/AUTHORS +++ b/AUTHORS @@ -222,6 +222,7 @@ Patches have also been contributed by: Kyle Mestery Lincoln Myers Peter Robinson + Benjamin Cama [....send patches to get your name here....] diff --git a/src/util/virterror.c b/src/util/virterror.c index de6018527d..48c61a2e12 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -880,9 +880,9 @@ virErrorMsg(virErrorNumber error, const char *info) break; case VIR_ERR_NO_NAME: if (info == NULL) - errmsg = _("missing domain name information"); + errmsg = _("missing name information"); else - errmsg = _("missing domain name information in %s"); + errmsg = _("missing name information in %s"); break; case VIR_ERR_NO_OS: if (info == NULL)