Bug 614049
| Summary: | Add lvm2app APIs to query all pvs/vgs/lvs report fields and set values as with {pv|vg|lv}change | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Dave Wysochanski <dwysocha> | ||||
| Component: | lvm2 | Assignee: | Petr Rockai <prockai> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Corey Marthaler <cmarthal> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 6.1 | CC: | agk, dwysocha, heinzm, jbrassow, joe.thornber, mbroz, prajnoha, prockai | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | lvm2-2.02.82-1.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-05-19 14:26:18 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Dave Wysochanski
2010-07-13 15:13:55 UTC
Fairly large patchset checked in upstream which refactors and extends existing reporting infrastructure. We now have the framework for this 'get' / 'set' paradigm, and all 'get' functions for PV and VG are checked in too. Patches that extend lvm2app (lvm_vg_get_property(), etc) have not been checked in yet, but these are small, have been submitted on the list, and testing is on going. They will be checked in as a group once the remaining items below are finished. Still todo and in progress: 1) finish 'lv' attributes. 2) add helpers to lookup a pv/lv handle from a vg handle and/or pv/lv name. Callers can do this now but it is a manual process (must call lvm_vg_list_pvs() or lvm_vg_list_lvs() and then loop through the list comparing. 3) add lvm2app support for 'lvseg' and 'pvseg' 4) finish 'lvseg' and 'pvseg' attributes 5) add unit tests / nightly tests Created attachment 452120 [details]
Design notes for generic attributes and why I decided this approach.
These were my design notes, and why I decided on this approach to the generic attributes, instead of the earlier approaches / patches posted which extended the reporting infrastructure.
Additional cleanup patch sets proposed as a result of code review: 1) add dm_pool_asprintf(). See https://www.redhat.com/archives/lvm-devel/2010-October/msg00059.html 2) cleanup log_error() paths for attribute patches and lvm2app code. Make memory allocation failures similar return (some places we are using log_errno(ENOMEM, ...), others return_NULL, etc Still some final bits to be worked out in exported function prototypes. Patches are basically ready to go though, with 2 different function prototypes proposed. Only thing that remains is the two "percent" / float lv fields, and the lvseg/pvseg fields. I've submitted preliminary patches for most of the lvseg properties, and pvseg fields should be trivial once lvseg properties are finalized. So this is 95% complete at this point. I have merged Dave's patches. I'll create a separate bugzilla for percent fields (I do have a plan) and also for other setters (ideally, when we get some feedback on what is actually needed). I will also make a bugzilla for automated testing coverage of the API. This one can go POST. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0772.html |