Whamcloud - gitweb
LU-13722 utils: lnetctl discrepancy in YAML output 69/40269/3
authorCyril Bordage <cbordage@whamcloud.com>
Fri, 16 Oct 2020 14:10:28 +0000 (16:10 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 11 May 2021 22:54:08 +0000 (22:54 +0000)
Use "max_interfaces" instead of "max_intf" in YAML output/input.

Signed-off-by: Cyril Bordage <cbordage@whamcloud.com>
Change-Id: Id0d1d1a4220d817b238456946e28b985e1fdc80c
Reviewed-on: https://review.whamcloud.com/40269
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lnet/utils/lnetconfig/liblnetconfig.c

index c815732..e371771 100644 (file)
@@ -3710,7 +3710,7 @@ int lustre_lnet_show_max_intf(int seq_no, struct cYAML **show_rc,
        }
 
        return build_global_yaml_entry(err_str, sizeof(err_str), seq_no,
-                                      "max_intf", max_intf, show_rc,
+                                      "max_interfaces", max_intf, show_rc,
                                       err_rc, l_errno);
 }
 
@@ -4735,7 +4735,9 @@ static int handle_yaml_config_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_config_max_intf(max_intf->cy_valueint,
                                                 seq_no ? seq_no->cy_valueint
@@ -4823,7 +4825,9 @@ static int handle_yaml_del_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_config_max_intf(LNET_INTERFACES_MAX_DEFAULT,
                                                 seq_no ? seq_no->cy_valueint
@@ -4864,7 +4868,9 @@ static int handle_yaml_show_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_show_max_intf(seq_no ? seq_no->cy_valueint
                                                        : -1,