Currently when configuring a too long interface name with
lxc.network.veth.pair lxc will say:

    lxc_confile - invalid interface name: veth_haproxy_br0

leaving the user add odds what possibly could be wrong with that name.
Please give the user a clearer error message.

I suggest to change the error message to

   "interface name '%s' is too long (> %d)".

The patch below implements this change.

Thanks
*t
 
commit bc7fa5c391bc8e767fdb7322d6c60c3c5e098583
Author: Tomas Pospisek <tpo...@sourcepole.ch>
Date:   Sun Oct 28 12:15:19 2012 +0100

    clearer error message when interface name to long

    Signed-off-by: Tomas Pospisek <tpo_...@sourcepole.ch>

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 94bb698..c8d736c 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -370,7 +370,7 @@ static struct lxc_netdev *network_netdev(const char
*key, const char *value,
 static int network_ifname(char **valuep, char *value)
 {
        if (strlen(value) >= IFNAMSIZ) {
-               ERROR("invalid interface name: %s", value);
+               ERROR("interface name '%s' is too long (> %d)", value,
IFNAMSIZ - 1);
                return -1;
        }


------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to