RFC: Propose to make a common utils repo for OpenBMC (or phosphor-xxx)

Lei YU mine260309 at gmail.com
Mon Feb 27 20:31:02 AEDT 2017


Hi All,

This email is to propose to make a new separated repo of common code for
OpenBMC, or at least for phohphor-xxx repos.

During the code review, we can see several duplicated code in different repos.
E.g.
1. Both phosphor-watchdog and phosphor-host-ipmid uses timer related functions.
   They both have similar code using `sd_event_source_set_enabled()` and
   `sd_event_source_set_time()`
2. phosphor-time-mamanger, phosphor-watchdog, and phosphor-host-ipmid all have
   similar code to retrieve the current system time.
3. I believe there are similar code in many repos about operations on
   `std::string`, e.g. find sub string, convert from/to other types, etc.

Is it a good idea to have a repo that collecting the common code and make it a
library for other repos to use?
E.g. if we have `phosphor-common-utils` and built in SDK, we can provide a
consistent interfaces of util functions that will make other apps' code more
clean and less errors.

Feedback are welcome!
Thanks!

--
BRs,
Lei YU


More information about the openbmc mailing list