[Kimchi-devel] [PATCH] Issue #693: VLAN ID accepting only one digit

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Mon Aug 31 20:11:28 UTC 2015


Are you sure the issue number is 693? 
I visited the this issue on GitHub and it pointed me to a different
issue: " Unable to perform different actions(post) on storage volume
from UI #693"

My comments bellow.

Regards, Paulo.

On Mon, 2015-08-31 at 14:09 -0300, Ramon Medeiros wrote:
> Verify vlan name size before adding it. If name greater than 15
> characters, display an error.
> 
> Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
> 
> The size limit of vlan name is defined in kernel headers:
> 
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linu
> x/7/html/Networking_Guide/sec-Naming_Scheme_for_VLAN_Interfaces.html
> ---
>  src/kimchi/i18n.py           | 1 +
>  src/kimchi/model/networks.py | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
> index 862df7f..2f9c8d2 100644
> --- a/src/kimchi/i18n.py
> +++ b/src/kimchi/i18n.py
> @@ -257,6 +257,7 @@ messages = {
>      "KCHNET0020E": _("Failed to activate interface %(iface)s:
> %(err)s."),
>      "KCHNET0021E": _("Failed to activate interface %(iface)s. Please
> check the physical link status."),
>      "KCHNET0022E": _("Failed to start network %(name)s. Details:
> %(err)s"),
> +    "KCHNET0023E": _("Interface name %(name)s exceeds kernel limit
> of 15 characters"),

Once you are working specifically with VLAN interface name, that it's
composed by other interface names, I guess would be better use the text
"VLAN interface name %(name)s exceeds kernel limit of 15 characters".

> 
>      "KCHDR0001E": _("Debug report %(name)s does not exist"),
>      "KCHDR0002E": _("Debug report tool not found in system"),
> diff --git a/src/kimchi/model/networks.py
> b/src/kimchi/model/networks.py
> index 275e12b..03737d1 100644
> --- a/src/kimchi/model/networks.py
> +++ b/src/kimchi/model/networks.py
> @@ -216,6 +216,9 @@ class NetworksModel(object):
>          if br_name in bridges:
>              raise InvalidOperation("KCHNET0010E", {'iface':
> br_name})
> 
> +        if  len(br_name) > 15:
> +            raise InvalidOperation("KCHNET0023E", {'name': br_name})
> +
>          with RollbackContext() as rollback:
>              try:
>                  vlan_tagged_br = conn.interfaceDefineXML(br_xml, 0)




More information about the Kimchi-devel mailing list