1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-28 11:22:15 +03:00
Commit Graph

120 Commits

Author SHA1 Message Date
Mike Snitzer
cad03afc54 Add snapshot merge wrappers to abstract the associations and flags used
to represent merging origin and snapshot volumes.
2010-01-13 01:55:43 +00:00
Mike Snitzer
dfe517cfbe Merge on activate support.
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.
2010-01-13 01:54:34 +00:00
Mike Snitzer
77f030956c When there is merging snapshot, report percentage on the origin LV.
Because the snapshot LV will be hidden this is needed so the user can
see merging progress with "lvs" command.
2010-01-13 01:49:22 +00:00
Mike Snitzer
ab7ad3451d Report merging snapshot as 'S' instead of 's':
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.
2010-01-13 01:48:38 +00:00
zkabelac
d098e4def6 Use offsetof() macro and avoid defining dummy static union for FIELD() macro.
Makes it compilable by clang compiler.
2010-01-07 14:37:11 +00:00
Dave Wysochanski
0350c4f0f6 Add vg_mda_count library function. 2009-10-31 17:26:13 +00:00
Alasdair Kergon
2d1118a26f Permit snapshots of mirrors. (brassow) 2009-10-26 10:01:56 +00:00
Alasdair Kergon
6e619f8927 Add percent_range to copy_percent too. 2009-10-01 01:04:27 +00:00
Alasdair Kergon
2ccdb165e3 Introduce percent_range_t and centralise snapshot full/mirror in-sync checks. 2009-10-01 00:35:29 +00:00
Dave Wysochanski
62d8848bee Add vg_is_resizeable() and cleanup references.
Clean up VG_RESIZEABLE flag by creating vg_is_resizeable().
Update comment - we no longer have ALLOW_RESIZEABLE.
Also use vg_is_exported() in one place missed by earlier patch.
Should be no functional change.
2009-09-15 18:35:13 +00:00
Dave Wysochanski
1b3f8a4c18 Use vg_is_exported(vg) macro everywhere.
This patch is all just cleanup and no other patch depends on it.
Replace explicit dereference and check with vg_is_exported().
Update a few copyrights and remove unnecessary whitespace.
Should be no functional change.
2009-09-14 19:44:15 +00:00
Dave Wysochanski
5d4fd6055e Refactor a few report field calculations into separate functions.
For liblvm 'get' functions, we should share code with the reporting functions.
This means we need common code to return the values for the fields.
In this patch we refactor a few of the fields needed in liblvm.
Unfortunately, for the simple fields that do derefernces of structure
members (for example, vg_extent_count), we cannot call the common function
from the reporting infrastructure without more refactoring.  The reason is
that the dereference of the simple fields is done deep inside the reporting
code (to get the generic "data" pointer), and the display function is a
generic 'size32' function.  We can fix these issues later with more
refactoring.

Should be no functional change and the testsuite should cover any possible
regressions.  The only fields in the report affected by this patch are:
vg_size, vg_free, and pv_mda_count.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 12:41:09 +00:00
Alasdair Kergon
965c7e1200 Pre-release cleanups. 2009-05-21 03:04:52 +00:00
Milan Broz
c94f02648c Merge lv_is_displayable and lv_is_visible.
Displayable and visible is the same thing.

volumes_count(vg) is now vg_visible_lvs() and always
returns number of LVs from user perspective.
2009-05-13 21:27:43 +00:00
Milan Broz
8b65ad0237 Remove snapshot_count from VG and use function instead. 2009-05-12 19:12:09 +00:00
Dave Wysochanski
7120f7df54 Update columns.h comment. 2009-05-06 15:25:23 +00:00
Alasdair Kergon
174f5a3a49 Add sparse devices: lvcreate -s --virtualoriginsize (hidden zero origin).
Add lvs origin_size field.
Fix linux configure --enable-debug to exclude -O2.

Still a few rough edges, but hopefully usable now:
  lvcreate -s vg1 -L 100M --virtualoriginsize 1T
2009-04-25 01:17:59 +00:00
Dave Wysochanski
94084178d9 Update columns.h comment to describe macro args. 2009-04-23 16:27:58 +00:00
Milan Broz
459a5a5b1f Fix pvs -a for segmented output
# pvs -a -o devices
   Volume group name (null) has invalid characters
   Skipping volume group (null)

...
_pvsegs_sub_single creates fake vg, we need to check
that pv is real here.
2009-04-21 12:57:31 +00:00
Milan Broz
d0b99cb260 pe_start can be overwritten in VG metadata, so it is not PV label-only field. 2009-02-25 23:31:06 +00:00
Milan Broz
d0143d6f3e Separate PV label attributes which do not need parse metadata when reporting.
When reporting explicitly label attributes (pv_uuid for example), we do not
need to read metadata.

This patch separate the label fileds and removes scan_vgs_for_pvs
in process_each_pv() if not needed.

(There should be no user visible change in output.)
2009-02-09 09:45:49 +00:00
Milan Broz
81de913b77 Fix pvs segfault when pv mda attributes requested for not available PV. 2009-02-06 12:41:51 +00:00
Alasdair Kergon
4b45c6e35a More fields can cause segfaults with orphans.
Fix these by populating the dummy VG struct more completely.
2009-01-10 17:09:40 +00:00
Dave Wysochanski
7f831c1f4d Fix pvs segfault when run with orphan PV and vg_mda_size or vg_mda_free fields
We display '0' for these fields now in this case.  Ideally these values are
undefined for an orphan PV but today there is no way to specify undefined
with display functions such as _size64_disp().
2009-01-10 15:04:28 +00:00
Dave Wysochanski
b237d68c47 Add pv_mda_size to 'pvs' and vg_mda_size to 'vgs'.
Reports the size of the smallest metadata area in a PV or a VG.
Useful to confirm pvcreate --metadatasize or pvmetadatasize setting in
/etc/lvm/lvm.conf file.

NOTE: Actual value in these fields will most always differ from that
given in pvcreate options due to rounding and alignment effects.
2009-01-09 22:44:33 +00:00
Dave Wysochanski
5b655dd4cd Fix segfault when invalid field given in reporting commands.
Problem is dm_report_init() may return NULL and subsequent call to
dm_report_set_output_field_name_prefix() doesn't handle NULL value.

Example:
	pvs --nameprefixes --rows --unquoted --noheadings -opv_name,fred
  Logical Volume Fields
  ---------------------
    lv_uuid              - Unique identifier
    lv_name              - Name.  LVs created for internal use are enclosed in brackets.
 ...

  Physical Volume Segment Fields
  ------------------------------
    pvseg_start          - Physical Extent number of start of segment.
    pvseg_size           - Number of extents in segment.

  Unrecognised field: fred
Segmentation fault
2008-12-15 13:30:45 +00:00
prajnoha
481618826d Added displayable_lvs_in_vg and lv_is_displayable functions to deal with
the counts of visible LVs from user's perspective consistently throughout
the code.
2008-12-04 15:54:26 +00:00
Alasdair Kergon
a2bfad1c29 Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
Alasdair Kergon
95d43e17b3 Improve the way VGs with PVs missing are handled so manual intervention
is required in fewer circumstances.  (mornfall)
2008-09-19 06:42:00 +00:00
Alasdair Kergon
a7fabfd8cb Fix reporting of LV fields alongside unallocated PV segments. 2008-06-25 16:52:27 +00:00
Alasdair Kergon
507ece15a5 Add --rows to reports. 2008-06-24 22:48:53 +00:00
Alasdair Kergon
30be4d1613 Add --unquoted to reporting tools. 2008-06-24 21:21:04 +00:00
Alasdair Kergon
6a336dfc69 post-release 2008-06-06 19:28:35 +00:00
Alasdair Kergon
af40fdb285 back out unnecessary changes for this release 2008-06-06 17:36:19 +00:00
Alasdair Kergon
57244a6823 post-release - reinstate incomplete enhancements 2008-04-29 16:11:28 +00:00
Alasdair Kergon
8bdde01bef pre-release (bug fixes only - enhancements excluded) 2008-04-29 15:58:25 +00:00
Alasdair Kergon
43761fed2a Add --prefixes to reporting tools for field name prefix output format.
E.g. lvs --prefixes --noheadings --unbuffered --units m --nosuffix

(Used '--prefixes' for now, but I'm looking for a better name.)
2008-04-20 00:15:08 +00:00
Alasdair Kergon
10bf8fd2cd Fix vgdisplay 'Cur LV' field to match lvdisplay output.
Fix lv_count report field to exclude hidden LVs.
2008-04-10 17:19:02 +00:00
Dave Wysochanski
57cb22ff3c Add vg_is_clustered() helper function.
Should be no functional change.
2008-04-10 17:09:32 +00:00
Alasdair Kergon
71b3b1ff4c split orphan VG by format type 2008-02-06 15:47:28 +00:00
Alasdair Kergon
2b83c80593 Fix mirror log name construction during lvconvert. (2.02.30)
Make monitor_dev_for_events recurse through the stack of LVs.
Clean up some more compiler warnings.
Add mirror names test script.
2008-01-31 12:19:36 +00:00
Alasdair Kergon
1ddd4509dc Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
Alasdair Kergon
6af3f4f4cf Use stack return macros throughout. 2008-01-30 13:19:47 +00:00
Alasdair Kergon
6726c5f958 Rely upon internally-cached PV labels while corresponding VG lock is held. 2008-01-29 23:45:48 +00:00
Alasdair Kergon
4ada7cffd0 Maintain lists of stacked LV segments using each LV. 2008-01-16 19:00:59 +00:00
Alasdair Kergon
06b103c8d4 Various lvconvert/polldaemon-related fixes from NEC. See lvm-devel
for original patches & explanations.
2008-01-10 18:35:51 +00:00
Alasdair Kergon
4b0950aba5 a few more changes/fixes to recent code 2007-12-22 02:13:00 +00:00
Alasdair Kergon
7af977d36b avoid some compiler warnings 2007-12-20 16:49:37 +00:00
Alasdair Kergon
09091c5cf8 Append fields to report/pvsegs_cols_verbose.
Permit LV segment fields with PV segment reports.
  Add seg_start_pe and seg_pe_ranges to reports.
2007-12-14 21:53:02 +00:00
Alasdair Kergon
2e379cb8a5 Accept sizes with --readahead argument.
Store size arguments as sectors internally.
2007-11-14 00:08:25 +00:00