summaryrefslogtreecommitdiff
path: root/tools/toollib.h
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-09-02 16:55:04 -0500
committerDavid Teigland <teigland@redhat.com>2021-10-29 12:06:55 -0500
commit325a4ea67e698d9dcc2319dfeaf64dba77bfa4e2 (patch)
tree6f02dec2b76e864b3b82ea5b19bcd7e09b9bfb46 /tools/toollib.h
parentbaf834f9f62fd59ec1aa1ada0894028e2cb10548 (diff)
downloadlvm2-dev-dct-activation-switch-9.tar.gz
add activation servicesdev-dct-activation-switch-9
New systemd services for startup: lvm-devices-wait.service Used in place of systemd-udev-settle, this service waits for udev+pvscan to process PVs listed in system.devices. It runs the command "lvmdevices --wait pvsonline". This only waits for PVs that can be matched to a device in sysfs, so it only waits for devices attached to the system. It waits specifically for the /run/lvm/pvs_online/<pvid> files to be created by pvscan. It quits waiting after a configurable number of seconds. This service gives the first activation service a chance to activate VGs from PVs that are available immediately at startup. lvm-activate-vgs-main.service Calls "vgchange -aay" after lvm-devices-wait to activate complete VGs. It only considers PVs that have been processed by udev+pvscan and have pvs_online files. This is expected to activate VGs from basic devices (not virtual device types) that are present at startup. lvm-activate-vgs-last.service Calls "vgchange -aay" after multipathd has started to activate any more VGs that became available after virtual device services were started, e.g. VGs on multipath devices. Like -main, it only looks at PVs that have been processed by pvscan. This vgchange enables event activation by creating the /run/lvm/event-activation-on file. Event-based activation will activate any further VGs that appear on the system after service (the udev rule will run vgchange -aay <vgname> via a transient service lvm-activate-<vgname>.service.) When there are many VGs that need activation during system startup, the two fixed services can activate them all much faster than activating each VG individually via events. lvm.conf auto_activation_settings can be used to configure the behavior (default ["service_and_event", "pvscan_hints"]). "service_and_event" - the behavior described above, where activation services are used first, and event activation is used afterward. "service_only" - only lvm-activate-vgs-* are used, and no event-based activation occurs after the services finish. (Equivalent to setting lvm.conf event_activation=0.) "event_only" - the lvm-activate-vgs* services are skipped, and all VGs are activated individually with event-based activation. "pvscan_hints" - the vgchange autoactivation commands use pvs_online files created by pvscan. This optimization limits the devices scanned by the vgchange command to only PVs that have been processed by pvscan.
Diffstat (limited to 'tools/toollib.h')
-rw-r--r--tools/toollib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/toollib.h b/tools/toollib.h
index f3a60fbc4..76806d4c9 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -237,4 +237,9 @@ int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
int get_lvt_enum(struct logical_volume *lv);
+int get_autoactivation_config_settings(struct cmd_context *cmd, int *service_only,
+ int *event_only, int *service_and_event, int *pvscan_hints);
+int get_autoactivation_command_options(struct cmd_context *cmd, const char *aa,
+ int *opt_service, int *opt_event, int *opt_event_enable);
+
#endif