diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2016-05-23 10:16:29 +0200 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2016-06-02 14:08:11 +0200 |
commit | 232bc957bd14b8905a7fd03e0debaf95f91a68a5 (patch) | |
tree | 53d28914464a47acfe939f86bbc450e44f419c09 | |
parent | cd5e71e6b8f218cbef00fa27b6bf96f2526123fd (diff) | |
download | lvm2-232bc957bd14b8905a7fd03e0debaf95f91a68a5.tar.gz |
toollib: add report_group and status_rh to processing_handle and initialize cmd processing status report
-rw-r--r-- | tools/toollib.c | 9 | ||||
-rw-r--r-- | tools/toollib.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tools/toollib.c b/tools/toollib.c index 0de6ee847..f36ab99f2 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1725,6 +1725,11 @@ struct processing_handle *init_processing_handle(struct cmd_context *cmd) handle->internal_report_for_select = arg_is_set(cmd, select_ARG); handle->include_historical_lvs = cmd->include_historical_lvs; + if (!report_format_init(cmd, &handle->report_group, &handle->status_rh)) { + dm_pool_free(cmd->mem, handle); + return NULL; + } + return handle; } @@ -1754,6 +1759,10 @@ void destroy_processing_handle(struct cmd_context *cmd, struct processing_handle if (handle) { if (handle->selection_handle && handle->selection_handle->selection_rh) dm_report_free(handle->selection_handle->selection_rh); + if (!dm_report_group_destroy(handle->report_group)) + stack; + if (handle->status_rh) + dm_report_free(handle->status_rh); /* * TODO: think about better alternatives: * handle mempool, dm_alloc for handle memory... diff --git a/tools/toollib.h b/tools/toollib.h index 06d0ef9fc..cddb36d20 100644 --- a/tools/toollib.h +++ b/tools/toollib.h @@ -72,6 +72,8 @@ struct processing_handle { int internal_report_for_select; int include_historical_lvs; struct selection_handle *selection_handle; + struct dm_report_group *report_group; + struct dm_report *status_rh; void *custom_handle; }; |