@@ -1046,6 +1046,18 @@ static void stdout_subsystem_ctrls(nvme_subsystem_t s)
1046
1046
}
1047
1047
}
1048
1048
1049
+ static void stdout_subsys_config (nvme_subsystem_t s )
1050
+ {
1051
+ int len = strlen (nvme_subsystem_get_name (s ));
1052
+
1053
+ printf ("%s - NQN=%s\n" , nvme_subsystem_get_name (s ),
1054
+ nvme_subsystem_get_nqn (s ));
1055
+ printf ("%*s hostnqn=%s\n" , len , " " ,
1056
+ nvme_host_get_hostnqn (nvme_subsystem_get_host (s )));
1057
+ printf ("%*s iopolicy=%s\n" , len , " " ,
1058
+ nvme_subsystem_get_iopolicy (s ));
1059
+ }
1060
+
1049
1061
static void stdout_subsystem (nvme_root_t r , bool show_ana )
1050
1062
{
1051
1063
nvme_host_t h ;
@@ -1055,18 +1067,11 @@ static void stdout_subsystem(nvme_root_t r, bool show_ana)
1055
1067
nvme_subsystem_t s ;
1056
1068
1057
1069
nvme_for_each_subsystem (h , s ) {
1058
- int len = strlen (nvme_subsystem_get_name (s ));
1059
-
1060
1070
if (!first )
1061
1071
printf ("\n" );
1062
1072
first = false;
1063
1073
1064
- printf ("%s - NQN=%s\n" , nvme_subsystem_get_name (s ),
1065
- nvme_subsystem_get_nqn (s ));
1066
- printf ("%*s hostnqn=%s\n" , len , " " ,
1067
- nvme_host_get_hostnqn (nvme_subsystem_get_host (s )));
1068
- printf ("%*s iopolicy=%s\n" , len , " " ,
1069
- nvme_subsystem_get_iopolicy (s ));
1074
+ stdout_subsys_config (s );
1070
1075
printf ("\\\n" );
1071
1076
1072
1077
if (!show_ana || !stdout_subsystem_multipath (s ))
@@ -5041,18 +5046,11 @@ static void stdout_simple_topology(nvme_root_t r,
5041
5046
5042
5047
nvme_for_each_host (r , h ) {
5043
5048
nvme_for_each_subsystem (h , s ) {
5044
- int len = strlen (nvme_subsystem_get_name (s ));
5045
-
5046
5049
if (!first )
5047
5050
printf ("\n" );
5048
5051
first = false;
5049
5052
5050
- printf ("%s - NQN=%s\n" , nvme_subsystem_get_name (s ),
5051
- nvme_subsystem_get_nqn (s ));
5052
- printf ("%*s hostnqn=%s\n" , len , " " ,
5053
- nvme_host_get_hostnqn (nvme_subsystem_get_host (s )));
5054
- printf ("%*s iopolicy=%s\n" , len , " " ,
5055
- nvme_subsystem_get_iopolicy (s ));
5053
+ stdout_subsys_config (s );
5056
5054
printf ("\\\n" );
5057
5055
5058
5056
if (nvme_is_multipath (s ))
0 commit comments