summaryrefslogtreecommitdiff
path: root/daemons/lvmpolld
Commit message (Collapse)AuthorAgeFilesLines
* lvmpolld: fix `strerror_r` check for muslSam James2022-11-251-1/+1
| | | | | | | | | | | We can't assume that strerror_r returns char* just because _GNU_SOURCE is defined. We already call the appropriate autoconf test, so let's use its result (STRERROR_R_CHAR_P). Note that in configure, _GNU_SOURCE is always set, but we add a defined guard just in case for futureproofing. Bug: https://bugs.gentoo.org/869404
* cov: add some initializersZdenek Kabelac2021-09-131-1/+1
|
* polldaemon: improve support for interruptionsZdenek Kabelac2021-04-061-4/+2
| | | | | | Enhance handling of interruptions of polling process and lvmpoll daemon. Daemon should now react much faster on interrups (i.e. shutdown sequence) and avoid taking lenghty sleep waiting on pvmove signaling.
* make: cflow target works againZdenek Kabelac2021-03-201-4/+3
| | | | | Restored 'make cflow' functinality. Produces some quick referece of function chaining and usage.
* device usage based on devices fileDavid Teigland2021-02-235-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LVM devices file lists devices that lvm can use. The default file is /etc/lvm/devices/system.devices, and the lvmdevices(8) command is used to add or remove device entries. If the file does not exist, or if lvm.conf includes use_devicesfile=0, then lvm will not use a devices file. When the devices file is in use, the regex filter is not used, and the filter settings in lvm.conf or on the command line are ignored. LVM records devices in the devices file using hardware-specific IDs, such as the WWID, and attempts to use subsystem-specific IDs for virtual device types. These device IDs are also written in the VG metadata. When no hardware or virtual ID is available, lvm falls back using the unstable device name as the device ID. When devnames are used, lvm performs extra scanning to find devices if their devname changes, e.g. after reboot. When proper device IDs are used, an lvm command will not look at devices outside the devices file, but when devnames are used as a fallback, lvm will scan devices outside the devices file to locate PVs on renamed devices. A config setting search_for_devnames can be used to control the scanning for renamed devname entries. Related to the devices file, the new command option --devices <devnames> allows a list of devices to be specified for the command to use, overriding the devices file. The listed devices act as a sort of devices file in terms of limiting which devices lvm will see and use. Devices that are not listed will appear to be missing to the lvm command. Multiple devices files can be kept in /etc/lvm/devices, which allows lvm to be used with different sets of devices, e.g. system devices do not need to be exposed to a specific application, and the application can use lvm on its own set of devices that are not exposed to the system. The option --devicesfile <filename> is used to select the devices file to use with the command. Without the option set, the default system devices file is used. Setting --devicesfile "" causes lvm to not use a devices file. An existing, empty devices file means lvm will see no devices. The new command vgimportdevices adds PVs from a VG to the devices file and updates the VG metadata to include the device IDs. vgimportdevices -a will import all VGs into the system devices file. LVM commands run by dmeventd not use a devices file by default, and will look at all devices on the system. A devices file can be created for dmeventd (/etc/lvm/devices/dmeventd.devices) If this file exists, lvm commands run by dmeventd will use it. Internal implementaion: - device_ids_read - read the devices file . add struct dev_use (du) to cmd->use_devices for each devices file entry - dev_cache_scan - get /dev entries . add struct device (dev) to dev_cache for each device on the system - device_ids_match - match devices file entries to /dev entries . match each du on cmd->use_devices to a dev in dev_cache, using device ID . on match, set du->dev, dev->id, dev->flags MATCHED_USE_ID - label_scan - read lvm headers and metadata from devices . filters are applied, those that do not need data from the device . filter-deviceid skips devs without MATCHED_USE_ID, i.e. skips /dev entries that are not listed in the devices file . read lvm label from dev . filters are applied, those that use data from the device . read lvm metadata from dev . add info/vginfo structs for PVs/VGs (info is "lvmcache") - device_ids_find_renamed_devs - handle devices with unstable devname ID where devname changed . this step only needed when devs do not have proper device IDs, and their dev names change, e.g. after reboot sdb becomes sdc. . detect incorrect match because PVID in the devices file entry does not match the PVID found when the device was read above . undo incorrect match between du and dev above . search system devices for new location of PVID . update devices file with new devnames for PVIDs on renamed devices . label_scan the renamed devs - continue with command processing
* libdaemon: use pselect to avoid condition checking raceZdenek Kabelac2019-04-161-1/+1
| | | | | | | | | | To avoid tiny race on checking arrival of signal and entering select (that can latter remain stuck as signal was already delivered) switch to use pselect(). If it would needed, we can eventually add extra code for older systems without pselect(), but there are probably no such ancient systems in use.
* lvmpolld: improve makefile depsZdenek Kabelac2018-12-211-5/+4
| | | | Add correct build dependencies on internal libraries.
* headers: use configure.h as 1st. headerZdenek Kabelac2018-12-141-2/+0
| | | | | | | | | | | Ensure configure.h is always 1st. included header. Maybe we could eventually introduce gcc -include option, but for now this better uses dependency tracking. Also move _REENTRANT and _GNU_SOURCE into configure.h so it doesn't need to be present in various source files. This ensures consistent compilation of headers like stdio.h since it may produce different declaration.
* makefiles: updates for less verbosityZdenek Kabelac2018-11-291-2/+4
|
* device_mapper: remove dbg_malloc.Joe Thornber2018-06-083-40/+40
| | | | | I wrote dbg_malloc before we had valgrind. These days there's just no need.
* build: libbase.aJoe Thornber2018-06-041-2/+1
|
* build: fixesZdenek Kabelac2018-06-041-1/+2
|
* device-mapper: Fork libdm internally.Joe Thornber2018-05-161-1/+1
| | | | | | | | | | | | The device-mapper directory now holds a copy of libdm source. At the moment this code is identical to libdm. Over time code will migrate out to appropriate places (see doc/refactoring.txt). The libdm directory still exists, and contains the source for the libdevmapper shared library, which we will continue to ship (though not neccessarily update). All code using libdm should now use the version in device-mapper.
* build: Don't generate symlinks in include/ dirJoe Thornber2018-05-143-4/+4
| | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* makefiles: fixing linkingZdenek Kabelac2017-08-011-8/+4
| | | | | | | | | | | Avoid adding -g more then once for debug builds. Avoid enabling DEBUG_MEM when we build multithreaded tools. Link executables with -fPIE -pie and --export-dynamic LDFLAGS Introduce PROGS_FLAGS to add option to pass flags for external libs. Link lvm2 internally library only when really used. Link DAEMON_LIBS with daemons. Pass VALGRIND_CFLAGS internally Set shell failure mode on couple places.
* cleanup: drop double const specifierZdenek Kabelac2017-02-111-4/+6
| | | | | Remove duplicated 'const' specifier. Reindent.
* cleanup: single LVM_SYSTEM_DIR stringZdenek Kabelac2016-11-231-3/+5
|
* cleanup: drop unused assignmentsZdenek Kabelac2016-07-011-1/+1
| | | | | In all code paths we set a value for these variables, so drop their initial unused assign.
* doc: change fsf addressZdenek Kabelac2016-01-219-9/+9
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* libdaemon: fix passing 32bit values for %dZdenek Kabelac2015-11-091-1/+1
| | | | | | Since %d is now prohibited for its great confusion, replace it with FMTd64 and correctly converted int64_t parameter.
* lvmpolld: make lvpoll error messages visibleOndrej Kozina2015-09-021-5/+15
| | | | | | | | | | Previously all stderr messages issued by spawned lvpoll command were reported as INFO only. This made all such messages invisible in syslog or lvmpolld log while running default configuration. All lvpoll stderr messages are loged with WARN priority now and lvpoll command exiting with retcode != 0 is logged with ERROR priority in syslog and lvmpolld log
* cleanup: check pthread result codesZdenek Kabelac2015-08-181-3/+7
|
* coverity: fix possible resource leak in lvmpolld-corePeter Rajnoha2015-08-041-1/+2
| | | | /daemons/lvmpolld/lvmpolld-core.c:573: leaked_storage: Variable "cmdargv" going out of scope leaks the storage it points to.
* gitignore: Update for in-place build.Alasdair G Kergon2015-07-271-0/+1
|
* lvmpolld: Fix segfault on 32 bit architecturesMarian Csontos2015-07-101-1/+1
| | | | | Explicit conversions are needed to align writes and reads on the stack. int64_t is popped from stack while int was pushed.
* coverity: missing return value checksPeter Rajnoha2015-07-091-4/+4
|
* lvmpolld: fix possible memory corruption with mem debugOndrej Kozina2015-07-071-1/+3
| | | | | | | | | if lvm2 is built with debug memory options dm_free() is not mapped directly to std library's free(). This may cause memory corruption as a line buffer may get reallocated in getline with realloc. This is a temporary hotfix. Other debug memory failure needs to be investigated and explained.
* include: Standardise around new tool.h.Alasdair G Kergon2015-07-061-6/+1
|
* cleanup: drop double constZdenek Kabelac2015-06-151-1/+1
| | | | | Second const is unneeded. Also always create whole array with MAX elements.
* lvmetad, lvmpolld: remove DL_LIBS from MakefileDavid Teigland2015-06-081-2/+1
| | | | and rdynamic. They are not needed.
* lvmpolld: terminate error message with a dot and LFOndrej Kozina2015-05-271-1/+1
|
* lvmpolld: zero errno in before strtoul callOndrej Kozina2015-05-261-0/+1
| | | | | | Testing errno value without explicitly setting to zero in before the strtoul call may lead to unexpected failures.
* lvmpolld: don't return success on invalid optionOndrej Kozina2015-05-151-2/+2
|
* lvmpolld: add long option variants for all short onesOndrej Kozina2015-05-151-15/+20
|
* lvmpolld: introduce client functionalityOndrej Kozina2015-05-151-35/+196
| | | | | | | | | as of now lvmpolld works as client utility for querying running instance of lvmpolld server on metadata, state, etc. Currently the only request implemented is the '--dump'. It prints out full lvmpolld state (mimics lvmdump -p command).
* lvmpolld: label known return codesOndrej Kozina2015-05-152-2/+5
| | | | | so that lvmpolld-client can decode and describe these return codes properly
* lvmpolld: dump cleanupOndrej Kozina2015-05-121-1/+1
|
* lvmpolld: by default spawn lvpoll cmd with -AnOndrej Kozina2015-05-111-0/+4
|
* lvmpolld: set use counters properly in lvmpolld_storeOndrej Kozina2015-05-111-0/+1
| | | | set active_polling_count to zero in pdst_init fn
* lvmpolld: Add standalone polldaemon.Ondrej Kozina2015-05-099-0/+1744
See doc/lvmpolld_overview.txt