summaryrefslogtreecommitdiffstats
path: root/lib/log
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-3/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* Minor fixesZdenek Kabelac2012-03-281-3/+4
| | | | Just small updates and remove <backtrace> after log_error.
* Few more close and dev_close traceZdenek Kabelac2012-03-011-1/+1
| | | | Adding (void) where we cannot really report an error.
* Explicitely ignore fail error on hash_insertZdenek Kabelac2012-02-271-1/+1
| | | | | We cannot do anything better here anyway - we are already in logging function, so just ignore this issue here - it will most likely stop application later.
* Move done jump lowerZdenek Kabelac2012-02-081-1/+1
| | | | | Since before 'goto done' is bufused zeroed, it would otherwise write 1 byte in front of buffer.
* Ensure strncpy() function always ends with '\0'Zdenek Kabelac2012-02-081-1/+1
| | | | | Since last character needs to be \0 for string, pass buffer size smaller by 1 byte.
* Reduce stack size usage in print_logZdenek Kabelac2011-10-221-4/+4
| | | | | As the buf2[] and locn[] can't be used at the same time, safe 1 page from stack memory.
* Trivial, add void to ignore dm_snprinf resultZdenek Kabelac2011-08-111-2/+2
|
* Suppress low-level locking errors and warnings while using --sysinit.Peter Rajnoha2011-08-091-0/+2
| | | | | | | | | | | | | | | | | Today, we use "suppress_messages" flag (set internally in init_locking fn based on 'ignorelockingfailure() && getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES")'. This way, we can suppress high level messages like "File-based locking initialisation failed" or "Internal cluster locking initialisation failed". However, each locking has its own sequence of initialization steps and these could log some errors as well. It's quite misleading for the user to see such errors and warnings if the "--sysinit" is used (and so the ignorelockingfailure && LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable). Errors and warnings from these intermediary steps should be suppressed as well if requested. This patch propagates the "suppress_messages" flag deeper into locking init functions. I've also added these flags for other locking types for consistency, though it's not actually used for no_locking and readonly_locking.
* pre-release clean-upsAlasdair Kergon2011-04-291-0/+1
|
* Fix some forgotten -Wold-style-definition gcc warningsZdenek Kabelac2011-04-081-1/+1
|
* Optimise error message write to _lvm_errmsgZdenek Kabelac2011-03-301-8/+23
| | | | | | | | | Isn't usually perfomance critical - but log_error is used i.e.for debuging, this code noticable slows down the processing. Added 512KB limit to avoid memory exhastions in case of some endless loop. TODO: use _lvm_errmsg buffer only when lvm2api needs it.
* Critical sectionZdenek Kabelac2011-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | New strategy for memory locking to decrease the number of call to to un/lock memory when processing critical lvm functions. Introducing functions for critical section. Inside the critical section - memory is always locked. When leaving the critical section, the memory stays locked until memlock_unlock() is called - this happens with sync_local_dev_names() and sync_dev_names() function call. memlock_reset() is needed to reset locking numbers after fork (polldaemon). The patch itself is mostly rename: memlock_inc -> critical_section_inc memlock_dec -> critical_section_dec memlock -> critical_section Daemons (clmvd, dmevent) are using memlock_daemon_inc&dec (mlockall()) thus they will never release or relock memory they've already locked memory. Macros sync_local_dev_names() and sync_dev_names() are functions. It's better for debugging - and also we do not need to add memlock.h to locking.h header (for memlock_unlock() prototyp).
* Remove bufused for calculationZdenek Kabelac2010-10-261-1/+1
| | | | | As bufused is assigned 0 in preceding source line clang Idempotent operation
* Various cleanups following recent commits.Alasdair Kergon2010-06-211-2/+0
|
* Suppress duplicate error messages about read failures and missing devices.Petr Rockai2010-05-053-2/+27
|
* Also honour abort_on_internal_errors when log_fn is set.Petr Rockai2010-03-231-1/+2
|
* Add LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable to suppress errorPeter Rajnoha2010-02-151-0/+3
| | | | and warning mesages while --ignorelockingfailure is used.
* Use _LOG_FATAL when aborting on an internal error.Alasdair Kergon2010-01-111-11/+15
|
* Internal errors triggering abort cannot be suppressed. (kabi)Alasdair Kergon2010-01-111-2/+2
|
* #define an INTERNAL_ERROR macro and use it throughout LVM.Petr Rockai2009-12-162-2/+3
|
* If aborting due to an internal error, always print the message causing this.Petr Rockai2009-12-011-8/+9
|
* Optionally abort on internal errors (and leverage this option in thePetr Rockai2009-11-302-0/+16
| | | | | testsuite). (This is showing a problem in the pvmove test for me, so I expect the tests to start failing -- this needs to be fixed separately though.)
* Fix so only log_error and log_fatal set EUNCLASSIFIED.Alasdair Kergon2009-07-162-4/+6
|
* Change default errno value to 0 (no error) and add prototypes in lvm.hDave Wysochanski2009-07-161-3/+1
| | | | | | | | | | | | | | Since we are using errno values, we should use '0' as a default value which indicates a non-error, rather than defining some made-up default value that is not defined in errno. If we need to deviate from errno values, this will most likely indicate a flaw in our design. Add prototypes for lvm_errno and lvm_errmsg inside lvm.h and provide a basic description of their function. This fixes a couple compile warnings. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add log_errno to set a specific errno and replace log_error in due course.Alasdair Kergon2009-07-162-2/+10
|
* Add lvm_errno and lvm_errmsg to liblvm to obtain failure information.Alasdair Kergon2009-07-162-5/+6
| | | | | Change create_toolcontext to still return an object if it fails part-way. Add EUNCLASSIFIED (-1) as the default LVM errno code.
* Store any errno and error messages issued while processing each command.Alasdair Kergon2009-07-152-7/+55
| | | | | (Enabled by default while we test it, but in due course we'll only store the error messages when we need to.)
* Add dm_log_with_errno and dm_log_with_errno_init, deprecating the oldAlasdair Kergon2009-07-102-8/+8
| | | | | Change plog to use dm_log_with_errno unless deprecated dm_log_init was used. Rename plog macro to LOG_LINE and use in dm_dump_memory_debug.
* more tweaking to get things to compile - dmlib.h for log fns, list.hAlasdair Kergon2008-11-031-2/+0
|
* Split out lvm-logging.h from log.h.Alasdair Kergon2008-10-303-260/+77
|
* Improve the way VGs with PVs missing are handled so manual interventionAlasdair Kergon2008-09-192-13/+0
| | | | is required in fewer circumstances. (mornfall)
* Fix identifier 'error_message_produced' used ambiguously.Dave Wysochanski2008-06-171-2/+2
| | | | | | Related compiler warning: log/log.c:242: warning: declaration of 'error_message_produced' shadows a global declaration ../include/log.h:98: warning: shadowed declaration is here
* post-releaseAlasdair Kergon2008-06-062-0/+16
|
* back out unnecessary changes for this releaseAlasdair Kergon2008-06-062-16/+0
|
* In script-processing mode, stop if any command fails.Alasdair Kergon2008-05-302-0/+16
| | | | Warn if command exits with non-zero status code without a prior log_error.
* Fix output if overriding command_names on cmdline.Milan Broz2008-04-071-10/+17
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-1/+1
|
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-202-6/+6
|
* Detect stream write failure reliably; new fn: lvm_fclose; use dm_fcloseJim Meyering2007-07-241-2/+9
| | | | | | | | | | | | * lib/misc/lvm-file.c (lvm_fclose): New function. * lib/misc/lvm-file.h (lvm_fclose): Declare it. * lib/config/config.c (write_config_file): Use the new function to detect and diagnose unlikely write failure. * lib/filters/filter-persistent.c (persistent_filter_dump): Likewise. * lib/format_text/archive.c (archive_vg): Likewise. * lib/format_text/format-text.c (_vg_write_file): Likewise. * lib/log/log.c (fin_log): Similar, but use dm_fclose directly. Include "\n" at end of each fprintf format string.
* Make warnings go to stderr. Change log_warn to that effect, log_printPetr Rockai2007-06-282-5/+10
| | | | continues to send messages to stdout.
* Add devices/preferred_names config regex list for displayed device names.Alasdair Kergon2007-04-261-0/+1
| | | | | | Free a temporary dir string in fcntl_lock_file() after use. Fix a dm_pool_destroy() in matcher_create(). Introduce goto_bad macro.
* Add devices/ignore_suspended_devices to ignore suspended dm devices.Alasdair Kergon2007-01-252-0/+13
|
* Add some missing close() and fclose() return code checks.Alasdair Kergon2007-01-251-1/+2
| | | | Fix exit statuses of reporting tools (2.02.19).
* lvm.static no longer interacts with dmeventd unless explicitly asked to.Alasdair Kergon2007-01-241-0/+2
|
* register->monitor etc.Alasdair Kergon2007-01-192-7/+7
|
* Move lvm_snprintf into libdevmapper.Alasdair Kergon2006-08-211-2/+2
|
* Add --trustcache option to reporting commands in preparation for supportingAlasdair Kergon2006-08-012-0/+13
| | | | | | event-driven model. Without changes to the way the cache gets updated, the option is currently unreliable without a global lock to prevent any lvm2 commands from running concurrently.
* Add --monitor to vgcreate and lvcreate to control dmeventd registration.Alasdair Kergon2006-05-122-0/+14
| | | | | Propagate --monitor around cluster. Filter LCK_NONBLOCK in clvmd lock_vg.
* Create a log header for replacement in-sync mirror log.Alasdair Kergon2006-05-112-0/+13
| | | | | Use set_lv() and dev_set() to wipe sections of devices. Add mirror_in_sync() flag to avoid unnecessary resync on activation.