Bug 1334655
| Summary: | Enhance reporting code in libdevmapper to support report groups with different output formats | ||
|---|---|---|---|
| Product: | [Community] LVM and device-mapper | Reporter: | Peter Rajnoha <prajnoha> |
| Component: | lvm2 | Assignee: | Peter Rajnoha <prajnoha> |
| lvm2 sub component: | libdevmapper | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED UPSTREAM | Docs Contact: | |
| Severity: | low | ||
| Priority: | medium | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac |
| Version: | unspecified | Flags: | prajnoha:
lvm-technical-solution+
rule-engine: lvm-test-coverage? |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-24 08:40:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1334659, 1334667, 1334674, 1334682, 1334692, 1346079 | ||
|
Description
Peter Rajnoha
2016-05-10 09:04:47 UTC
The flow of the code is following: - create report group - push report(report1) - push report(report2) - ... - push report(reportN) - dm_report_output(reportN) - pop report(reportN) - ... - dm_report_output(report2) - pop report(report2) - dm_report_output(report1) - pop report(report1) - destroy report group This sequence is also valid: - create report group - push report(report1) - dm_report_output(report1) - pop report(report1) - push report(report2) - dm_report_output(report2) - pop report(report2) ... - push report(reportN) - dm_report_output(reportN) - pop report(reportN) - destroy report group So the rule is - only the report on top of the stack can be generating output - this controls the flow of output from different reports in a group. More concretely, there are 4 new libdevmapper functions to support this feature: struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data) --> Creates a new group of type "type" with any additional "data" that the group type needs (this is any type-specific additional data that can be attached to the group or which are needed for initialization). int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data) --> Pushes report to group's stack with any type-specific additional "data". If report is NULL, this is just an item that wraps several reports on output under one object, but the item itself is not a report. int dm_report_group_pop(struct dm_report_group *group) --> Pops report from group's stack, adding any closing stanzas based on group type used. int dm_report_group_destroy(struct dm_report_group *group) --> Destroys whole report group. If any of the reports has not been reported on output yet by direct dm_report_output call, it is reported on output now automatically. device-mapper library (libdevmapper) adds support for grouping reports together since version 1.02.128 and it contains these functions to support the feature: - dm_report_group_create to create report group - dm_report_group_push to add report to report group - dm_report_group_pop to remove last report from report group - dm_report_group_destroy to destroy report group |