summaryrefslogtreecommitdiffstats
path: root/lib/report
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-1/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-073-9/+9
| | | | Global change from --discard to --discards, as that feels more natural.
* report: provide discard field value in fullAlasdair G Kergon2012-08-072-17/+6
| | | | | | | | | I think it's better not to abbreviate human-readable fields like 'discard' to a single character. Users can truncate it to the first character themselves if they wish. It's confusing to use the variable name discard for different things in different places - use discard_str when it's a string not the enum.
* thin: add reporting of discard for thin poolZdenek Kabelac2012-07-183-0/+33
| | | | | | | | | | New field "discard" is added for lvs reporting of lv segment. Reported as one character: (i)gnore (n)opassdown (p)assdown lvs -o+discard
* Use unsigned type for bitmaskZdenek Kabelac2012-02-272-3/+3
| | | | | | Using report_type_t for bitmask is not correct, since we have not defined types for all bit combinations - so switching to unsigned type, since values of report_type_t enum are unsigned.
* Thin read percent info from layered deviceZdenek Kabelac2012-01-251-1/+1
| | | | | Since we only need layered device - check for tpool device presence, so user doesn't need to activate thin pool explicitely for percent info.
* Differentiate between snapshot status of "Invalid" and "Merge failed".Mike Snitzer2012-01-201-1/+1
|
* Thin add new display field for lvsZdenek Kabelac2012-01-193-33/+289
| | | | | | | New field Data% is able to display info about thin_pool, thin, snapshot and has generic meaning here. Simple Time/Host field are here to display host and time creation.
* Thin supports snapshotsZdenek Kabelac2011-11-071-0/+3
| | | | | | | Full support for thin snapshots. Create and remove is supported. TODO: lvconvert support is not yes available.
* correct thin_pool widthAlasdair Kergon2011-09-271-1/+1
|
* Add a new 'thin_pool' output field to 'lvs.Alasdair Kergon2011-09-093-0/+16
| | | | | | | | | A gentle reminder that anyone relying on the output of reporting commands like lvs in scripts must use -o to guarantee they get the fields they expect. The default sequence of fields can change from release to release. Equally, the 'attr' fields can have new values introduced and/or characters appended to them.
* Remove meaningless const type qualifiers on cast typeZdenek Kabelac2011-08-041-1/+1
| | | | Static analyzis noticed we do not really need them - so removing.
* This patchset refactors some reporting code and completes the remainingPetr Rockai2011-04-122-78/+16
| | | | | | | lvseg properties for lvm2app, 'devices' and 'seg_pe_ranges'. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Fix reading of released memoryZdenek Kabelac2011-03-052-3/+7
| | | | | | | | | | | | | | lvseg_segtype_dup used memory pool vg memory pool for strind duplication. However this one gets released before reporting happens so the command like: pvs -o segtype prints data from already released memory pool. Thanks to the fact there is not much allocation happing after the VG is released, the memory stays unmodified and correct result is printed. Fix adds support for mempool passed parameter (like other similar query commands) and uses dm_report memory pool for string duplication.
* Const fixingZdenek Kabelac2011-02-182-10/+7
| | | | | | | | | | | | | | | | Fixing some const warnings - with API change in: int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names, Change is needed - as lvm2api expects const behaviour here. So vg_extend() is doing local strdup for unescaping. skip_dev_dir return const char* from const char* vg_name. Rest of the patch is cleanup of related warnings. Also using dm_report_filed_string() API change to simplify casting in _string_disp and _lvname_disp.
* Return PERCENT_INVALID for error caseZdenek Kabelac2011-01-051-6/+9
| | | | | If the percent value could not be determined return PERCENT_INVALID. Indent function with tabs.
* Add getters for copy_percent and snap_percent to the lvm2app API.Petr Rockai2010-12-141-2/+15
|
* Refactor the percent (mirror sync, snapshot usage) handling code to usePetr Rockai2010-11-301-11/+9
| | | | fixed-point values instead of a combination of a float value and an enum.
* All 'size' values of lvm2app properties should be in bytes.Petr Rockai2010-11-251-1/+1
| | | | | | | Fix 'seg_size' to return bytes. Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add the macro and specific 'get' functions for pvsegs.Petr Rockai2010-11-172-2/+14
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add the macro and specific 'get' functions for lvsegs.Petr Rockai2010-11-173-24/+30
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Make value.string const char *, in properties.h, to fix a warning introduced byPetr Rockai2010-11-171-1/+1
| | | | the previous patch set.
* Add generic infrastructure to internal library to 'set' a property.Petr Rockai2010-11-173-2/+77
| | | | | | | | Similar to 'get' property internal functions. Add specific 'set' function for vg_mda_copies. Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add 'is_integer' flag into internal lvm_property_type.Dave Wysochanski2010-10-252-2/+3
| | | | | Add 'is_integer' flag similar to 'is_string'. Suggested in review by Petr Rockai.
* Add lv_get_property() internal lvm function.Dave Wysochanski2010-10-212-0/+8
|
* Rename fields in lvm_property_type.Dave Wysochanski2010-10-212-13/+11
| | | | | | | | | | Based on review comments, rename a few fields in lvm_property_type. In particular, change 'is_writeable' to 'is_settable', which is more intuitive to the intent of the bitfield (a 'set' function exists for this field/property). Also, remove the char array for 'id' - unnecessary as we can just use the string passed in to do the strcmp. Finally rename the union members from n_val to 'integer' and 's_val' to 'string'.
* Add lv_read_ahead and lv_kernel_read_ahead 'get' functions.Dave Wysochanski2010-10-212-5/+5
|
* Refactor and add code for (lv) 'lv_origin' get function.Dave Wysochanski2010-10-211-1/+1
|
* Refactor and add code for (lv) 'lv_name' get function.Dave Wysochanski2010-10-211-1/+1
|
* Refactor and add code for (lv) 'modules' get function.Dave Wysochanski2010-10-122-9/+5
|
* Refactor and add code for (lv) 'mirror_log' get function.Dave Wysochanski2010-10-122-8/+4
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Refactor and add code for (lv) 'lv_kernel_{major|minor}' get functions.Dave Wysochanski2010-10-122-8/+8
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Refactor and add code for (lv) 'convert_lv' get function.Dave Wysochanski2010-10-122-13/+2
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Refactor and add code for (lv) 'move_pv' get function.Dave Wysochanski2010-10-122-9/+4
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Refactor and add code for (lv) 'origin_size' get function.Dave Wysochanski2010-10-122-7/+2
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Refactor and add code for (lv) 'lv_path' get function.Dave Wysochanski2010-10-122-11/+2
|
* Add some lv 'get' functions that require no refactoring.Dave Wysochanski2010-10-121-7/+7
| | | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Reviewed-By: Petr Rockai <prockai@redhat.com>
* Add pv_get_property and create generic internal _get_property function.Dave Wysochanski2010-09-302-123/+152
| | | | | | | | | | | | We need to use a similar function for pv and lv properties, so just make a generic _get_property() function that contains most of the required functionality. Also, add a check to ensure the field name matches the object passed in by re-using report_type_t enum. For pv properties, the report_type might be either PVS or LABEL. In addition, add 'const' to 'get' functions object parameter, but not 'set' functions. Add _not_implemented_set() and _not_implemented_get() functions.
* Add pv 'get' functions for all pv properties.Dave Wysochanski2010-09-301-16/+16
| | | | | | Add 'get' functions for all pv properties. Multiply by SECTOR_SIZE for pv properties pv_mda_free, pv_mda_size, pe_start, pv_size, pv_free, pv_used.
* Add pv_mda_size, pv_mda_free, and pv_used functions, call from 'disp' functions.Dave Wysochanski2010-09-301-25/+9
|
* Add 'get' functions for vg fields.Dave Wysochanski2010-09-301-6/+6
| | | | | | Add 'get' functions based on generic macros for VG, PV, and LV. Add 'get' functions for vg string fields, vg_name, vg_fmt, vg_sysid, vg_uuid, vg_attr, and vg_tags, and all numeric fields.
* Make generic GET_*_PROPERTY_FN macros and define secondary macro for vg, pv, lv.Dave Wysochanski2010-09-301-18/+39
| | | | | Will need similar macros for VG, PV and LV, so define a generic one, and just pass in the struct name and variable name for the specific macro.
* Add tags_format_and_copy() common function and call from _tags_disp.Dave Wysochanski2010-09-301-18/+3
| | | | | | Add a common function to allocate memory and format a string of tags. Call tags_format_and_copy() from _tags_disp().
* Add id_format_and_copy() common function and call from _uuid_disp.Dave Wysochanski2010-09-301-6/+1
| | | | | Add supporting uuid function to allocate memory and call id_write_format. Call id_format_and_copy from _uuid_disp.
* Add {pv|vg|lv}_attr_dup() functions and refactor 'disp' functions.Dave Wysochanski2010-09-302-170/+6
| | | | | | | | Move the creating of the 'attr' strings into a common function so they can be called from the 'disp' functions as well as the new 'get' property functions. Add "_dup" suffix to indicate memory is allocated. Refactor pvstatus_disp to take pv argument and call pv_attr_dup().
* Update vg_mda_free 'get' function to multiply by SECTOR_SIZE.Dave Wysochanski2010-09-091-1/+1
|
* Define GET_NUM_PROPERTY_FN macro to simplify numeric property 'get' functions.Dave Wysochanski2010-08-201-0/+9
|
* Add implmentation for simple numeric 'get' property functions.Dave Wysochanski2010-08-201-16/+16
| | | | | | | | | | | | Add 'get' functions based on the simple macro function definition for a numeric property. Add 'get' functions for the following: _vg_extent_count_get, _vg_free_count_get, _max_lv_get, _max_pv_get, _pv_count_get, _lv_count_get, _snap_count_get, _vg_seqno_get, _vg_size_get, _vg_free_get, vg_mda_*. For size functions, multiply by SECTOR_SIZE to return the value in bytes.
* Define GET_NUM_PROPERTY_FN macro to simplify numeric property 'get' functions.Dave Wysochanski2010-08-202-0/+263
|
* Remove explicit double quotes from columns.h 'id' entries.Dave Wysochanski2010-08-202-76/+76
| | | | | | | | The 'id' entries in columns.h are the report field names. Since these are unique, we'd like to use them in generation of 'get' / 'set' functions. As a step towards using them for this purpose, remove the explicit double quotes and use the macro '#' character to add the double quotes back when placing them into the '_fields' array 'id' member.