186d7f5d3SJohn Marino /* $NetBSD: columns.h,v 1.1.1.3 2009/12/02 00:26:45 haad Exp $ */ 286d7f5d3SJohn Marino 386d7f5d3SJohn Marino /* 486d7f5d3SJohn Marino * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved. 586d7f5d3SJohn Marino * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. 686d7f5d3SJohn Marino * 786d7f5d3SJohn Marino * This file is part of LVM2. 886d7f5d3SJohn Marino * 986d7f5d3SJohn Marino * This copyrighted material is made available to anyone wishing to use, 1086d7f5d3SJohn Marino * modify, copy, or redistribute it subject to the terms and conditions 1186d7f5d3SJohn Marino * of the GNU Lesser General Public License v.2.1. 1286d7f5d3SJohn Marino * 1386d7f5d3SJohn Marino * You should have received a copy of the GNU Lesser General Public License 1486d7f5d3SJohn Marino * along with this program; if not, write to the Free Software Foundation, 1586d7f5d3SJohn Marino * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1686d7f5d3SJohn Marino */ 1786d7f5d3SJohn Marino 1886d7f5d3SJohn Marino /* 1986d7f5d3SJohn Marino * This file defines the fields (columns) for the reporting commands 2086d7f5d3SJohn Marino * (pvs/vgs/lvs). 2186d7f5d3SJohn Marino */ 2286d7f5d3SJohn Marino /* 2386d7f5d3SJohn Marino * The 'FIELD' macro arguments are defined as follows: 2486d7f5d3SJohn Marino * 1. report_type. An enum value that selects a specific 2586d7f5d3SJohn Marino * struct dm_report_object_type in the _report_types array. The value is 2686d7f5d3SJohn Marino * used to select the containing base object address (see *obj_get* 2786d7f5d3SJohn Marino * functions) for any data values of any field in the report. 2886d7f5d3SJohn Marino * 2. Containing struct. The structure that either contains the field data 2986d7f5d3SJohn Marino * as a member or should be used to obtain the field data. The containing 3086d7f5d3SJohn Marino * struct should match the base object of the report_type. 3186d7f5d3SJohn Marino * 3. Field type. This must be either 'STR' or 'NUM'. 3286d7f5d3SJohn Marino * 4. Report heading. This is the field heading that is displayed by the 3386d7f5d3SJohn Marino * reporting commands. 3486d7f5d3SJohn Marino * 5. Data value pointer. This argument is always a member of the 3586d7f5d3SJohn Marino * containing struct. It may point directly to the data value (for example, 3686d7f5d3SJohn Marino * lv_uuid - see _uuid_disp()) or may be used to derive the data value (for 3786d7f5d3SJohn Marino * example, seg_count - see _lvsegcount_disp()). In the FIELD macro 3886d7f5d3SJohn Marino * definition, it is used in an offset calculation to derive the offset to 3986d7f5d3SJohn Marino * the data value from the containing struct base address. Note that in some 4086d7f5d3SJohn Marino * cases, the argument is the first member of the struct, in which case the 4186d7f5d3SJohn Marino * data value pointer points to the start of the struct itself (for example, 4286d7f5d3SJohn Marino * 'lvid' field of struct 'lv'). 4386d7f5d3SJohn Marino * 6. Minimum display width. This is the minimum width used to display 4486d7f5d3SJohn Marino * the field value, typically matching the width of the column heading. 4586d7f5d3SJohn Marino * 7. Display function identifier. Used to derive the full name of the 4686d7f5d3SJohn Marino * function that displays this field. Derivation is done by appending '_' 4786d7f5d3SJohn Marino * then prepending this argument to '_disp'. For example, if this argument 4886d7f5d3SJohn Marino * is 'uuid', the display function is _uuid_disp(). Adding a new field may 4986d7f5d3SJohn Marino * require defining a new display function (for example _myfieldname_disp()), 5086d7f5d3SJohn Marino * or re-use of an existing one (for example, _uint32_disp()). 5186d7f5d3SJohn Marino * 8. Unique format identifier / field id. This name must be unique and is 5286d7f5d3SJohn Marino * used to select fields via '-o' in the reporting commands (pvs/vgs/lvs). 5386d7f5d3SJohn Marino * The string used to specify the field - the 'id' member of 5486d7f5d3SJohn Marino * struct dm_report_field_type. 5586d7f5d3SJohn Marino * 9. Description of field. This is a brief (ideally <= 52 chars) description 5686d7f5d3SJohn Marino * of the field used in the reporting commands. 5786d7f5d3SJohn Marino */ 5886d7f5d3SJohn Marino 5986d7f5d3SJohn Marino /* *INDENT-OFF* */ 6086d7f5d3SJohn Marino FIELD(LVS, lv, STR, "LV UUID", lvid.id[1], 38, uuid, "lv_uuid", "Unique identifier.") 6186d7f5d3SJohn Marino FIELD(LVS, lv, STR, "LV", lvid, 4, lvname, "lv_name", "Name. LVs created for internal use are enclosed in brackets.") 6286d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Attr", lvid, 4, lvstatus, "lv_attr", "Various attributes - see man page.") 6386d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "Maj", major, 3, int32, "lv_major", "Persistent major number or -1 if not persistent.") 6486d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "Min", minor, 3, int32, "lv_minor", "Persistent minor number or -1 if not persistent.") 6586d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "Rahead", lvid, 6, lvreadahead, "lv_read_ahead", "Read ahead setting in current units.") 6686d7f5d3SJohn Marino FIELD(LVS, lv, STR, "KMaj", lvid, 4, lvkmaj, "lv_kernel_major", "Currently assigned major number or -1 if LV is not active.") 6786d7f5d3SJohn Marino FIELD(LVS, lv, STR, "KMin", lvid, 4, lvkmin, "lv_kernel_minor", "Currently assigned minor number or -1 if LV is not active.") 6886d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "KRahead", lvid, 7, lvkreadahead, "lv_kernel_read_ahead", "Currently-in-use read ahead setting in current units.") 6986d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "LSize", size, 5, size64, "lv_size", "Size of LV in current units.") 7086d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "#Seg", lvid, 4, lvsegcount, "seg_count", "Number of segments in LV.") 7186d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Origin", lvid, 6, origin, "origin", "For snapshots, the origin device of this LV.") 7286d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "OSize", lvid, 5, originsize, "origin_size", "For snapshots, the size of the origin device of this LV.") 7386d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "Snap%", lvid, 6, snpercent, "snap_percent", "For snapshots, the percentage full if LV is active.") 7486d7f5d3SJohn Marino FIELD(LVS, lv, NUM, "Copy%", lvid, 6, copypercent, "copy_percent", "For mirrors and pvmove, current percentage in-sync.") 7586d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Move", lvid, 4, movepv, "move_pv", "For pvmove, Source PV of temporary LV created by pvmove.") 7686d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Convert", lvid, 7, convertlv, "convert_lv", "For lvconvert, Name of temporary LV created by lvconvert.") 7786d7f5d3SJohn Marino FIELD(LVS, lv, STR, "LV Tags", tags, 7, tags, "lv_tags", "Tags, if any.") 7886d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Log", lvid, 3, loglv, "mirror_log", "For mirrors, the LV holding the synchronisation log.") 7986d7f5d3SJohn Marino FIELD(LVS, lv, STR, "Modules", lvid, 7, modules, "modules", "Kernel device-mapper modules required for this LV.") 8086d7f5d3SJohn Marino 8186d7f5d3SJohn Marino FIELD(LABEL, pv, STR, "Fmt", id, 3, pvfmt, "pv_fmt", "Type of metadata.") 8286d7f5d3SJohn Marino FIELD(LABEL, pv, STR, "PV UUID", id, 38, uuid, "pv_uuid", "Unique identifier.") 8386d7f5d3SJohn Marino FIELD(LABEL, pv, NUM, "DevSize", dev, 7, devsize, "dev_size", "Size of underlying device in current units.") 8486d7f5d3SJohn Marino FIELD(LABEL, pv, STR, "PV", dev, 10, dev_name, "pv_name", "Name.") 8586d7f5d3SJohn Marino FIELD(LABEL, pv, NUM, "PMdaFree", id, 9, pvmdafree, "pv_mda_free", "Free metadata area space on this device in current units.") 8686d7f5d3SJohn Marino FIELD(LABEL, pv, NUM, "PMdaSize", id, 9, pvmdasize, "pv_mda_size", "Size of smallest metadata area on this device in current units.") 8786d7f5d3SJohn Marino 8886d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "1st PE", pe_start, 7, size64, "pe_start", "Offset to the start of data on the underlying device.") 8986d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "PSize", id, 5, pvsize, "pv_size", "Size of PV in current units.") 9086d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "PFree", id, 5, pvfree, "pv_free", "Total amount of unallocated space in current units.") 9186d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "Used", id, 4, pvused, "pv_used", "Total amount of allocated space in current units.") 9286d7f5d3SJohn Marino FIELD(PVS, pv, STR, "Attr", status, 4, pvstatus, "pv_attr", "Various attributes - see man page.") 9386d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "PE", pe_count, 3, uint32, "pv_pe_count", "Total number of Physical Extents.") 9486d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "Alloc", pe_alloc_count, 5, uint32, "pv_pe_alloc_count", "Total number of allocated Physical Extents.") 9586d7f5d3SJohn Marino FIELD(PVS, pv, STR, "PV Tags", tags, 7, tags, "pv_tags", "Tags, if any.") 9686d7f5d3SJohn Marino FIELD(PVS, pv, NUM, "#PMda", id, 5, pvmdas, "pv_mda_count", "Number of metadata areas on this device.") 9786d7f5d3SJohn Marino 9886d7f5d3SJohn Marino FIELD(VGS, vg, STR, "Fmt", cmd, 3, vgfmt, "vg_fmt", "Type of metadata.") 9986d7f5d3SJohn Marino FIELD(VGS, vg, STR, "VG UUID", id, 38, uuid, "vg_uuid", "Unique identifier.") 10086d7f5d3SJohn Marino FIELD(VGS, vg, STR, "VG", name, 4, string, "vg_name", "Name.") 10186d7f5d3SJohn Marino FIELD(VGS, vg, STR, "Attr", cmd, 5, vgstatus, "vg_attr", "Various attributes - see man page.") 10286d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "VSize", cmd, 5, vgsize, "vg_size", "Total size of VG in current units.") 10386d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "VFree", cmd, 5, vgfree, "vg_free", "Total amount of free space in current units.") 10486d7f5d3SJohn Marino FIELD(VGS, vg, STR, "SYS ID", system_id, 6, string, "vg_sysid", "System ID indicating when and where it was created.") 10586d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "Ext", extent_size, 3, size32, "vg_extent_size", "Size of Physical Extents in current units.") 10686d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "#Ext", extent_count, 4, uint32, "vg_extent_count", "Total number of Physical Extents.") 10786d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "Free", free_count, 4, uint32, "vg_free_count", "Total number of unallocated Physical Extents.") 10886d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "MaxLV", max_lv, 5, uint32, "max_lv", "Maximum number of LVs allowed in VG or 0 if unlimited.") 10986d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "MaxPV", max_pv, 5, uint32, "max_pv", "Maximum number of PVs allowed in VG or 0 if unlimited.") 11086d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "#PV", pv_count, 3, uint32, "pv_count", "Number of PVs.") 11186d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "#LV", cmd, 3, lvcount, "lv_count", "Number of LVs.") 11286d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "#SN", cmd, 3, snapcount, "snap_count", "Number of snapshots.") 11386d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "Seq", seqno, 3, uint32, "vg_seqno", "Revision number of internal metadata. Incremented whenever it changes.") 11486d7f5d3SJohn Marino FIELD(VGS, vg, STR, "VG Tags", tags, 7, tags, "vg_tags", "Tags, if any.") 11586d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "#VMda", cmd, 5, vgmdas, "vg_mda_count", "Number of metadata areas in use by this VG.") 11686d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "VMdaFree", cmd, 9, vgmdafree, "vg_mda_free", "Free metadata area space for this VG in current units.") 11786d7f5d3SJohn Marino FIELD(VGS, vg, NUM, "VMdaSize", cmd, 9, vgmdasize, "vg_mda_size", "Size of smallest metadata area for this VG in current units.") 11886d7f5d3SJohn Marino 11986d7f5d3SJohn Marino FIELD(SEGS, seg, STR, "Type", list, 4, segtype, "segtype", "Type of LV segment.") 12086d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "#Str", area_count, 4, uint32, "stripes", "Number of stripes or mirror legs.") 12186d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Stripe", stripe_size, 6, size32, "stripesize", "For stripes, amount of data placed on one device before switching to the next.") 12286d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Stripe", stripe_size, 6, size32, "stripe_size", "For stripes, amount of data placed on one device before switching to the next.") 12386d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Region", region_size, 6, size32, "regionsize", "For mirrors, the unit of data copied when synchronising devices.") 12486d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Region", region_size, 6, size32, "region_size", "For mirrors, the unit of data copied when synchronising devices.") 12586d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, "chunksize", "For snapshots, the unit of data used when tracking changes.") 12686d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, "chunk_size", "For snapshots, the unit of data used when tracking changes.") 12786d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Start", list, 5, segstart, "seg_start", "Offset within the LV to the start of the segment in current units.") 12886d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "Start", list, 5, segstartpe, "seg_start_pe", "Offset within the LV to the start of the segment in physical extents.") 12986d7f5d3SJohn Marino FIELD(SEGS, seg, NUM, "SSize", list, 5, segsize, "seg_size", "Size of segment in current units.") 13086d7f5d3SJohn Marino FIELD(SEGS, seg, STR, "Seg Tags", tags, 8, tags, "seg_tags", "Tags, if any.") 13186d7f5d3SJohn Marino FIELD(SEGS, seg, STR, "PE Ranges", list, 9, peranges, "seg_pe_ranges", "Ranges of Physical Extents of underlying devices in command line format.") 13286d7f5d3SJohn Marino FIELD(SEGS, seg, STR, "Devices", list, 7, devices, "devices", "Underlying devices used with starting extent numbers.") 13386d7f5d3SJohn Marino 13486d7f5d3SJohn Marino FIELD(PVSEGS, pvseg, NUM, "Start", pe, 5, uint32, "pvseg_start", "Physical Extent number of start of segment.") 13586d7f5d3SJohn Marino FIELD(PVSEGS, pvseg, NUM, "SSize", len, 5, uint32, "pvseg_size", "Number of extents in segment.") 13686d7f5d3SJohn Marino /* *INDENT-ON* */ 137