summaryrefslogtreecommitdiffstats
path: root/tools/polldaemon.c
Commit message (Collapse)AuthorAgeFilesLines
* config: add silent modeAlasdair G Kergon2012-08-251-4/+4
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-231-0/+5
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* Check for error from dup2Zdenek Kabelac2012-03-011-3/+3
| | | | Do not take correct fd as error result.
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Duplicate standard in/out descriptors for daemonZdenek Kabelac2012-02-281-4/+21
| | | | | | | | | | | | | | | Addressing somewhat tricky bug here. Since stdin,stdout,stderr were closed it's been occasionally possible to see some unexpected messages to be flowing into a clvmd and generating some randomly sized allocation of many megabytes. Since the message was not being generated by standard send_message() construction, after some more testing it apperead to be a debug log message - thus something has flown to local socket opened on strandard out descriptor. To fix the issue - use standard file descriptor duplication code for daemons. For making easier debugging of polling daemon - developer might want to recompile without modifition of standard file descriptors.
* Start using 64-bit status flags - most of the code already handles them.Alasdair Kergon2011-09-061-1/+1
| | | | | | tdata -> tpool remove commented out definitions from metadata.h formatting clean-ups
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-5/+5
| | | | | | | | Move the free_vg() to vg.c and replace free_vg with release_vg and make the _free_vg internal. Patch is needed for sharing VG in vginfo cache so the release_vg function name is a better fit here.
* Use return_0 to get bactraceZdenek Kabelac2011-02-181-2/+2
|
* If other process finishes (or aborts) pvmove operation andMilan Broz2011-01-191-2/+10
| | | | | | | polling function cannot find any lv with PVMOVE flag, return success and do not print "aborting" message. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=602389
* Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)Alasdair Kergon2011-01-121-1/+1
| | | | Introduce sync_local_dev_names and CLVMD_CMD_SYNC_NAMES to issue fs_unlock.
* Avoid cookie sharing between forked processesZdenek Kabelac2011-01-101-0/+2
| | | | Before fork, ensure cookie is reset so it's not shared between processes.
* Fail deamonization if lvmcache_init failZdenek Kabelac2011-01-051-1/+3
| | | | FIXME Add proper cleanup
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-4/+4
|
* Refactor the percent (mirror sync, snapshot usage) handling code to usePetr Rockai2010-11-301-9/+8
| | | | fixed-point values instead of a combination of a float value and an enum.
* This patch fixes a problem where the mirror polling processJonathan Earl Brassow2010-08-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | may never complete. If you convert from a linear to a mirror and then convert that mirror back to linear /while/ the previous (up)convert is taking place, the mirror polling process will never complete. This is because the function that polls the mirror for completion doesn't check if it is still polling a mirror and the copy_percent that it gets back from the linear device is certainly never 100%. The fix is simply to check if the daemon is still looking at a mirror device - if not, return PROGRESS_CHECK_FAILED. The user sees the following output from the first (up)convert if someone else sneaks in and does a down-convert shortly after their convert: [root@bp-01 ~]# lvconvert -m1 vg/lv vg/lv: Converted: 43.4% ABORTING: Mirror percentage check failed.
* Fix pvmove --abort <dev> return codeMilan Broz2010-08-231-2/+4
| | | | | | | It prints error code even if abort operation succeeds: pvmove --abort /dev/sdb Command failed with status code 5.
* Fix pvmove --abort to work even for empty pvmove LVMilan Broz2010-08-231-1/+3
| | | | | | | | | | | If pvmove crashed and metadata contains pvmove LV but without miorrored segments, pvmove --abort will not repair the situation (and finish wth success!). Fix it by allowing metadata update if aborting (thus removing pvmove LV) even if no moved LVs detected. (Tested on real metadata provided by an lvm user:-)
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Add activation/polling_interval to lvm.conf as --interval default.Alasdair Kergon2010-04-131-2/+5
|
* Default to checking LV's progress before waiting in _wait_for_single_lv.Mike Snitzer2010-01-221-9/+35
| | | | | | | | | | | | | | | Support "wait before testing" using '+' in pvmove and lvconvert interval. Doing so overrides the new default of sleeping after checking the LV's progress. Sleeping before checking progress can lead to extraneous polldaemons being left running. These polldaemons would have otherwise exited had they checked before sleeping. Checking progress before sleeping helps workaround the subtly unreliable nature of "finished" state checking in _percent_run. Update test/t-mirror-names.sh to use '+' when providing its lvconvert interval.
* Only allow one return from poll_daemon(). If a child polldaemon wasMike Snitzer2010-01-111-6/+34
| | | | | | | | | successfully created it must _exit() once it completes. Update _become_daemon() to differentiate between a failed fork() and a successful fork(). Added lvm_return_code() to lvmcmdline.[ch]
* Change background polldaemon's process name to "(lvm2)".Mike Snitzer2010-01-081-4/+4
| | | | | | | | | Made .update_metadata optional in 'struct poll_functions' definitions; eliminated _update_lvconvert_mirror() stub. Tweak a mirror-specific error message in the generic polldaemon code. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Tidy some uses of arg_count and introduce arg_is_set.Alasdair Kergon2009-11-031-1/+1
|
* Add percent_range to copy_percent too.Alasdair Kergon2009-10-011-3/+3
|
* Introduce percent_range_t and centralise snapshot full/mirror in-sync checks.Alasdair Kergon2009-10-011-2/+4
|
* Make poll_mirror_progress a function that can be replaced.Alasdair Kergon2009-09-301-8/+1
|
* Factor out poll_mirror_progress and introduce progress_t.Alasdair Kergon2009-09-301-17/+43
|
* Generalise polldaemon code by changing mirror-specific variable names.Alasdair Kergon2009-09-291-30/+30
|
* Fix process_each_vg / _process_one_vg when vg_read() returns FAILED_LOCKING.Dave Wysochanski2009-09-151-5/+0
| | | | | | | | | | | | | | Remove the checks for vg_read_error() in most of the tools callback functions and instead make the check in _process_one_vg() more general. In all but vgcfgbackup, we do not want to proceed if we get any error from vg_read(). In vgcfgbackup's case, we may proceed if the backup is to proceed with inconsistent VGs. This is a special case though, and we mark it with the READ_ALLOW_INCONSISTENT flag passed to process_each_vg (and subsequently to _process_one_vg). NOTE: More cleanup is needed in the vg_read_error() path cases. This patch is a start.
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-2/+6
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Fix vg_read() error paths to properly release upon vg_read_error().Dave Wysochanski2009-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix vg_read() error paths to properly release upon vg_read_error(). Note that in the iterator paths (process_each_*()), we release inside the iterator so no individual cleanup is needed. However there are a number of other places we missed the cleanup. Proper cleanup when vg_read_error() is true should be calling vg_release(vg), since there should be no locks held if we get an error (except in certain special cases, which IMO we should work to remove from the code). Unfortunately the testsuite is unable to detect these types of memory leaks. Most of them can be easily seen if you try an operation (e.g. lvcreate) with a volume group that does not exist. Error message looks like this: Volume group "vg2" not found You have a memory leak (not released memory pool): [0x1975eb8] You have a memory leak (not released memory pool): [0x1975eb8] Author: Dave Wysochanski <dwysocha@redhat.com>
* Add lvmcache_init() to polldaemon initialization.Dave Wysochanski2009-07-011-0/+1
| | | | | Signed-off-by: Petr Rockai <me@mornfall.net> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Rework the toollib interface (process_each_*) on top of new vg_read.Dave Wysochanski2009-07-011-5/+3
| | | | | | | | | Sun May 3 12:32:30 CEST 2009 Petr Rockai <me@mornfall.net> * Rework the toollib interface (process_each_*) on top of new vg_read. Rebased 6/26/09 by Dave W. - Add skipping message to process_each_lv - Remove inconsistent_t.
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-07-011-1/+2
| | | | | | | Sun May 3 11:40:51 CEST 2009 Petr Rockai <me@mornfall.net> * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Rebased 6/26/09 by Dave W.
* revert last patch - let's do a release firstAlasdair Kergon2009-06-261-2/+1
|
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-06-261-1/+2
| | | | | | | | | Sun May 3 11:40:51 CEST 2009 Petr Rockai <me@mornfall.net> * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Author: Petr Rockai <prockai@redhat.com> Committer: Dave Wysochanski <dwysocha@redhat.com>
* Fix double releasing of vg when repairing of vg is requested.Milan Broz2009-06-051-12/+3
| | | | | | | | | | | | | | | | | | | | Several commands calls process_each_vg() and in provided callback it explicitly recovers VG if inconsistent. (vgchange, vgconvert, vgscan) It means that old VG is released and reread but the function above (process_one_vg) tries to unlock and release old VG. Patch moves the repair logic into _process_one_vg() function. It always tries to read vg (even inconsistent) and then decides what to do according new defined parameter. Also patch unifies inconsistent error messages. The only slight change if for vgremove command, where it now tries to repair VG before it removes if force arg is given. (It works similar way before, just the order of operation changed).
* Fix convert polling to ignore LV with different UUID.Milan Broz2009-06-011-5/+6
| | | | | | | | | | | | | | | | | | | When mirror convert polling is started (mainly as backgound process, in lvchange -a y or in lvconvert itself) it tries to read VG and LV identified by its name. Unfortunatelly, the VG can have already different LV under the same name, and various more or less funny things can happen (note that _finish_lvconvert_mirror suspends the volume for example). (the typical example is our testing script which continuously recreates LVs under the same name in the same VG.) This patch adds optional uuid parameter which helps to properly select the monitoring object. For lvconvert polling it is set to LV UUID and both _get_lvconvert_vg and _get_lvconvert_lv uses it to read proper VG/LV. (In the pvmove case it is NULL, here we poll for physical volume name).
* Pre-release cleanups.Alasdair Kergon2009-05-211-3/+3
|
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-3/+3
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-2/+2
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-2/+2
|
* lvconvert uses polldaemon nowAlasdair Kergon2007-12-221-3/+7
|
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-201-3/+3
|
* Convert vg->status checks to use vg_check_status function.\nRename ↵Dave Wysochanski2007-06-191-3/+1
| | | | status_flags to status in vg_check_status.
* Make SIZE_SHORT the default for display_size().Alasdair Kergon2006-05-091-1/+1
| | | | | | | Fix some memory leaks in error paths found by coverity. Use C99 struct initialisers. Move DEFS into configure.h. Clean-ups to remove miscellaneous compiler warnings.
* Attempt to load missing targets using modprobe.Alasdair Kergon2005-10-171-6/+1
|
* Use hash, bitset, malloc, pool from libdevmapper.Alasdair Kergon2005-10-161-2/+2
|
* add lvid to lv_create_emptyAlasdair Kergon2005-04-071-0/+5
|
* Improve detection of external changes affecting internal cache.Alasdair Kergon2005-03-211-1/+4
|