1. 10 10月, 2016 13 次提交
    • E
      virlog: Introduce virLogParseOutputs · 4b266c18
      Erik Skultety 提交于
      Another abstraction added on the top of parsing a single logging output. This
      method takes and parses the whole set of outputs, adding each single output
      that has already been parsed into a caller-provided array. If the user-supplied
      string contained duplicate outputs, only the last occurrence is taken into
      account (all the others are removed from the list), so we silently avoid
      duplicate logs.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      4b266c18
    • E
      virlog: Introduce virLogParseFilter · 77a45f2f
      Erik Skultety 提交于
      Same as for outputs, introduce a new method, that is basically the same as
      virLogParseAndDefineFilter with the difference that it does not define the
      filter. It rather returns a newly created object that needs to be inserted into
      a list and then defined separately.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      77a45f2f
    • E
      virlog: Introduce virLogParseOutput · 09b7cbb1
      Erik Skultety 提交于
      Introduce a method to parse an individual logging output. The difference
      compared to the virLogParseAndDefineOutput is that this method does not define
      the output, instead it makes use of the virLogNewOutputTo* methods introduced
      in the previous patch and just returns the virLogOutput object that has to be
      added to a list of object which then can be defined as a whole via
      virLogDefineOutputs. The idea remains still the same - split parsing and
      defining of the logging primitives (outputs, filters).
      Additionally, since virLogNewOutputTo* methods are now finally used,
      ATTRIBUTE_UNUSED can be successfully removed from the methods' definitions,
      since that was just to avoid compiler complaints about unused static functions.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      09b7cbb1
    • E
      virlog: Take a special care of syslog when setting new set of log outputs · 640b58ab
      Erik Skultety 提交于
      Now that we're in the critical section, syslog connection can be re-opened
      by issuing openlog, which is something that cannot be done beforehand, since
      syslog keeps its file descriptor private and changing the tag earlier might
      introduce a log inconsistency if something went wrong with preparing a new set
      of logging outputs in order to replace the existing one.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      640b58ab
    • E
      virlog: Introduce virLogNewOutputTo* as a replacement for virLogAddOutputTo* · 4c352295
      Erik Skultety 提交于
      Continuing with the effort to split output parsing and defining, these new
      functions return a logging object reference instead of defining the output.
      Eventually, these functions will replace the existing ones (virLogAddOutputTo*)
      which will then be dropped.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      4c352295
    • E
      virlog: Introduce virLogDefineFilters · 58ab1b6f
      Erik Skultety 提交于
      Prepare a method that only defines a set of filters. It takes a list of
      filters, preferably created by virLogParseFilters. The original set of filters
      is reset and replaced by the new user-provided set of filters.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      58ab1b6f
    • E
      virlog: Introduce virLogDefineOutputs · d9d6b61f
      Erik Skultety 提交于
      Prepare a method that only defines a set of outputs. It takes a list of
      outputs, preferably created by virLogParseOutputs. The original set of outputs
      is reset and replaced by the new user-provided set of outputs.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      d9d6b61f
    • E
      virlog: Introduce virLogFindOutput · b5004b09
      Erik Skultety 提交于
      Outputs are a bit trickier than filters, since the user(config)-specified
      set of outputs can contain duplicates. That would lead to logging the same
      message twice. For compatibility reasons, we cannot just error out and forbid
      the daemon to start if we find duplicate outputs which do not make sense.
      Instead, we could silently take into account only the last occurrence of the
      duplicate output and remove all the previous ones, so that the logger will not
      try to use them when it is looping over all of its registered outputs.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b5004b09
    • E
      virlog: Introduce virLogFilterNew · 435200ca
      Erik Skultety 提交于
      This method allocates a new filter object which it then returns back to caller.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      435200ca
    • E
      virlog: Introduce virLogOutputNew · b0f5dc91
      Erik Skultety 提交于
      In order to later split output parsing and output defining, introduce a new
      function which will create a new virLogOutput object which the parser will
      insert into a list with the list being eventually defined.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b0f5dc91
    • E
      virlog: Store the journald fd within the output object · a2405a88
      Erik Skultety 提交于
      There is really no reason why we could not keep journald's fd within the
      journald output object the same way as we do for regular file-based outputs.
      By doing this we later won't have to special case the journald-based output
      (due to the fd being globally shared) when replacing the existing set of outputs
      with a new one. Additionally, by making this change, we don't need the
      virLogCloseJournald routine anymore, plain virLogCloseFd will suffice.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      a2405a88
    • E
      virlog: Rename virLogParse* to virLogParseAndDefine* · b8c370a9
      Erik Skultety 提交于
      Right now virLogParse* functions are doing both parsing and defining of filters
      and outputs which should be two separate operations. Since the naming is
      apparently a bit poor this patch renames these functions to
      virLogParseAndDefine* which eventually will be replaced by virLogSet*.
      Additionally, virLogParse{Filter,Output} will be later (after the split) reused,
      so that these functions do exactly what the their name suggests.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b8c370a9
    • E
      virlog: Remove unused macro IS_SPACE · 6aa3a6a4
      Erik Skultety 提交于
      During first stage of virlog.c refactor, commit 0b231195 forgot to remove the
      macro definition along with its usage.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      6aa3a6a4
  2. 08 10月, 2016 3 次提交
  3. 07 10月, 2016 2 次提交
  4. 06 10月, 2016 7 次提交
  5. 05 10月, 2016 14 次提交
  6. 04 10月, 2016 1 次提交