summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hints: new pvs_online typedev-dct-activation-switch-8David Teigland2021-10-206-6/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a new form of hints to reduce device scanning in vgchange -aay run by the udev rule for event based autoactivation. Standard hints allow a command with a named VG arg to scan only the PVs in the named VG, rather than scanning all available PVs. Standard hints are useful with a stable set of system devices. When new devices are arriving, as occurs during system startup, the hints are repeatedly invalidated, which makes standard hints unhelpful while devices are regularly appearing. This is the situation in which vgchange -aay is used, so standard hints are not generally helpful for autoactivation. In the context of system startup, pvscan --cache is keeping track of available PVs using the pvs_online files, similar to what the hints file does for a running system. Given this, a new hint mode, hints = "pvs_online", is added which derives an equivalent to standard hints, based on pvs_online files that are being created by udev-run pvscans. This hint mode is useful while devices are appearing, e.g. during system startup, and vgchange -aay can benefit from it. pvscan --cache -aay autoactivation already has a similar optimization (the "quick" activation case) that is based on the pvs_online file, but it is not implemented as a form of hints. This new form of hints is mainly useful in the context of event based autoactivation, during which standard hints are not useful. Once the system is in a steady state after startup (devices are not regularly appearing), the standard hints are most useful. The pvs_online hint method could be used on a running system, but would be no better than standard hints, and may be inferior because pvs_online files are not rigidly updated after system startup.
* add fixed event activation servicesDavid Teigland2021-10-2019-93/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new fixed activation services for startup: lvm-activate-vgs-main and lvm-activate-vgs-last. The -main service runs early, without service dependencies. The -last service runs later, after other services have started (other services that may set up devices for PVs, like mulitpathd.) The lvm-activate-vgs services both run "vgchange -aay" to activate all VGs that are preset and complete at the time of system startup. When there are many VGs, these two vgchange commands will replace many per-VG vgchange commands. The last service enables event activation by creating the file /run/lvm/event-activation-on. After that, new devices that appear will be processed by event based autoactivation commands. Prior to the existence of the event-activation-on file, event-based commands do nothing. lvm.conf event_activation_options can be used to configure service-based activation only, or event-based activation only, or the approach described above which begins with service based activation and then switches to event-based. service_only: only the -main and -last services will activate VGs. VGs on devices that appear later will not be autoactivated. event_only: the -main and -last services will not activate any VGs, and all VGs will be activated from per-VG event-based activation commands. service_to_event: the -main and -last services will activate VGs that are complete at the time the services run, and VGs that appear later will be activated from per-VG event-based activation commands.
* vgchange: add vgonline optionDavid Teigland2021-10-204-6/+16
| | | | | | | | | Using --vgonline with vgchange -aay makes vgchange use /run/lvm/vgs_online/ files in the same way as pvscan. If the online file for the vg does not exist and the command is able to exclusively create it, then it will activate the VG. If the online file exists or the create fails, then the VG will not be activated.
* pvscan: fix messages from coverity changesDavid Teigland2021-10-201-2/+2
|
* post-releaseMarian Csontos2021-10-204-2/+8
|
* pre-releasev2_03_14Marian Csontos2021-10-204-6/+6
|
* WHATS_NEW: updateMarian Csontos2021-10-201-2/+2
|
* pvscan: only add device args to dev cacheDavid Teigland2021-10-196-52/+246
| | | | | Optimize the common pvscan --cache command by only adding the necessary devs to dev-cache.
* dev-cache: enhance dir scan also for non-udev buildZdenek Kabelac2021-10-181-1/+9
|
* dev-cache: better detection of filesystemZdenek Kabelac2021-10-181-9/+13
| | | | | It appear on some systems the first found dev might not be actually for the filesytem - so use a better way through _cache.st_dev.
* configure: updateZdenek Kabelac2021-10-182-98/+21
|
* configure.ac: remove unused partZdenek Kabelac2021-10-181-23/+6
| | | | | | | As we are not using 'enable-compat' for anything, remove this section. Also remove duplicated check for blkid. Move setting of some AC_ARG_ENABLE defaults into the macro so it's always defined.
* cleanup: use const char bufferZdenek Kabelac2021-10-181-1/+1
|
* dev-cache: skip different filesystems on dir scanZdenek Kabelac2021-10-182-0/+10
| | | | | | | | When scanning configured /dev dir, avoid entring directories with different filesystem. This minimizes risk we will block on i.e. entring directory with mount point.
* cov: check device_ids_write return codeZdenek Kabelac2021-10-151-2/+3
| | | | | At least 'stack' failure code path as the function device_id_update_vg_uuid() is void.
* cov: ensure id is always initializeZdenek Kabelac2021-10-151-2/+4
| | | | | Always resed sd_id128_t id and report warning in case sd_id128_get_machine_app_specific() does not exit with 0.
* cov: check pointer before dereferencingZdenek Kabelac2021-10-151-2/+2
| | | | Check pv2 is non-null before trying to deref its tags.
* cov: do not drop already known error stateZdenek Kabelac2021-10-151-3/+1
| | | | | Do not try to 'discover' another error state, when ENOMEM is already detected.
* cov: ignore close resultZdenek Kabelac2021-10-151-1/+1
|
* cov: validate subcommand existanceZdenek Kabelac2021-10-151-2/+2
| | | | | Before dereference of subcommand pointer, check it's not NULL as coverity believes there exists theoretical path for this...
* cov: avoid using NULL infoZdenek Kabelac2021-10-151-3/+7
| | | | Check lvmcache info exists before calling lvmcache_del_save_bad_mda().
* configure: fix use of withvalZdenek Kabelac2021-10-152-3/+2
| | | | Newly added option --with-default-use-devices-file needs to use withval.
* configure: updateZdenek Kabelac2021-10-151-98/+63
|
* configure.ac: enhance systemd testingZdenek Kabelac2021-10-151-26/+31
| | | | | | | | | | | Enhance logic for checking supported systemd version, while doing only a single check for systemd package. For version checking use PKG_CHECK_EXISTS() macro. Also use one pkg check for blkid. Avoid checking version for thin/cache_check when tools are not present on system.
* makefile: enhance run-unit-test targetZdenek Kabelac2021-10-151-1/+6
| | | | | Use TMPDIR for executing test and also ensure all libraries linked to the test are from builddir.
* unit-test: better check for O_DIRECTZdenek Kabelac2021-10-151-14/+22
| | | | | Instead of guessing tmpfs usage, just directly try if we could reopen file with O_DIRECT on the used filesystem.
* configure: bash var typoZdenek Kabelac2021-10-152-2/+2
|
* gcc: always initialize vg_completeZdenek Kabelac2021-10-151-1/+1
|
* gcc: archive reoder struct varsZdenek Kabelac2021-10-151-2/+1
| | | | | Easier for automatic struct initialization = { 0 } without warns from older gcc.
* configure: missed bracesZdenek Kabelac2021-10-152-6/+9
| | | | | Missed [] around AS_IF internals, Also missed to call pkg_config_init prior PKG_CHECK_MODULES().
* debug: reduce some debugging noiseZdenek Kabelac2021-10-146-7/+14
| | | | | | | | | | | Resolve event_activation configure option just once. Do not print debug_devs about 'bad' filtering, when actually filter already printed reason for skipping Do not trace more then once about backup being disabled. No debug when unlinked file does not exists in pvscan.
* make: generateZdenek Kabelac2021-10-142-8/+4
|
* log: also build without systemd_journal_supportZdenek Kabelac2021-10-141-0/+7
|
* configure: updatesZdenek Kabelac2021-10-144-163/+155
|
* configure.ac: improvementZdenek Kabelac2021-10-141-26/+58
| | | | | | | | | | | | | | | | | Handle automatically new setttings --disable-systemd-journal --disable-appmachineid Both setting will check presence of apropriate header files. In case they are present, build will try to automatically build with them (adding systemd dependency) User can anytime disabled them and drop systemd dependency. Also add --with-default-use-devices-file configure option to select automatically default value for this option. For this moment keep default upstream as 0
* makefiles: use proper install prefix for python dbusZdenek Kabelac2021-10-141-1/+1
| | | | | For non-standard prefix dir use correct installation path (so the python files are not installed into user's system).
* debug: better error messageZdenek Kabelac2021-10-141-1/+3
| | | | Add more details about size difference.
* archiving: update refactoringZdenek Kabelac2021-10-141-11/+11
| | | | | | Commit 5ea426e65628218569ede461312d80ba5d1c50fb handled case with file path without '/' incorrectly - there is valid use-case so switch 'log_error()' to valid code branch.
* fix segfault handling duplicate PVsDavid Teigland2021-10-144-5/+5
| | | | | cmd arg was missing when switching to use an alternative duplicate dev.
* fix lvmcache_add log_debug pvidDavid Teigland2021-10-131-4/+6
| | | | from previous cleanup
* toollib: remove all devices list from process_each_pvDavid Teigland2021-10-133-184/+71
| | | | | | | | | Reporting non-PVs / "all devices" is only done by pvs -a or pvdisplay -a, so avoid the work managing a list of all devices in process_each_pv. In the case when it's needed, use the results of label_scan which already determines which devs are not PVs.
* devices file: unmatching system id should just be warningDavid Teigland2021-10-131-5/+1
| | | | | there are likely more cases than not where the systemid does not match and the command should still run.
* fix syslog settingDavid Teigland2021-10-114-9/+11
| | | | | | | | Just setting lvm.conf level=N should not send messages to syslog (now the journal by default.) Sending messages to syslog should require setting lvm.conf log { syslog=1 level=N }.
* make: generateMarian Csontos2021-10-0746-88/+932
|
* lvmdbusd: Use ID_FS_TYPE UDev property in udevwatchVojtech Trefny2021-10-071-2/+2
| | | | | | | '.ID_FS_TYPE_NEW' is a custom property added by an LVM UDev rule which is now being removed and 'ID_FS_TYPE' has the same value. Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
* configure: updateMarian Csontos2021-10-072-0/+115
|
* new udev autoactivationDavid Teigland2021-10-075-4/+492
| | | | | | | | | | | | | | new udev rule 69-dm-lvm.rules replaces 69-dm-lvm-meta.rules and lvm2-pvscan.service udev rule calls pvscan directly on the added device pvscan output indicates if a complete VG can be activated udev env var LVM_VG_NAME_COMPLETE is used to pass complete VG name from pvscan to the udev rule udev rule uses systemd-run to run vgchange -aay <vgname>
* logging: to the systemd journalDavid Teigland2021-10-079-1/+159
| | | | | | | | | | | | | Configure via lvm.conf log/journal or command line --journal. Possible values: "command" records command information. "output" records default command output. "debug" records full command debugging. Multiple values can be set in lvm.conf as an array. One value can be set in --journal which is added to values set in lvm.conf
* pvscan: add options listlvs listvg checkcompleteDavid Teigland2021-10-079-99/+431
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pvscan --cache <dev> . read only dev . create online file for dev pvscan --listvg <dev> . read only dev . list VG using dev pvscan --listlvs <dev> . read only dev . list VG using dev . list LVs using dev pvscan --cache --listvg [--checkcomplete] <dev> . read only dev . create online file for dev . list VG using dev . [check online files and report if VG is complete] pvscan --cache --listlvs [--checkcomplete] <dev> . read only dev . create online file for dev . list VG using dev . list LVs using dev . [check online files and report if VG is complete] . [check online files and report if LVs are complete] [--vgonline] can be used with --checkcomplete, to enable use of a vg online file. This results in only the first pvscan command to see the complete VG to report 'VG complete', and others will report 'VG finished'. This allows the caller to easily run a single activation of the VG. [--udevoutput] can be used with --cache --listvg --checkcomplete, to enable an output mode that prints LVM_VG_NAME_COMPLETE='vgname' that a udev rule can import, and prevents other output from the command (other output causes udev to ignore the command.) The list of complete LVs is meant to be passed to lvchange -aay, or the complete VG used with vgchange -aay. When --checkcomplete is used, lvm assumes that that the output will be used to trigger event-based autoactivation, so the pvscan does nothing if event_activation=0 and --checkcomplete is used. Example of listlvs ------------------ $ lvs -a vg -olvname,devices LV Devices lv_a /dev/loop0(0) lv_ab /dev/loop0(1),/dev/loop1(1) lv_abc /dev/loop0(3),/dev/loop1(3),/dev/loop2(1) lv_b /dev/loop1(0) lv_c /dev/loop2(0) $ pvscan --cache --listlvs --checkcomplete /dev/loop0 pvscan[35680] PV /dev/loop0 online, VG vg incomplete (need 2). VG vg incomplete LV vg/lv_a complete LV vg/lv_ab incomplete LV vg/lv_abc incomplete $ pvscan --cache --listlvs --checkcomplete /dev/loop1 pvscan[35681] PV /dev/loop1 online, VG vg incomplete (need 1). VG vg incomplete LV vg/lv_b complete LV vg/lv_ab complete LV vg/lv_abc incomplete $ pvscan --cache --listlvs --checkcomplete /dev/loop2 pvscan[35682] PV /dev/loop2 online, VG vg is complete. VG vg complete LV vg/lv_c complete LV vg/lv_abc complete Example of listvg ----------------- $ pvscan --cache --listvg --checkcomplete /dev/loop0 pvscan[35684] PV /dev/loop0 online, VG vg incomplete (need 2). VG vg incomplete $ pvscan --cache --listvg --checkcomplete /dev/loop1 pvscan[35685] PV /dev/loop1 online, VG vg incomplete (need 1). VG vg incomplete $ pvscan --cache --listvg --checkcomplete /dev/loop2 pvscan[35686] PV /dev/loop2 online, VG vg is complete. VG vg complete
* system_id: new appmachineid optionDavid Teigland2021-10-075-6/+76
| | | | | | | The new system_id_source="appmachineid" will cause lvm to use an lvm-specific derivation of the machine-id, instead of the machine-id directly. This is now recommended in place of using machineid.