1. 18 3月, 2014 7 次提交
    • D
      Add virLogSource variables to all source files · 2835c1e7
      Daniel P. Berrange 提交于
      Any source file which calls the logging APIs now needs
      to have a VIR_LOG_INIT("source.name") declaration at
      the start of the file. This provides a static variable
      of the virLogSource type.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2835c1e7
    • D
      Turn virLogSource into a struct instead of an enum · 098dd79e
      Daniel P. Berrange 提交于
      As part of the goal to get away from doing string matching on
      filenames when deciding whether to emit a log message, turn
      the virLogSource enum into a struct which contains a log
      "name". There will eventually be one virLogSource instance
      statically declared per source file. To minimise churn in this
      commit though, a single global instance is used.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      098dd79e
    • D
      Move dtrace probe macros into separate header file · b29275d9
      Daniel P. Berrange 提交于
      The dtrace probe macros rely on the logging API. We can't make
      the internal.h header include the virlog.h header though since
      that'd be a circular include. Instead simply split the dtrace
      probes into their own header file, since there's no compelling
      reason for them to be in the main internal.h header.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b29275d9
    • D
      Refactor code that skips logging of error messages · 3887c5d8
      Daniel P. Berrange 提交于
      The error reporting code will invoke a callback when any error
      is raised and the default callback will print to stderr. The
      virRaiseErrorFull method also sends all error messages on to the
      logging code, which also prints to stderr by default. To avoid
      duplicated data on stderr, the logging code has some logic to
      skip emission when no log outputs are configured, which checks
      whether the virLogSource == VIR_LOG_FROM_ERROR.
      
      Meanwhile the libvirtd daemon can register another callback which
      is used to reduce log message priority from error to a lower level.
      When this is used we do want messages to end up on stderr, so the
      error code will conditionally use either VIR_LOG_FROM_FILE or
      VIR_LOG_FROM_ERROR depending on whether such a callback is provided.
      
      This will all complicate later refactoring. By pushing the checks
      for whether a log output is present up a level into the error code,
      the special cases can be isolated in one place.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3887c5d8
    • D
      Reduce performance overhead of the global log buffer · 27f2edf9
      Daniel P. Berrange 提交于
      With the vast number of log debug statements in the code, the
      logging framework has a measurable performance impact on libvirt
      code, particularly in the daemon event loop.
      
      The global log buffer records every single log message triggered
      whether anyone cares to see them or not. This makes it impossible
      to eliminate the overhead of printf format expansions in any of
      the logging code. It is possible to disable the global log buffer
      in libvirtd itself, but this doesn't help client side library
      code. Also even if disabled by the config file, the existence of
      the feature makes other performance improvements in the logging
      layer impossible.
      
      Instead of logging every single message to the global buffer, only
      log messages that pass the log filters. This if libvirtd is set
      to have log_filters="1:libvirt 1:qemu" the global log buffer will
      only get filled with those messages instead of everything. This
      reduces the performance burden, as well as improving the signal
      to noise ratio of the log buffer.
      
      As a quick benchmark, a demo program that registers 500 file
      descriptors with the event loop (eg equiv of 500 QEMU monitor
      commands), creates pending read I/O on every FD, and then runs
      virEventRunDefaultImpl() took 1 minute 40 seconds to do 51200
      iterations with nearly all the time shown against the logging
      code. After this optimization it only takes 4.6 seconds.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      27f2edf9
    • M
      Require spaces around equality comparisons · cc9c62fe
      Martin Kletzander 提交于
      Commit a1cbe4b5 added a check for spaces around assignments and this
      patch extends it to checks for spaces around '=='.  One exception is
      virAssertCmpInt where comma after '==' is acceptable (since it is a
      macro and '==' is its argument).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      cc9c62fe
    • N
      Add parameter to wait for lock in file locking APIs · 2250a2b5
      Nehal J Wani 提交于
      Our current pidfile acquire APis (virPidFileAcquire) simply return -1 upon
      failure to acquire a lock. This patch adds a parameter 'bool waitForLock'
      which instructs the APIs if we want to make it block and wait for the lock
      or not.
      2250a2b5
  2. 14 3月, 2014 2 次提交
  3. 13 3月, 2014 20 次提交
  4. 12 3月, 2014 2 次提交
  5. 11 3月, 2014 8 次提交
  6. 10 3月, 2014 1 次提交