This is an early RFC to show the direction I'm heading with these patches.
This series may need to be organized better and I'm pretty sure I need to
work on the commit messages.
The main motivation for this series is that fcoemon's output is too verbose.
It can be very hard for the user to know why fcoemon failed to create an
interface through all of the chatter.
This was mostly resolved by switching the default /etc/fcoe/config to have
DEBUG="no". However, I wanted more uniformity in the debugging statements
and I didn't like that init.d/fcoe, fcoemon and fcoeplumb were all reading
the config file individually.
The series starts by cleaning up bad formatting of fcoemon.c and fcoeadm.c.
It reduces the debug flags in fcoemon to just one, so we're either in
debug mode or not, nothing more incremental. I like the idea of logging
levels, but this patch set does not accomplish that goal.
It then modifies the logging macros and moves them to fcoemon.h. This
move is barely relevant to the overall change, but I think it makes sense
as the macros are really application specific and the logging facility
might one day become a more generic library.
After the series there are only 5 logging macros-
FCM_LOG(...) == sa_log_func(__VA_ARGS__);
- Intended for general fcoemon logging not associated with a 'struct fcm_fcoe'
(i.e. ethX)
FCM_LOG_ERR(error, ...) == sa_log_err(error, NULL, __VA_ARGS__);
- Intended for log messages with an error code
FCM_LOG_DBG(fmt, args...) == if (fcm_debug) { sa_log(fmt, ##args); }
- Intended for developer debug statements
FCM_LOG_DEV_DBG(fcm, fmt, args...) ==
if (fcm_debug) { sa_log("s, " fmt, fcm->ff_name, ##args); }
- Intended for developer debug statements associated with a device (i.e. ethX)
FCM_LOG_DEV(fcm, fmt, args...) == sa_log("s, " fmt, fcm->ff_name, ##args);
- Intended for log messages associated with a device (i.e. ethX)
These macros no longer print function names. I don't feel that fcoemon is
a complicated enough to require this. Generally a developer will be able to
trace the calling function just from the output string.
The series has init.d/fcoe read the /etc/fcoe/config file once and the DEBUG
and USE_SYSLOG variables are passed forward to fcoemon, in turn fcoemon will
pass these forward to fcoeplumb.
The series changes the default 'config' file to have DEBUG="no".
Also, this series removes the Logical Link check in fcoemon as FIP enabled
switches do not use Logical Link. I think we'll want to do something more
intelligent in the future, but the best thing to do now is not restrict
fcoemon from creating the interface.
---
Robert Love (16):
fcoe-utils: Remove Logical Link Check
fcoe-utils: Pass the "--debug" flag to fcoemon
fcoe-utils: init scripts pass debug flag to fcoemon
fcoe-utils: Fix typo in config file
fcoe-utils: config file doesn't default to DEBUG="yes"
fcoe-utils: fcoeplumb no longer sources config files
fcoe-utils: Reduce fcoeplumb's verbosity
fcoe-utils: Convert all SA_LOG* functions to FCM_LOG*
fcoe-utils: Add new macros to print interface name with statements
fcoe-utils: remove SA_LOG_ERR_EXIT
fcoe-utils: remove unused SA_LOG_EXIT macro
fcoe-utils: remove sa_log_output_exit() wrapper for exit()
fcoe-utils: Change sa_select_loop to have a return value
fcoe-utils: Reduce debug flags to one
fcoe-utils: Fix formatting of fcoeadm.c
fcoe-utils: Fix formatting of fcoemon.c
etc/config | 8 -
etc/initd/initd.fedora | 5
etc/initd/initd.suse | 5
fcoeadm.c | 20 +-
fcoemon.c | 531 ++++++++++++++++++++----------------------------
fcoemon.h | 32 +++
fcoemon_utils.c | 12 -
fcoemon_utils.h | 35 ---
fcoeplumb.in | 65 +++---
9 files changed, 308 insertions(+), 405 deletions(-)
--
//Rob
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel