Zdenek Kabelac
8e1f2e733e
gcc: fix comparing floating point warning
...
Since we enabled some more gcc warnings - let's adapt for
it and check for double equals with DBL_EPSILON.
Current close_enough() is far from perfect
for more details see i.e. here:
http://randomascii.wordpress.com/2012/01/11/tricks-with-the-floating-point-format/
but fairly enough for lvm2 use-case.
2013-10-25 10:43:32 +02:00
Alasdair G Kergon
357df34133
display: fix units for sizes <1k
2013-07-18 17:55:58 +01:00
Zdenek Kabelac
9ba7783350
cleanup: update comments
...
Add and indent.
2013-07-15 15:40:46 +02:00
Mike Snitzer
f9e0adcce5
snapshot: Rename snapshot segment returning methods from find_*_cow to find_*_snapshot
...
find_cow -> find_snapshot, find_merging_cow -> find_merging_snapshot.
Will thin snapshot code to reuse these methods without confusion.
2013-07-02 16:26:03 -04:00
Peter Rajnoha
d6a91da4be
config: add profile arg to find_config_tree_bool
2013-07-02 15:19:09 +02:00
Zdenek Kabelac
78a42bac15
thin: fix cut&paste bug
...
Use proper external_lv.
(In release fix)
2013-04-21 23:07:00 +02:00
Peter Rajnoha
386886f71c
config: refer to config nodes using assigned IDs
...
For example, the old call and reference:
find_config_tree_str(cmd, "devices/dir", DEFAULT_DEV_DIR)
...now becomes:
find_config_tree_str(cmd, devices_dir_CFG)
So we're referring to the named configuration ID instead
of passing the configuration path and the default value
is taken from central config definition in config_settings.h
automatically.
2013-03-06 10:14:33 +01:00
Zdenek Kabelac
30c13eff37
thin: report external origin
...
Use the field 'origin' for reporting external origin lv name.
For thin volumes with external origin, report the size of
external origin size via:
lvs -o+origin_size
2013-02-23 10:37:01 +01:00
Alasdair G Kergon
3acc85caa8
buffering: use unbuffered silent mode for liblvm
...
Disable private buffering when using liblvm.
When private stdin/stdout buffering is not used always use silent
mode.
2012-08-26 00:15:45 +01:00
Alasdair G Kergon
438e0050df
config: add silent mode
...
Accept -q as the short form of --quiet.
Suppress non-essential standard output if -q is given twice.
Treat log/silent in lvm.conf as equivalent to -qq.
Review all log_print messages and change some to
log_print_unless_silent.
When silent, the following commands still produce output:
dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay,
pvs, version, vgcfgrestore -l, vgdisplay, vgs.
[Needs checking.]
Non-essential messages are shifted from log level 4 to log level 5
for syslog and lvm2_log_fn purposes.
2012-08-25 20:35:48 +01:00
Zdenek Kabelac
172c87f7ca
Never try to test character past given buffer
...
In case units[0] would be already '\0', do not check units[1].
2012-02-13 14:23:40 +00:00
Alasdair Kergon
a1991f101d
pre-release
2012-01-26 14:02:42 +00:00
Alasdair Kergon
a2167d2d1d
& -> &&
2012-01-25 17:14:56 +00:00
Alasdair Kergon
46c67b5279
Use chunk_size consistently for thin_pool within LVM.
2012-01-24 00:55:03 +00:00
Zdenek Kabelac
c54998209d
Update lvdisplay to show more info about thin LVs
...
Reformat name and path how the LV is represented with lvm1 compatible option,
to switch to the old way - which had number of problem - i.e. many links
do not exist - since for private devices we are not creating them.
Add more info about thin pools and volumes.
2012-01-20 16:59:58 +00:00
Zdenek Kabelac
d8106dfee2
Thin rename seg var pool_metadata_lv to metadata_lv
...
Better fits the code.
2012-01-19 15:23:50 +00:00
Alasdair Kergon
8f95d94b4f
Show read-only activation in display tools.
2012-01-12 16:58:43 +00:00
Alasdair Kergon
c122e5e7a3
Move y/n prompts to stderr and repeat if response has both 'n' and 'y'.
...
(Note that in a future release we might make this stricter and insist
on exactly 'y' or 'n'.)
2011-11-23 01:34:38 +00:00
Zdenek Kabelac
c0b9c64a77
Use capital letters
2011-10-04 12:39:59 +00:00
Zdenek Kabelac
97bde15a9f
Display transaction_id for thin_pool
2011-10-03 18:31:03 +00:00
Alasdair Kergon
d71fd30e5d
typo
2011-09-27 12:34:14 +00:00
Zdenek Kabelac
1d526c8585
Show some Thin related info in lvdisplay
2011-09-26 13:11:02 +00:00
Milan Broz
cbedb99e4c
Fix some compile warnings on RHEL5
...
- returned char not needed to be explicitly const
- warn if pipe() fails in clvmd (more fixes here needed for error paths...)
- assign (and ignore) read() output in drain buffer
2011-03-01 20:17:56 +00:00
Alasdair Kergon
a8d13f9499
Handle decimal digits with --units instead of ignoring them silently.
...
Fix remaining warnings and compile with -Wpointer-arith.
2011-02-18 23:09:55 +00:00
Petr Rockai
8191fe4f4a
Refactor the percent (mirror sync, snapshot usage) handling code to use
...
fixed-point values instead of a combination of a float value and an enum.
2010-11-30 11:53:31 +00:00
Alasdair Kergon
eb82bd0525
Extend cling allocation policy to recognise PV tags (cling_by_tags).
...
Add allocation/cling_tag_list to lvm.conf.
2010-11-09 12:34:40 +00:00
Alasdair Kergon
2aa06d73ca
pre-release
2010-10-25 13:54:29 +00:00
Alasdair Kergon
2d6fcbf67d
Allow internal suspend and resume of origin without its snapshots.
2010-08-17 16:25:32 +00:00
Alasdair Kergon
08f1ddea6c
Use __attribute__ consistently throughout.
2010-07-09 15:34:40 +00:00
Alasdair Kergon
db3c1ac1c8
Add printf format attributes to yes_no_prompt & dm_{sn,as}printf and fix a calle
2010-07-02 21:16:50 +00:00
Dave Wysochanski
6b596f685f
Use vg_mda_count() in vgdisplay.
...
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-06-28 20:32:21 +00:00
Zdenek Kabelac
b1ebf028de
Cleanup returns for void functions.
2009-12-11 13:16:37 +00:00
Mike Snitzer
a2552d4f59
Switch status from 32-bit to 64-bit
...
The physical_volume, volume_group, logical_volume and lv_segment
structures' 'status' member is now uint64_t.
The alignment of these structures was also audited to remove holes. The
movement of some members in 'volume_group' and 'lv_segment' eliminates
holes. The 'physical_volume' structure still has one 4-byte hole after
'pe_size'; the other structures no longer have any holes. Each
structures' size has not changed.
2009-11-24 22:55:55 +00:00
Zdenek Kabelac
61c146fb97
Add fflush for the case the log is redirected to the buffered file.
...
Without this patch it have not been obvious, why the application
waits on the stdin as the prompt might be still buffered in memory.
2009-11-03 10:50:57 +00:00
Alasdair Kergon
984abde146
Permit snapshots of mirrors. (brassow)
2009-10-26 10:01:56 +00:00
Alasdair Kergon
78ad1549a5
Introduce percent_range_t and centralise snapshot full/mirror in-sync checks.
2009-10-01 00:35:29 +00:00
Alasdair Kergon
8e4858ccd1
Distinguish between powers of 1000 and powers of 1024 in unit suffixes.
2009-09-30 14:19:00 +00:00
Alasdair Kergon
673ecf73cf
Treat input units of both 's' and 'S' as 512-byte sectors. (2.02.49)
...
's' and 'S' are special suffixes representing sectors and are always 512 bytes,
regardless of whether you're using powers of 1000 or 1024.
2009-09-28 16:36:03 +00:00
Alasdair Kergon
95eaa68309
Add global/si_unit_consistency to enable cleaned-up use of units in output.
...
Add configure --enable-units-compat to set si_unit_consistency off by default.
Use standard output units for 'PE Size' and 'Stripe size' in pv/lvdisplay.
2009-09-28 16:23:44 +00:00
Dave Wysochanski
68fac97a07
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
905240f91d
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
c8fb043a01
Update display.c to use vg_free(vg) instead of duplicating the calculation.
...
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-27 10:18:31 +00:00
Mike Snitzer
3d425215a8
Continue to make --units and --size consistent (in code and man pages):
...
Update units_to_bytes() to support (S)ectors: 500 bytes.
- 500 byte (S)ectors is of questionable value but it adds to consistency
if a user happens to use --units S. This seems better than an error.
Updated test/t-covercmd.sh to test --units [hS]
Document the units that can be displayed via --units uniformly.
- (p)etabytes and (e)xabytes were missing in pvs, vgs and lvs man pages.
Made lvreduce man page "... in units of megabytes." consistent (with the
lvextend and lvresize man pages).
2009-07-07 19:28:57 +00:00
Milan Broz
afd9ba98c1
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
Peter Rajnoha
b47952641a
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
89ef434fe0
Fix uninitialised lv_count in vgdisplay -c
2008-12-01 17:38:35 +00:00
Alasdair Kergon
2c44337bd5
Right, a simple build (without options) is working again.
2008-11-03 22:14:30 +00:00
Alasdair Kergon
3e5b6ed214
more tweaking to get things to compile - dmlib.h for log fns, list.h
2008-11-03 18:59:59 +00:00
Alasdair Kergon
8c5bcdabab
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
Zdenek Kabelac
1e9b55801e
added const modifiers
...
switched const char* to const char[] elements to save few relocation entries
2008-08-07 14:01:17 +00:00
Alasdair Kergon
3af1fa76eb
fix 3rd copy
2008-04-10 19:16:35 +00:00
Alasdair Kergon
2e050bfc36
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
985ca02b6a
Add vg_is_clustered() helper function.
...
Should be no functional change.
2008-04-10 17:09:32 +00:00
Dave Wysochanski
052bbfba3a
Add pvseg_is_allocated() for identifying a PV segment allocated to a LV.
2008-03-26 16:48:10 +00:00
Alasdair Kergon
bb097a97ea
split orphan VG by format type
2008-02-06 15:47:28 +00:00
Alasdair Kergon
67cdbd7e4d
Some whitespace tidy-ups.
2008-01-30 14:00:02 +00:00
Alasdair Kergon
c51b9fff19
Use stack return macros throughout.
2008-01-30 13:19:47 +00:00
Alasdair Kergon
a6b22cf317
readahead activation code (but no dm support yet)
2007-11-12 20:51:54 +00:00
Alasdair Kergon
40ec927b3f
attempt to fix human-readable unit output when number of sectors is odd
2007-11-05 17:13:54 +00:00
Alasdair Kergon
1f2ed21dde
adjust sizes for metadata
2007-11-05 02:10:39 +00:00
Alasdair Kergon
fd4ff5d201
Show 'not usable' space when PV is too large for device in pvdisplay.
...
Ignore and fix up any excessive device size found in metadata.
2007-11-05 01:47:49 +00:00
Dave Wysochanski
1b8de4cb25
Add pv_dev_name() to access PV device name.
...
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:29:32 +00:00
Alasdair Kergon
be6845999b
Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.
2007-08-20 20:55:30 +00:00
Dave Wysochanski
cc78b9800d
Move lv_remove_single() into library (lv_manip.c, metadata-exported.h).
...
Move yes_no_prompt() into library (display.c, display.h).
Fixup includes as a result of movement of prior two functions.
Fixup force_t enum to be more descriptive.
2007-08-20 17:04:53 +00:00
Jim Meyering
08c9ff434b
Add "const" attributes where possible: first cut.
2007-08-07 09:06:05 +00:00
Alasdair Kergon
03eee0e2ed
Split metadata-external.h out from metadata.h for the tools to use.
2007-07-18 15:38:58 +00:00
Dave Wysochanski
13209bad59
Fix pvdisplay --maps to not display segment header for orphan PVs.
2007-05-31 20:26:11 +00:00
Dave Wysochanski
3008bc4432
Fix redundant segment display when PV is given to 'pvdisplay --maps' cmdline.
2007-05-31 20:10:25 +00:00
Dave Wysochanski
dda1e6c983
Remove 'Type' from pvdisplay --maps as there is no 'Type' of a physical segment, only logical segments
2007-05-31 15:18:44 +00:00
Dave Wysochanski
5a4ba89aad
Small fixes to pvdisplay --maps: 1) rename struct pv_segment vars from 'seg' to 'pvseg', 2) Change heading
2007-05-31 14:19:57 +00:00
Dave Wysochanski
4baa42be1c
Add --maps to pvdisplay.
...
Modified original patch from David Robinson <zxvdr.au@gmail.com>.
2007-05-30 20:43:09 +00:00
Alasdair Kergon
4dc0ec2253
Adjust some alignments for ia64 and sparc.
...
(Some of the changes are probably unnecessary.)
2006-11-30 23:11:42 +00:00
Alasdair Kergon
a89d601463
Add some missing bounds checks on 32 bit extent counters.
...
Add Petabyte and Exabyte support.
Fix lvcreate error message when 0 extents requested.
2006-11-10 18:24:11 +00:00
Alasdair Kergon
de5c82a0d9
add cling allocation policy
2006-10-08 12:01:13 +00:00
Alasdair Kergon
72b2cb613a
Make SIZE_SHORT the default for display_size().
...
Fix some memory leaks in error paths found by coverity.
Use C99 struct initialisers.
Move DEFS into configure.h.
Clean-ups to remove miscellaneous compiler warnings.
2006-05-09 21:23:51 +00:00
Alasdair Kergon
f894b4b1b7
Attempt to load missing targets using modprobe.
...
Simplify dev_manager_info().
2005-10-17 18:00:02 +00:00
Alasdair Kergon
2262b32057
Use hash, bitset, malloc, pool from libdevmapper.
2005-10-16 23:03:59 +00:00
Alasdair Kergon
5e947dac48
Various allocation-related pvmove fixes.
2005-06-14 17:54:48 +00:00
Alasdair Kergon
60f13f01d2
Basic support for mirrors.
2005-06-01 16:51:55 +00:00
Alasdair Kergon
15db9fcfbf
Reinstate full PV size when removing from VG.
...
Support loopfiles for testing.
Complete the pv_segment support.
2005-05-03 17:28:23 +00:00
Alasdair Kergon
072893aabd
Internal snapshot code restructuring.
2005-04-07 12:39:44 +00:00
Alasdair Kergon
274c88be9f
More 64-bit display/report fixes.
2005-02-01 16:19:48 +00:00
Alasdair Kergon
e9c761b869
Only ask libdevmapper for open_count when we need it.
2005-01-12 22:58:21 +00:00
Alasdair Kergon
c4ddb31abf
Rename old segtypes files to segtype.
2004-09-16 18:40:56 +00:00
Alasdair Kergon
156dd4f1ec
New commands 'segtypes' and 'formats'.
2004-09-14 16:42:46 +00:00
Alasdair Kergon
30bab85be1
Fix rounding of large displayed sizes.
2004-06-07 15:22:43 +00:00
Alasdair Kergon
7d36b514d8
Suppress decimal point when using units of sectors/bytes.
2004-05-28 12:47:57 +00:00
Alasdair Kergon
a0a23eff4b
Rename allocation policies; add --alloc to cmdline; LV inherits from VG.
2004-05-18 22:12:53 +00:00
Alasdair Kergon
4922197a33
Begin to separate out segment types.
2004-05-04 21:25:57 +00:00
Alasdair Kergon
6606c3ae81
Update copyright notices.
2004-03-30 19:35:44 +00:00
Alasdair Kergon
6dee988083
vgdisplay_colons
2004-03-30 14:35:40 +00:00
Alasdair Kergon
a12c4af876
Fix inactive snapshot display.
2003-07-11 17:09:21 +00:00
Alasdair Kergon
914c97239f
Another sync point - numerous fixes & clean ups.
2003-07-04 22:34:56 +00:00
Alasdair Kergon
9d6e5a6387
mirror display type
2003-04-30 15:21:43 +00:00
Alasdair Kergon
b8c919b402
o Metadata area struct change.
...
o Support physical extent restrictions on PV lists for allocations
e.g. lvcreate -l 200 vg1 /dev/sda1:100-199:300-399
2003-04-24 22:23:24 +00:00
Alasdair Kergon
27f364af95
Allow for specification of major number as well as minor.
2003-04-02 19:14:43 +00:00
Alasdair Kergon
34e0f798e3
size_t tidying
2003-04-02 19:11:23 +00:00
Alasdair Kergon
26e7f2e0c4
Tidy various pre-processing incl. making libdl optional.
2003-03-24 18:08:53 +00:00
Alasdair Kergon
199e490e7d
configure --disable-devmapper if you don't have libdevmapper
2003-01-08 22:44:07 +00:00
Alasdair Kergon
8ef2b021ed
Default stripesize 64k & config file setting for it;
...
Clear many compiler warnings (i386) & associated bugs - hopefully without
introducing too many new bugs:-) (Same exercise required for other archs.)
Default compilation has optimisation - or else use ./configure --enable-debug
2002-12-19 23:25:55 +00:00