Bug 614049 - Add lvm2app APIs to query all pvs/vgs/lvs report fields and set values as with {pv|vg|lv}change
Add lvm2app APIs to query all pvs/vgs/lvs report fields and set values as wit...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Petr Rockai
Corey Marthaler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-13 11:13 EDT by Dave Wysochanski
Modified: 2011-05-19 10:26 EDT (History)
8 users (show)

See Also:
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 10:26:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Design notes for generic attributes and why I decided this approach. (1.72 KB, text/plain)
2010-10-07 11:16 EDT, Dave Wysochanski
no flags Details

  None (edit)
Description Dave Wysochanski 2010-07-13 11:13:55 EDT
Description of problem:
lvm2app currently only exports a few of the most common attributes for PVs, VGs, and LVs and a more comprehensive / generic interface is needed on the order of pvs/vgs/lvs reporting commands.  A few patch sets were submitted last year and should be continued to completion.

Ideally this interface should be a simple 'get' / 'set' paradigm, with attribute naming similar to the reporting commands.  Auto-generation of symbols may be used similar to lib/report/columns.h. 


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Dave Wysochanski 2010-10-06 13:32:07 EDT
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
Comment 2 Dave Wysochanski 2010-10-07 11:16:17 EDT
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.
Comment 3 Dave Wysochanski 2010-10-12 10:27:49 EDT
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
Comment 4 Dave Wysochanski 2010-10-21 12:35:34 EDT
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.
Comment 5 Petr Rockai 2010-11-17 16:15:46 EST
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.
Comment 8 errata-xmlrpc 2011-05-19 10:26:18 EDT
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

Note You need to log in before you can comment on or make changes to this bug.