1. 15 Dec, 2016 3 commits
  2. 12 Dec, 2016 8 commits
  3. 10 Dec, 2016 2 commits
  4. 09 Dec, 2016 1 commit
  5. 08 Dec, 2016 3 commits
  6. 06 Dec, 2016 3 commits
  7. 05 Dec, 2016 1 commit
  8. 03 Dec, 2016 1 commit
  9. 02 Dec, 2016 4 commits
  10. 01 Dec, 2016 1 commit
  11. 29 Nov, 2016 10 commits
  12. 28 Nov, 2016 3 commits
    • log: use lxc_unix_epoch_to_utc() · e1378d35
      Christian Brauner authored
      This allows us to generate nice timestamps in a thread-safe manner without
      relying on locale touching functions from any libc.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
    • log: add lxc_unix_epoch_to_utc() · 65a9df89
      Christian Brauner authored
      Converts a unix time Epoch given by a struct timespec to a UTC string useable
      in our logging functions. Maybe expanded to allow for more generic formatting.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
    • log: drop all timezone conversion functions · c57dbb96
      Christian Brauner authored
      Our log functions need to make extra sure that they are thread-safe. We had
      some problems with that before. This especially involves time-conversion
      functions. I don't want to find any localtime() or gmtime() functions or
      relatives in here. Not even localtime_r() or gmtime_r() or relatives. They all
      fiddle with global variables and locking in various libcs. They cause deadlocks
      when liblxc is used multi-threaded and no matter how smart you think you are,
      you __will__ cause trouble using them.
      (As a short example how this can cause trouble: LXD uses forkstart to fork off
      a new process that runs the container. At the same time the go runtime LXD
      relies on does its own multi-threading thing which we can't control. The
      fork()ing + threading then seems to mess with the locking states in these time
      functions causing deadlocks.)
      The current solution is to be good old unix people and use the Epoch as our
      reference point and simply use the seconds and nanoseconds that have past since
      then. This relies on clock_gettime() which is explicitly marked MT-Safe with no
      restrictions! This way, anyone who is really strongly invested in getting the
      actual time the log entry was created, can just convert it for themselves. Our
      logging is mostly done for debugging purposes so don't try to make it pretty.
      Pretty might cost you thread-safety.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>