summaryrefslogtreecommitdiffstats
path: root/lib/report/report.c
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-071-6/+6
| | | | Global change from --discard to --discards, as that feels more natural.
* report: provide discard field value in fullAlasdair G Kergon2012-08-071-16/+5
| | | | | | | | | 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-181-0/+30
| | | | | | | | | | New field "discard" is added for lvs reporting of lv segment. Reported as one character: (i)gnore (n)opassdown (p)assdown lvs -o+discard
* 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-191-28/+240
| | | | | | | 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.
* Add a new 'thin_pool' output field to 'lvs.Alasdair Kergon2011-09-091-0/+13
| | | | | | | | | 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-121-76/+13
| | | | | | | 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-051-2/+6
| | | | | | | | | | | | | | 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-181-8/+6
| | | | | | | | | | | | | | | | 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.
* 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.
* Add the macro and specific 'get' functions for lvsegs.Petr Rockai2010-11-171-12/+6
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add lv_read_ahead and lv_kernel_read_ahead 'get' functions.Dave Wysochanski2010-10-211-3/+3
|
* Refactor and add code for (lv) 'modules' get function.Dave Wysochanski2010-10-121-8/+4
|
* Refactor and add code for (lv) 'mirror_log' get function.Dave Wysochanski2010-10-121-7/+3
| | | | | 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-121-6/+6
| | | | | 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-121-12/+1
| | | | | 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-121-8/+3
| | | | | 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-121-6/+1
| | | | | 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-121-10/+1
|
* Add pv_mda_size, pv_mda_free, and pv_used functions, call from 'disp' functions.Dave Wysochanski2010-09-301-25/+9
|
* 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-301-169/+5
| | | | | | | | 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().
* Remove explicit double quotes from columns.h 'id' entries.Dave Wysochanski2010-08-201-1/+1
| | | | | | | | 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.
* Add 'flags' field to columns.h and define FIELD_MODIFIABLE.Dave Wysochanski2010-08-201-1/+1
| | | | | | Add a 'flags' field to columns.h, and set it to 0 by default. Define FIELD_MODIFIABLE flag to indicate whether a 'set' function exists to change the field's value.
* Add vg_mda_size and vg_mda_free functions.Dave Wysochanski2010-08-201-33/+4
| | | | | Add supporting functions to get vg_mda_size and vg_mda_free fields. Should be no functional change.
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-5/+5
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-46/+46
|
* Allow 'all' and 'unmanaged' values for --vgmetadatacopies.Dave Wysochanski2010-06-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Allowing an 'all' and 'unmanaged' value is more intuitive, and provides a simple way for users to get back to original LVM behavior of metadata written to all PVs in the volume group. If the user requests "--vgmetadatacopies unmanaged", this instructs LVM not to manage the ignore bits to achieve a specific number of metadata copies in the volume group. The user is free to use "pvchange --metadataignore" to control the mdas on a per-PV basis. If the user requests "--vgmetadatacopies all", this instructs LVM to do 2 things: 1) clear all ignore bits, and 2) set the "unmanaged" policy going forward. Internally, we use the special MAX_UINT32 value to indicate 'all'. This 'just' works since it's the largest value possible for the field and so all 'ignore' bits on all mdas in the VG will get cleared inside _vg_metadata_balance(). However, after we've called the _vg_metadata_balance function, we check for the special 'all' value, and if set, we write the "unmanaged" value into the metadata. As such, the 'all' value is never written to disk. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add vg_mda_copies display field to 'vgs' command.Dave Wysochanski2010-06-281-0/+12
| | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Define new functions and vgs/pvs fields related to mda ignore.Dave Wysochanski2010-06-281-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Define a new pvs field, pv_mda_used_count, and a new vgs field, vg_mda_used_count to match the existing pv_mda_count and vg_mda_count. These new fields count the number of mdas that have the 'ignored' bit clear (they are in use on the PV / VG). Also define various supporting functions to implement the counting as well as setting the ignored flag and determining if an mda is ignored. These high level functions call into the lower level location independent mda ignore functions defined by earlier patches. Note that counting ignored mdas in a vg requires traversing both lists and checking for the ignored bit on the mda. The count of 'ignored' mdas then is defined by having the bit set, not by which list the mda is on. The list does determine whether LVM actually does read/write to the mda, though we must count the bits in order to return accurate numbers for the various counts. Also, pv_mda_set_ignored must search both vg lists for ignored mda. If the state changes and needs to be committed to disk, the ignored mda will be on the non-ignored list. Note also in pv_mda_set_ignored(), we must properly manage the mda lists. If we change the ignored state of an mda, we must change any mdas on vg->fid->metadata_areas that correspond to this pv. Also, we may need to allocate a copy of the mda, as is done when fid->metadata_areas is populated from _vg_read(), if we are un-ignoring an ignored mda. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add metadata_areas_ignored list and functions to manage ignored mdas.Dave Wysochanski2010-06-281-0/+1
| | | | | | | | | | | | | Add a second mda list, metadata_areas_ignored to fid, and a couple functions, fid_add_mda() and fid_add_mdas() to help manage the lists. These functions are needed to properly count the ignored mdas and manage the lists attached to the 'fid' and ultimately the 'vg'. Ensure metadata_areas_ignored is initialized in other formats, even if the list is never used. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Rename fid->metadata_areas to fid->metadata_areas_in_use.Dave Wysochanski2010-06-281-3/+3
| | | | | Rename the metadata_areas list to an 'in_use' list to prepare for future 'ignored' list.
* Add lv_path to reports to offer full /dev pathname.Alasdair Kergon2010-06-231-0/+24
|
* If unable to obtain snapshot percentage leave value blank on reports.Alasdair Kergon2010-05-201-1/+1
|
* Use dm_report_field_int32 instead of dm_report_field_uint64 for printing '-1'Zdenek Kabelac2010-02-151-5/+6
|
* Cleanup float arithmetic gcc warning.Zdenek Kabelac2010-02-151-2/+2
|
* * add more 'const' - fixes gcc constness warningZdenek Kabelac2010-02-151-3/+3
|
* Export lvm_pv_get_size(), lvm_pv_get_free(), lvm_pv_get_dev_size in lvm2app.Dave Wysochanski2010-02-141-11/+5
| | | | | | | | We add these exports to show the pv_size and pv_free and dev_size fields. Fixes rhbz561423. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add snapshot merge wrappers to abstract the associations and flags usedMike Snitzer2010-01-131-4/+4
| | | | to represent merging origin and snapshot volumes.
* Merge on activate support.Mike Snitzer2010-01-131-2/+10
| | | | | | | | | | | If either the origin or snapshot that is to be merged is open the merge will not start; only the merge metadata will be written. The merge will start on the next activation of the origin (or via lvchange --refresh) IFF both the origin and snapshot are closed. Merge on activate is particularly important if we want to merge over a mounted filesystem that cannot be unmounted (until next boot) --- for example root.
* When there is merging snapshot, report percentage on the origin LV.Mike Snitzer2010-01-131-1/+1
| | | | | Because the snapshot LV will be hidden this is needed so the user can see merging progress with "lvs" command.
* Report merging snapshot as 'S' instead of 's':Mike Snitzer2010-01-131-5/+12
| | | | | | | | | | | This is useful for when the snapshot is still active and merging hasn't started yet; it shows a merge is pending. Once merging starts the merging snapshot will be hidden but can still be displayed with 'lvs -a' Report snapshot origin with merging snapshot as 'O' instead of 'o': Before merge starts this shows that a merge is pending. While merging the snapshot will be hidden, 'O' enables a user to see that there is a snapshot merging.
* Use offsetof() macro and avoid defining dummy static union for FIELD() macro.Zdenek Kabelac2010-01-071-13/+12
| | | | Makes it compilable by clang compiler.
* Add vg_mda_count library function.Dave Wysochanski2009-10-311-1/+1
|
* Permit snapshots of mirrors. (brassow)Alasdair Kergon2009-10-261-4/+5
|