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

[libvirt] [PATCH] Misleading error message when name is missing



Hi,

[forwarding this here from RH bug #796732]

When creating a network (virsh net-create) with an erroneous XML
containing an empty <name> 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. Attached patch (warning: against a
completly different git than yours, don't pay attention to wrong shas)
thus make this message more generic.

Regards,
Benjamin

PS: please Cc me, I'm not subscribed
diff --git a/src/util/virterror.c b/src/util/virterror.c
index 44a276a..833ae68 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -879,9 +879,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)

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