diff options
-rw-r--r-- | tools/pvchange.c | 2 | ||||
-rw-r--r-- | tools/toollib.c | 12 | ||||
-rw-r--r-- | tools/toollib.h | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c index d5496d935..278d37740 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -167,7 +167,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv) } if (!(handle = init_processing_handle(cmd)) || - (!handle->direct_reporting && !init_selection_handle(cmd, handle))) { + (!handle->direct_reporting && !init_selection_handle(cmd, handle, PVS))) { log_error("Failed to initialize processing handle."); r = ECMD_FAILED; goto out; diff --git a/tools/toollib.c b/tools/toollib.c index 3d592047b..3d98884e7 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1586,7 +1586,8 @@ struct processing_handle *init_processing_handle(struct cmd_context *cmd) return handle; } -int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle) +int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle, + report_type_t initial_report_type) { struct selection_handle *sh; @@ -1595,6 +1596,7 @@ int init_selection_handle(struct cmd_context *cmd, struct processing_handle *han return 0; } + sh->report_type = initial_report_type; if (!(sh->selection_rh = report_init_for_selection(cmd, &sh->report_type, arg_str_value(cmd, select_ARG, NULL)))) { dm_pool_free(cmd->mem, sh); @@ -1833,7 +1835,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv, goto_out; if (!handle->direct_reporting && !handle->selection_handle && - !init_selection_handle(cmd, handle)) + !init_selection_handle(cmd, handle, VGS)) goto_out; ret = _process_vgnameid_list(cmd, flags, &vgnameids_to_process, @@ -1878,7 +1880,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, } if (!handle->direct_reporting && !handle->selection_handle && - !init_selection_handle(cmd, handle)) { + !init_selection_handle(cmd, handle, LVS)) { ret_max = ECMD_FAILED; goto_out; } @@ -2207,7 +2209,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla goto_out; if (!handle->direct_reporting && !handle->selection_handle && - !init_selection_handle(cmd, handle)) + !init_selection_handle(cmd, handle, LVS)) goto_out; /* @@ -2444,7 +2446,7 @@ static int _process_pvs_in_vg(struct cmd_context *cmd, } if (!handle->direct_reporting && !handle->selection_handle && - !init_selection_handle(cmd, handle)) { + !init_selection_handle(cmd, handle, PVS)) { ret_max = ECMD_FAILED; goto_out; } diff --git a/tools/toollib.h b/tools/toollib.h index e2245b065..aebb2dd2d 100644 --- a/tools/toollib.h +++ b/tools/toollib.h @@ -138,7 +138,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, process_single_lv_fn_t process_single_lv); struct processing_handle *init_processing_handle(struct cmd_context *cmd); -int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle); +int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle, + report_type_t initial_report_type); void destroy_processing_handle(struct cmd_context *cmd, struct processing_handle *handle, int deallocate_handle_root); |