main - rename pvscan_cache_single to expect_missing_vg_device in cmd
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=594f6ca97024fa23dfa852b6cc9da272877e1ced Commit: 594f6ca97024fa23dfa852b6cc9da272877e1ced Parent: 726dd25969e9e6a3de285a22cea45e9f5f53520f Author: David Teigland <[email protected]> AuthorDate: Wed Nov 3 09:50:11 2021 -0500 Committer: David Teigland <[email protected]> CommitterDate: Thu Nov 4 11:08:38 2021 -0500
rename pvscan_cache_single to expect_missing_vg_device in cmd
--- lib/commands/toolcontext.h | 2 +- lib/device/device_id.c | 5 ++--- lib/metadata/metadata.c | 4 ++-- tools/pvscan.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-)
lib/commands/toolcontext.h +1 -1
@@ -174,7 +174,7 @@ struct cmd_context { unsigned activate_component:1; /* command activates component LV */ unsigned process_component_lvs:1; /* command processes also component LVs */ unsigned mirror_warn_printed:1; /* command already printed warning about non-monitored mirrors */ - unsigned pvscan_cache_single:1; + unsigned expect_missing_vg_device:1; /* when reading a vg it's expected that a dev for a pv isn't found */ unsigned can_use_one_scan:1; unsigned is_clvmd:1; unsigned md_component_detection:1;
lib/device/device_id.c +2 -3
@@ -778,9 +778,8 @@ static void _device_ids_update_try(struct cmd_context *cmd) {int held =0 ; -/* Defer updates to non-pvscan-cache commands. */ -if (cmd->pvscan_cache_single) { -log_print ("pvscan[%d] skip updating devices file." ,getpid ()); +if (cmd->expect_missing_vg_device) { +log_print ("skip updating devices file." );return ; }
lib/metadata/metadata.c +2 -2
@@ -3558,7 +3558,7 @@ static void _set_pv_device(struct format_instance *fid,if (!id_write_format (&pv->id, buffer,sizeof (buffer))) buffer[0 ] ='\0' ; -if (cmd && !cmd->pvscan_cache_single && +if (cmd && !cmd->expect_missing_vg_device && (!vg_is_foreign (vg) && !cmd->include_foreign_vgs))log_warn ("WARNING: Couldn't find device with uuid %s." , buffer);else
@@ -5084,7 +5084,7 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, constif (!pvl->pv->dev) {/* The obvious and common case of a missing device. */ -if (vg_is_foreign (vg) && !cmd->include_foreign_vgs) +if ((vg_is_foreign (vg) && !cmd->include_foreign_vgs) || cmd->expect_missing_vg_device)log_debug ("VG %s is missing PV %s (last written to %s)" , vg_name, uuidstr, pvl->pv->device_hint ?:"na" );else if (pvl->pv->device_hint)log_warn ("WARNING: VG %s is missing PV %s (last written to %s)." , vg_name, uuidstr, pvl->pv->device_hint);
tools/pvscan.c +1 -1
@@ -1679,7 +1679,7 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,dm_list_init (&pvscan_args);dm_list_init (&pvscan_devs); - cmd->pvscan_cache_single =1 ; + cmd->expect_missing_vg_device =1 ;/* * Special pvscan-specific setup steps to avoid looking