diff options
author | David Teigland <teigland@redhat.com> | 2019-02-06 13:00:33 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2019-04-11 12:03:04 -0500 |
commit | b1ceee55a623d7c775e9fc218b9d7aee4d6783c3 (patch) | |
tree | 8b71e22114526cb3b2725e5fd41fc9579ceca5a4 | |
parent | 4de9e82b75a9ef31889345665e514c74e8347e1d (diff) | |
download | lvm2-b1ceee55a623d7c775e9fc218b9d7aee4d6783c3.tar.gz |
process_each_pv handle outdated pvs
process_each_pv should account for outdated pvs
in the list of all devices it is processing.
-rw-r--r-- | tools/toollib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/toollib.c b/tools/toollib.c index 5206e26d3..00c97016f 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -4208,12 +4208,16 @@ static int _process_pvs_in_vg(struct cmd_context *cmd, struct physical_volume *pv; struct pv_list *pvl; struct device_id_list *dil; + struct device_list *devl; + struct dm_list outdated_devs; const char *pv_name; int process_pv; int do_report_ret_code = 1; int ret_max = ECMD_PROCESSED; int ret = 0; + dm_list_init(&outdated_devs); + log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_PV); vg_uuid[0] = '\0'; @@ -4299,6 +4303,12 @@ static int _process_pvs_in_vg(struct cmd_context *cmd, break; log_set_report_object_name_and_id(NULL, NULL); } + + if (!is_orphan_vg(vg->name)) + lvmcache_get_outdated_devs(cmd, vg->name, (const char *)&vg->id, &outdated_devs); + dm_list_iterate_items(devl, &outdated_devs) + _device_list_remove(all_devices, devl->dev); + do_report_ret_code = 0; out: if (do_report_ret_code) |