Dave Wysochanski
fc0ec1e71e
Use list_move() in applicable places.
2008-03-26 17:26:32 +00:00
Dave Wysochanski
fb2f92df1d
Add pvseg_is_allocated() for identifying a PV segment allocated to a LV.
2008-03-26 16:48:10 +00:00
Dave Wysochanski
74adbb77b7
Add list_move() support function for list manipulation.
2008-03-26 16:20:54 +00:00
Alasdair Kergon
9feaeb28ca
preparation for vg cache
2008-03-17 16:51:31 +00:00
Dave Wysochanski
99c5da5da5
Const cleanups in find_* functions.
2008-03-13 22:51:24 +00:00
Alasdair Kergon
22c957bc20
Refactor text format initialisation into _init_text_import.
2008-03-13 12:33:22 +00:00
Alasdair Kergon
a109ce1eca
Escape double quotes and backslashes in external metadata and config data.
...
Add functions for escaping double quotes in strings.
Rename count_chars_len to count_chars.
2008-03-12 16:03:22 +00:00
Alasdair Kergon
e581a78d65
Use return_0 in a couple more places.
...
Correct a function name typo in _line_append error message.
2008-03-10 18:51:27 +00:00
Alasdair Kergon
bd606943e6
add vd to filters
2008-03-05 18:15:04 +00:00
Alasdair Kergon
2a91d87074
Fix resetting of MIRROR_IMAGE and VISIBLE_LV after removal of LV.
2008-02-22 13:28:29 +00:00
Alasdair Kergon
4a23617d79
Fix remove_layer_from_lv to empty the LV before removing it. (2.02.30)
2008-02-22 13:22:44 +00:00
Alasdair Kergon
0e2ceed74d
Add missing no-longer-used segs_using_this_lv test to check_lv_segments.
2008-02-22 13:22:21 +00:00
Jim Meyering
bf98943cbb
is_orphan: make parameter "const" to avoid compiler warning
2008-02-13 20:01:48 +00:00
Alasdair Kergon
71b3b1ff4c
split orphan VG by format type
2008-02-06 15:47:28 +00:00
Alasdair Kergon
dd53f2dc83
a couple more compiler warnings
2008-01-31 12:35:31 +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
6930f60c06
only read labels once between each lock event
2008-01-30 16:18:37 +00:00
Alasdair Kergon
376b76e75c
undo a few 'stack' moves
2008-01-30 14:17:29 +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
617a599ee9
Fix two check_lv_segments error messages to show whole segment.
2008-01-26 00:30:28 +00:00
Alasdair Kergon
ad2e7218cb
Refactor mirror log attachment code.
2008-01-26 00:25:04 +00:00
Alasdair Kergon
b595ee1c0b
suppress compiler warning
2008-01-22 16:02:26 +00:00
Dave Wysochanski
71d609895a
Fix vgsplit - print error if vgcreate option given w/existing vg destination
...
Fix vgsplit - reject split if metadata types or clustered attributes differ
Fix vgsplit - remove physicalextentsize option
Add vgsplit test cases
2008-01-22 02:48:53 +00:00
Alasdair Kergon
94563b6017
Fix lvcreate --nosync not to wait for non-happening sync.
2008-01-18 22:02:37 +00:00
Alasdair Kergon
34d22f7047
add lvconvert messages
2008-01-18 22:00:46 +00:00
Alasdair Kergon
9397833ceb
pre-release review cleanups
2008-01-17 17:17:09 +00:00
Alasdair Kergon
8900231d99
fix default extent_size
2008-01-17 15:31:18 +00:00
Alasdair Kergon
90e90672a4
rename lv_remap_error
2008-01-17 13:54:05 +00:00
Alasdair Kergon
fa51e5c762
mirror log stuff
2008-01-17 13:37:51 +00:00
Alasdair Kergon
911f55d005
lvconvert/vgreduce fixes
2008-01-17 13:13:54 +00:00
Alasdair Kergon
c170d321e8
fix a _get_vgs return
2008-01-16 22:52:46 +00:00
Alasdair Kergon
1050cebf7f
additional safety check on new segment list
2008-01-16 20:00:01 +00:00
Dave Wysochanski
dad73465fc
Create vgs_are_compatible() fn to check whether vgs are compatible for merging.
...
Add new vgmerge and vgsplit tests to check rejection of incompatible vgs.
Cleanup comments.
Bugzilla: bz251992
---
lib/metadata/metadata-exported.h | 3 +
lib/metadata/metadata.c | 89 +++++++++++++++++++++++++++++++++-
test/t-vgmerge-usage.sh | 101 +++++++++++++++++++++++++++++++++++++++
test/t-vgsplit-operation.sh | 20 +++++++
tools/vgmerge.c | 69 --------------------------
tools/vgsplit.c | 5 -
6 files changed, 215 insertions(+), 72 deletions(-)
2008-01-16 19:54:39 +00:00
Alasdair Kergon
8e2ac98fe2
adjust mirror log error message
2008-01-16 19:50:23 +00:00
Alasdair Kergon
1cb07e9cfd
cope with stacked LVs as well as PVs when deciding which bits of mirrors to remove
2008-01-16 19:38:39 +00:00
Alasdair Kergon
f1ccdf25b1
allow a mirror to contain only one mimage
2008-01-16 19:18:51 +00:00
Alasdair Kergon
42a83262a1
export find_temporary_mirror()
2008-01-16 19:13:51 +00:00
Alasdair Kergon
63ee9cbee6
move removable_pvs checking
2008-01-16 19:11:39 +00:00
Alasdair Kergon
3862f8ca7c
reorder funcs
2008-01-16 19:09:35 +00:00
Alasdair Kergon
4ada7cffd0
Maintain lists of stacked LV segments using each LV.
2008-01-16 19:00:59 +00:00
Alasdair Kergon
a664ce4298
use scan_vgs_for_pvs to detect non-orphans without MDAs
2008-01-16 18:15:26 +00:00
Alasdair Kergon
8795b45cb4
Don't use block_on_error with mirror targets above version 1.12.
2008-01-16 15:24:25 +00:00
Dave Wysochanski
628d3bff45
Move more parameter validation into the library.
...
Update vgrename to call validate_vg_rename_params().
Fix vgcreate and vgsplit default arguments by adding defaults parameter to
fill_vg_create_params().
Add t-vgrename-usage.sh test.
Bugzilla: bz251992
---
tools/toollib.c | 32 ++++++++------------------------
tools/toollib.h | 5 ++---
tools/vgcreate.c | 35 +++++++++++++++++++++--------------
tools/vgrename.c | 35 ++++++-----------------------------
tools/vgsplit.c | 21 ++++++++++++++-------
5 files changed, 51 insertions(+), 77 deletions(-)
2008-01-15 22:56:30 +00:00
Dave Wysochanski
38857ba29e
Allow vgcreate options as input to vgsplit when new vg is split destination.
2008-01-14 21:07:58 +00:00
Dave Wysochanski
80e070a857
Fix warning on conditional compile, unused variable
2008-01-11 17:44:26 +00:00
Alasdair Kergon
62738e8001
correct field name
2008-01-10 22:21:25 +00:00
Alasdair Kergon
5ecacf0c7f
Add lv_convert field to default lvs output.
2008-01-10 19:25:07 +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
Petr Rockai
d9885b1b64
Add snapshot dmeventd library (enables dmeventd snapshot monitoring).
2008-01-09 15:32:19 +00:00
Zdeněk Kabeláč
9e4b87e798
readahead at least twice the strip size (same as raid0 driver does)
2008-01-08 16:47:10 +00:00
Milan Broz
e0f34a9720
Fix a segfault if using pvs with --all argument. (2.02.29)
2008-01-07 20:42:57 +00:00
Alasdair Kergon
71f564ee5b
lvconvert uses polldaemon now
2007-12-22 12:13:29 +00:00
Alasdair Kergon
4b0950aba5
a few more changes/fixes to recent code
2007-12-22 02:13:00 +00:00
Alasdair Kergon
878a207d19
more fixes
2007-12-20 23:12:27 +00:00
Alasdair Kergon
0537ad860a
various cleanups in recent patches
2007-12-20 22:37:42 +00:00
Alasdair Kergon
2cdbbb1aea
stacked mirror support (incomplete)
2007-12-20 18:55:46 +00:00
Alasdair Kergon
7af977d36b
avoid some compiler warnings
2007-12-20 16:49:37 +00:00
Alasdair Kergon
9afff4cf30
Major restructuring of pvmove and lvconvert layer manipulation code
2007-12-20 15:42:55 +00:00
Alasdair Kergon
147482ea69
Build changes to replace fsadm C program with shell script.
2007-12-17 12:23:24 +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
066bc35e69
export can_split parameter until rest of pvmove allocation restructuring gets done
2007-12-05 22:11:20 +00:00
Alasdair Kergon
403779437c
round readahead to multiple of page size in tools
2007-12-05 19:24:32 +00:00
Patrick Caulfield
8c01179075
Tidy the clvmd backup code.
...
Move the backups inside the protection of the VG lock,
Don't backup if we have a suspended LV
Correct the vg_read() call
2007-12-05 13:17:18 +00:00
Patrick Caulfield
8f21c9a920
When we unlock a VG tell the clvmds to see if a backup of the metadata needs
...
to be done.
2007-12-04 15:39:26 +00:00
Alasdair Kergon
55323fb497
fix changed parms
2007-12-03 18:00:38 +00:00
Alasdair Kergon
0545cd5879
uncomment libdevmapper readahead calls
2007-11-29 15:04:12 +00:00
Alasdair Kergon
a0e648abfd
drop mirrored_pv/mirrored_pe from alloc handle
2007-11-22 14:54:35 +00:00
Alasdair Kergon
6350cd12fc
Start refactoring pvmove allocation code.
2007-11-22 13:57:21 +00:00
Alasdair Kergon
d6e5e3d103
Decode cluster locking state in log message. (untested)
...
Change file locking state messages from debug to very verbose.
2007-11-16 21:16:20 +00:00
Alasdair Kergon
5be7a0ebf7
move pvresize_single back under tools
2007-11-15 22:11:18 +00:00
Alasdair Kergon
a01732ee9b
more vg_read lock fixes
2007-11-15 21:30:52 +00:00
Alasdair Kergon
590cfb77a5
define LCK_NONE for cases when vg_lock_and_read already holds lock
...
(temporary - library will use internal ref counting instead)
2007-11-15 02:55:22 +00:00
Alasdair Kergon
df49287e5f
Convert some vg_reads into vg_lock_and_reads
2007-11-15 02:20:03 +00:00
Alasdair Kergon
2e379cb8a5
Accept sizes with --readahead argument.
...
Store size arguments as sectors internally.
2007-11-14 00:08:25 +00:00
Alasdair Kergon
c74fa11518
readahead activation code (but no dm support yet)
2007-11-12 20:51:54 +00:00
Alasdair Kergon
c0eff8a07f
Enhance the management of readahead settings.
2007-11-09 16:51:54 +00:00
Alasdair Kergon
954626f157
Prevent lvconvert -s from using same LV as origin and snapshot.
2007-11-07 16:33:12 +00:00
Alasdair Kergon
17e7dfa4bd
Add pv_mda_free and vg_mda_free fields to reports for raw text format.
2007-11-05 17:17:55 +00:00
Alasdair Kergon
971f233fb7
attempt to fix human-readable unit output when number of sectors is odd
2007-11-05 17:13:54 +00:00
Alasdair Kergon
b12bc692af
fix inverted orphan test
2007-11-05 17:12:50 +00:00
Alasdair Kergon
730301b34d
adjust sizes for metadata
2007-11-05 02:10:39 +00:00
Alasdair Kergon
c443bcf43c
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
Alasdair Kergon
b77e7eeddc
Add LVM2 version to 'Generated by' comment in metadata.
2007-11-04 19:16:34 +00:00
Alasdair Kergon
031b7b57a1
fix new lvremove checks - mustn't fail when activation is disabled
2007-11-04 16:28:57 +00:00
Alasdair Kergon
5123fab525
Fix error message when fixing up PV size in lvm2 metadata (2.02.11).
2007-11-04 15:43:50 +00:00
Alasdair Kergon
705b96c6f9
Fix orphan-related locking in pvdisplay and pvs.
...
Fix missing VG unlocks in some pvchange error paths.
Add some missing validation of VG names.
Rename validate_vg_name() to validate_new_vg_name().
Change orphan lock to VG_ORPHANS.
Change format1 to use ORPHAN as orphan VG name.
2007-11-02 20:40:05 +00:00
Bryn M. Reeves
ee79277774
Add is_orphan_vg() and change all hardcoded checks to use it.
2007-11-02 13:06:42 +00:00
Alasdair Kergon
db02dc218e
explanation of md superblock location & avoid compilation warnings
2007-10-24 11:24:24 +00:00
Alasdair Kergon
b66ce1089e
Detect md superblocks version 1.0, 1.1 and 1.2.
2007-10-24 00:51:05 +00:00
Alasdair Kergon
ec0e70b599
refactor dev-md.c, separating out the magic number detection
2007-10-24 00:30:30 +00:00
Dave Wysochanski
a273482f9d
Remove comment about allocation of pv->vg_name.
2007-10-12 21:08:38 +00:00
Dave Wysochanski
76cf8c4cf7
Add _alloc_pv() and _free_pv() from _pv_create() code and fix error paths.
...
Modified original patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 18:37:19 +00:00
Dave Wysochanski
9691ecc839
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
Dave Wysochanski
59b2a86359
Accessor functions for PV will not modify the given PV.
...
So we can add 'const' to it.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:08:10 +00:00
Dave Wysochanski
fe7cd72cff
Non-functional change - refactor lv_create_empty().
...
Remove struct format_instance param - we can safely obtain
this from vg->fid inside the function.
2007-10-11 19:20:38 +00:00
Dave Wysochanski
f0761fc570
Non-functional change - refactor vg_add_snapshot fid parameter.
2007-10-11 18:51:21 +00:00
Alasdair Kergon
90990aa19d
Handle new sysfs subsystem/block/devices directory structure.
2007-10-10 11:31:21 +00:00
Jim Meyering
efd83567c9
Fix the fsadm build failure without using -llvm.
...
* lib/misc/util.c (last_path_component): Move definition to ...
* lib/misc/last-path-component.h (last_path_component): ...here.
New file. Make the function "static inline".
* include/.symlinks: Add last-path-component.h.
* lib/misc/util.h (last_path_component): Remove declaration.
* tools/fsadm/fsadm.c: Include "last-path-component.h".
* tools/lvmcmdline.c: Likewise.
Author: Jim Meyering <meyering@redhat.com>
2007-10-03 16:10:04 +00:00
Dave Wysochanski
1cfb9ff46a
Some const fixups for previous checkins
2007-09-24 21:30:00 +00:00
Jim Meyering
c99204d370
Correct typo in comments: s/is part of the LVM2/is part of LVM2/.
...
Signed-off-by: Jim Meyering <jim@meyering.net>
Author: Jim Meyering <jim@meyering.net>
2007-09-21 10:16:45 +00:00
Dave Wysochanski
1bfc4335bb
Add %PVS extents option to lvresize, lvextend, and lvcreate.
2007-09-20 21:39:08 +00:00
Alasdair Kergon
d1e46207a5
Fix strdup memory leak in str_list_dup().
2007-09-17 16:02:46 +00:00
Dave Wysochanski
4ef1633969
Undo previous checkin - output format not good, info already available in other form(s)
2007-09-11 13:49:52 +00:00
Dave Wysochanski
57e593aab2
Add pvseg_free field to 'pvs' output
2007-09-10 20:05:29 +00:00
Jim Meyering
6461caacbb
Include strerror string in dev_open_flags' stat failure message.
...
* lib/device/dev-io.c (dev_open_flags):
Use log_sys_error after failed stat to report strerror(errno).
Use a slightly different diagnostic to report mismatched device number.
2007-09-07 11:24:19 +00:00
Dave Wysochanski
96ddad91a9
move guts of pvresize into library
2007-08-30 20:30:41 +00:00
Jonathan Earl Brassow
7c266f3e81
When mirrors are created with the --nosync option, a status flag
...
(MIRROR_NOTSYNCED) is added to the LVM metadata. This flag is
not cleared when converting to linear. Subsequently, if you
up-convert the linear to a mirror, the flag remains - even though
an up-convert will always force a complete resync.
2007-08-29 20:19:11 +00:00
Dave Wysochanski
d7ce981cd1
Modify lvremove to prompt for removal if LV active on other cluster nodes.
...
Add '-f' to vgremove to force removal of VG even if LVs exist.
Update vgremove man page for '-f'.
2007-08-28 16:14:49 +00:00
Patrick Caulfield
4cd97611e5
Locking P_global causes a cache refresh.
2007-08-23 15:43:20 +00:00
Alasdair Kergon
da27380ab5
Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R.
2007-08-23 15:02:26 +00:00
Alasdair Kergon
d080291150
Clean up numerous compiler warnings that crept in recently.
...
Remove several unused parameters from _allocate().
2007-08-22 14:38:18 +00:00
Alasdair Kergon
c9bc7dd0b6
Clean up mirrorlog argument processing.
...
Only permit --force, --verbose and --debug arguments to be repeated.
2007-08-21 19:46:36 +00:00
Dave Wysochanski
3769425f6b
Move guts of vgremove into lvm library.
...
Include archiver.h in metadata.c as a result of prior move.
2007-08-21 17:38:20 +00:00
Dave Wysochanski
63fa007af0
Prepare to move guts of vgremove into lvm library.
...
Fixup force_t.
2007-08-21 16:40:33 +00:00
Alasdair Kergon
3f507a26fb
Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.
2007-08-20 20:55:30 +00:00
Dave Wysochanski
53fbce932b
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
Dave Wysochanski
a94195c6cd
Prepare to move guts of lvremove into lvm library
2007-08-20 16:16:54 +00:00
Alasdair Kergon
fbccd12924
Update to use autoconf 2.61, while still supporting 2.57.
2007-08-14 19:11:31 +00:00
Dave Wysochanski
52197cf4d2
Remove extra checks for sub LV renaming.
...
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>.
2007-08-08 18:00:36 +00:00
Dave Wysochanski
cfbb2afac5
A few more cleanups for lvrename of mirrors checkin:
...
* add struct lv_names for old/new names
* replace lv->status & MIRROR checks with lv_is_visible()
2007-08-07 18:55:38 +00:00
Dave Wysochanski
8f154f65f9
Some simple fixups for last checkin:
...
* remove "_" from "return_0"
* improve some naming and terminology
* add 'const'
2007-08-07 16:57:09 +00:00
Jim Meyering
7454664997
Add "const" attributes where possible: first cut.
2007-08-07 09:06:05 +00:00
Dave Wysochanski
3393b7aedd
Update a few comments
2007-08-06 21:11:27 +00:00
Dave Wysochanski
c392ff1cd3
Add support for renaming mirrored LVs.
...
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-06 20:35:48 +00:00
Jim Meyering
30a0f831a5
For consistency, rename local variable: s/newname/new_name/g.
2007-08-06 14:57:48 +00:00
Jim Meyering
afc5e0e3e5
Make lv_rename's interface "const correct".
...
* lib/metadata/lv_manip.c (lv_rename): Make char* param "const".
* lib/metadata/metadata-exported.h: Update prototype, too.
2007-08-06 09:04:21 +00:00
Dave Wysochanski
2192c4e269
Factor out core of lvrename to lv_rename library function.
...
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-03 21:22:10 +00:00
Jonathan Earl Brassow
9dbf53fdb9
lib/activate/activate.c:_lv_activate tries to monitor a device
...
regardless of whether it was successfully activated. Now fixed
to only monitor if it was successfully activated.
2007-08-01 20:29:07 +00:00
Jim Meyering
38b6963c8b
Don't leak a file descriptor in fcntl_lock_file(), when fcntl fails.
2007-07-28 15:20:36 +00:00
Jim Meyering
7b6248983d
Remove create_dir function; use now-equivalent dm_create_dir instead.
...
* lib/misc/lvm-file.c (_create_dir_recursive, create_dir): Remove functions.
* lib/misc/lvm-file.h (create_dir): Remove declaration.
* lib/commands/toolcontext.c (create_toolcontext): s/create_dir/dm_create_dir/
* lib/format_text/archiver.c (archive, backup): Likewise.
* lib/format_text/format-text.c (_add_dir): Likewise.
* lib/locking/file_locking.c (init_file_locking): Likewise.
Patch by Jun'ichi Nomura.
2007-07-28 12:26:21 +00:00
Alasdair Kergon
d5a46396b0
Add ps3disk devices.
2007-07-26 13:28:32 +00:00
Jim Meyering
5e84cb560d
Detect stream write failure reliably; new fn: lvm_fclose; use dm_fclose
...
* lib/misc/lvm-file.c (lvm_fclose): New function.
* lib/misc/lvm-file.h (lvm_fclose): Declare it.
* lib/config/config.c (write_config_file): Use the new function to detect
and diagnose unlikely write failure.
* lib/filters/filter-persistent.c (persistent_filter_dump): Likewise.
* lib/format_text/archive.c (archive_vg): Likewise.
* lib/format_text/format-text.c (_vg_write_file): Likewise.
* lib/log/log.c (fin_log): Similar, but use dm_fclose directly.
Include "\n" at end of each fprintf format string.
2007-07-24 17:48:08 +00:00
Dave Wysochanski
b004fe9556
Add CORRECT_INCONSISTENT and FAIL_INCONSISTENT flags to vg_lock_and_read
2007-07-23 21:03:42 +00:00
Dave Wysochanski
67142ad046
Add vg_lock_and_read() external library function.
2007-07-23 17:27:55 +00:00
Milan Broz
3c3ec06b12
Fix loading of persistent cache if cache_dir is used. (2.02.23)
...
Move lstat warning in _compare_paths to verbose output only.
2007-07-23 10:45:49 +00:00
Milan Broz
5b5caa8a16
Fix compilation warning in util.c.
2007-07-23 10:41:19 +00:00
Jim Meyering
b2cba098bb
Eliminate uses of strdup+basename. Use last_path_component instead.
...
* lib/misc/util.c, lib/misc/util.h (last_path_component): New files.
* lib/Makefile.in (SOURCES): Add misc/util.c.
* lib/misc/lib.h: Include "util.h".
* tools/fsadm/fsadm.c: Include "util.h". (_usage): Use last_path_component,
not basename.
* tools/lvmcmdline.c (_find_command, lvm2_main): Likewise.
* include/.symlinks: Add lib/misc/util.h.
2007-07-20 15:48:39 +00:00
Jim Meyering
1ec0d47f10
Use gcc's printf attribute wherever possible.
...
* daemons/clvmd/clvmd.h (debuglog): Add __attribute__((printf)).
* lib/config/config.c (_line_append): Likewise.
* lib/misc/lvm-string.h (emit_to_buffer): Likewise.
2007-07-20 15:38:19 +00:00
Jim Meyering
f232606ec7
In _line_append, use "sizeof buf - 1" rather than equivalent "4095"
...
* lib/config/config.c:
2007-07-20 15:26:39 +00:00
Jim Meyering
fa28cea152
Introduce is_same_inode macro, now including a comparison of st_dev.
...
* lib/misc/lvm-file.h (is_same_inode): Define.
* lib/filters/filter-persistent.c (persistent_filter_dump): Use is_same_inode
in place of a direct st_ino-only comparison.
* lib/locking/file_locking.c (_release_lock, _lock_file): Likewise.
2007-07-20 15:22:46 +00:00
Jim Meyering
c8da1647a1
Don't leak a file descriptor in _lock_file when flock fails.
...
* lib/locking/file_locking.c (_lock_file): Close fd upon flock failure.
2007-07-20 12:12:52 +00:00
Patrick Caulfield
505a0a8718
Add SUN's LDOM virtual block device to filters
...
Thanks to Fabio Massimo Di Nitto
2007-07-19 07:06:47 +00:00
Alasdair Kergon
10d3496a17
Split metadata-external.h out from metadata.h for the tools to use.
2007-07-18 15:38:58 +00:00
Dave Wysochanski
2a4819f3c8
Change pv_read_path to pv_by_path
2007-07-12 15:38:53 +00:00
Dave Wysochanski
7121866b13
Turn _add_pv_to_vg() into external library function add_pv_to_vg()
2007-07-12 05:04:42 +00:00
Dave Wysochanski
d6e05ad9e2
Refactor vg_extend error path.
2007-07-12 04:12:04 +00:00
Dave Wysochanski
993e30a7de
Add pv_read_path, a proposed external LVM library function to take a device path and return a PV handle
2007-07-11 23:33:12 +00:00
Alasdair Kergon
1ea4b2ea91
Cope with find_seg_by_le() failure in check_lv_segments().
2007-07-10 18:50:03 +00:00
Alasdair Kergon
bc1d6e1f90
tidy
2007-07-10 18:20:00 +00:00
Alasdair Kergon
9ec6e68d0c
Fix pv_mda_count to cope with missing PV.
...
[vgcreate vg1 pv1 pv2; pvremove -ff pv1; pvs -P -o+pv_mda_count =>segfault]
2007-07-10 18:18:33 +00:00
Alasdair Kergon
6fb3e1aa15
Add vg_mda_count and pv_mda_count columns to reports.
2007-07-09 15:40:43 +00:00
Alasdair Kergon
f1f92eb2e2
Fix dumpconfig to use log_print instead of stdout directly.
2007-07-08 22:51:20 +00:00
Dave Wysochanski
a6d9fc58eb
Convert _add_pv_to_vg to usable LVM library function.
2007-07-02 21:48:30 +00:00
Dave Wysochanski
5f951faf32
Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <qboosh@pld-linux.org>
2007-07-02 11:17:21 +00:00
Petr Rockai
764858fa12
Make warnings go to stderr. Change log_warn to that effect, log_print
...
continues to send messages to stdout.
2007-06-28 17:33:44 +00:00
Dave Wysochanski
d2cb05988d
Convert vg->status checks to use vg_check_status function.\nRename status_flags to status in vg_check_status.
2007-06-19 04:36:12 +00:00
Dave Wysochanski
6e056767b4
Add vg_status function and clean up vg->status in tools directory
2007-06-19 04:23:32 +00:00
Dave Wysochanski
a10afb1b98
Make vg_extend() format_instance * parameter internal to vg_extend()
2007-06-19 00:33:43 +00:00
Dave Wysochanski
c75d4af4bc
Remove get_ prefix from get_pv_* functions
2007-06-15 22:16:55 +00:00
Alasdair Kergon
9daac5c178
pre-release
2007-06-15 20:46:04 +00:00
Petr Rockai
10e4254e7d
Allow keyboard interrupts in yes_no_prompt(). Add code to toollib.c
...
loops and to pvcreate.c, lvchange.c and lvresize.c to handle
interrupted prompts.
2007-06-15 10:11:14 +00:00
Dave Wysochanski
8ac718a3a2
convert pv->vg_name[0] to \!is_orphan(pv)
2007-06-14 15:48:05 +00:00
Dave Wysochanski
4b5fad4e48
Remove casts in pv_create and find_pv_in_vg_by_uuid
2007-06-13 21:14:07 +00:00
Dave Wysochanski
7a13e71c80
Convert pv_handle_t to pv_t * and tidy up whitespace
2007-06-13 20:55:56 +00:00
Dave Wysochanski
3c10943900
Add typedef pv_handle_t
2007-06-13 19:52:48 +00:00
Dave Wysochanski
696b8811c2
Fix a couple benign warnings by adding variable initializations.
2007-06-13 15:11:19 +00:00
Dave Wysochanski
9fd2c8602a
Convert find_pv_in_vg_by_uuid and pv_create to use PV handles
2007-06-12 22:41:27 +00:00
Dave Wysochanski
a3636a5af4
Change PV_HANDLE_DEREF to pv_field and add paren's
2007-06-12 21:39:49 +00:00
Dave Wysochanski
f2e5f07718
Add get_pv_* functions to return PV fields in prep for external LVM library
2007-06-12 21:20:20 +00:00
Dave Wysochanski
16c6fdde60
Add wrappers to functions related to pv commands in preparation for exported LVM lib
2007-06-11 18:29:30 +00:00
Bryn M. Reeves
c394631e4c
Allow vgcfgrestore to list metadata backup files using -f
2007-06-08 22:38:48 +00:00
Dave Wysochanski
8b370b7cc1
Add vg_check_status to consolidate vg status flags checks and error messages.
2007-06-06 19:40:28 +00:00
Dave Wysochanski
6768f64e2f
Fix pvdisplay --maps to not display segment header for orphan PVs.
2007-05-31 20:26:11 +00:00
Dave Wysochanski
f1813b1cc6
Fix redundant segment display when PV is given to 'pvdisplay --maps' cmdline.
2007-05-31 20:10:25 +00:00
Dave Wysochanski
fb665bd0dd
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
65dda2ef3d
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
b162b992af
Add --maps to pvdisplay.
...
Modified original patch from David Robinson <zxvdr.au@gmail.com>.
2007-05-30 20:43:09 +00:00
Milan Broz
1ded1fc509
Remove symlinks if parent volume is deactivated.
2007-05-15 14:42:01 +00:00
Milan Broz
5ead2706b4
Fix a segfault if a device has no target (no table)
2007-05-14 11:27:34 +00:00
Alasdair Kergon
fb94fb980a
Fix get_config_uint64() to read a 64-bit value not a 32-bit one.
2007-04-27 20:41:50 +00:00
Alasdair Kergon
b10cc18f53
Add -Wformat-security and change one fprintf() to fputs().
2007-04-27 19:26:57 +00:00
Alasdair Kergon
d04e972d65
Move regex functions into libdevmapper.
2007-04-27 18:52:05 +00:00
Alasdair Kergon
2294fdb496
Change some #include lines to search only standard system directories.
2007-04-27 17:46:16 +00:00
Alasdair Kergon
b6194edd67
add preferred_names to man page.
2007-04-26 17:14:57 +00:00
Alasdair Kergon
dcdbbb3ecb
Add devices/preferred_names config regex list for displayed device names.
...
Free a temporary dir string in fcntl_lock_file() after use.
Fix a dm_pool_destroy() in matcher_create().
Introduce goto_bad macro.
2007-04-26 16:44:59 +00:00
Dave Wysochanski
7ef99ee4e6
Fix warnings on x86_64 involving ptrdiff_t:
...
config/config.c:493: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
Modified original patch from Jim Meyering <jim@meyering.net>
2007-04-26 16:40:46 +00:00
Dave Wysochanski
1ac1418286
Update pvck to include text metadata area and record detection.
...
--
2007-04-25 21:10:55 +00:00
Dave Wysochanski
8fc854f38e
Add support functions for analysis of config sections,
...
and hence, on-disk LVM2 metadata.
--
2007-04-25 20:38:39 +00:00
Dave Wysochanski
1c2360b335
Update pvck to read labels on disk, with flexible --labelsector
...
parameter.
--
2007-04-25 20:03:16 +00:00
Dave Wysochanski
dd4477406b
Add count_chars and count_chars_len functions, two
...
generic string utility functions.
--
2007-04-25 18:24:19 +00:00
Dave Wysochanski
86b21eaf83
Add 'scan_sector' parameter to label_read and _find_labeller to add
...
flexibility in searching for disk labels.
2007-04-23 18:21:01 +00:00
Dave Wysochanski
ecc001ed08
Add dev_read_circular, read 2 regions on same device.
2007-04-19 02:10:42 +00:00
Alasdair Kergon
ca5e423331
Update lists of attribute characters in man pages.
...
Change cling alloc policy attribute character from 'C' to l'.
2007-03-27 13:35:33 +00:00
Milan Broz
fa9407089c
Fix creation and conversion of mirrors with tags.
2007-03-26 16:10:10 +00:00
Milan Broz
66f28e193a
Fix vgsplit for lvm1 format (set and validate VG name in PVs metadata).
...
Split metadata areas in vgsplit properly.
2007-03-23 12:43:17 +00:00
Alasdair Kergon
d8f54cf891
Try to fix reading in of lvm1 striped LVs.
...
There are two fixes other than improving variable names and updating code
layout etc.
The loop counter is incremented by area_len instead of area_len * stripes;
the 3rd _check_stripe parameter is no longer multiplied by number of stripes.
2007-03-15 13:38:28 +00:00
Patrick Caulfield
625a671189
Flag nolocking as a clustered locking module as we need to be able
...
to look at clustered LVs at clvmd startup
2007-03-13 14:59:21 +00:00
Alasdair Kergon
0b55d7d0d8
Fix vgrename active LV check to ignore differing vgids.
2007-03-08 21:08:25 +00:00
Alasdair Kergon
5d86fd8fdb
Remove no-longer-used uuid_out parameter from activation info functions.
2007-03-08 19:58:04 +00:00
Alasdair Kergon
1b76eb1f59
Fix two more segfaults if an empty config file section encountered.
2007-03-08 19:22:52 +00:00
Alasdair Kergon
b05678d8bf
Move .cache file into a new /etc/lvm/cache directory by default.
...
Add devices/cache_dir & devices/cache_file_prefix, deprecating devices/cache.
Create directory in fcntl_lock_file() if required.
2007-02-28 18:27:13 +00:00
Alasdair Kergon
30b432adc5
Fix loading of segment_libraries. [gentoo]
2007-02-08 17:31:02 +00:00
Alasdair Kergon
7c9733eb5d
If a PV reappears after it was removed from its VG, make it an orphan.
2007-02-07 13:29:52 +00:00
Alasdair Kergon
0fd6ce546f
Fix vgsplit to handle mirrors.
...
Reorder fields in reporting field definitions.
2007-01-29 23:01:18 +00:00
Alasdair Kergon
fba1388719
Fix md signature check to handle both endiannesses.
2007-01-26 17:15:16 +00:00
Alasdair Kergon
f9ee4395b0
also ignore mirrors
2007-01-25 23:03:48 +00:00
Alasdair Kergon
71f06d51ed
Add devices/ignore_suspended_devices to ignore suspended dm devices.
2007-01-25 21:22:30 +00:00
Alasdair Kergon
f813d41a76
Add some missing close() and fclose() return code checks.
...
Fix exit statuses of reporting tools (2.02.19).
2007-01-25 14:37:48 +00:00
Alasdair Kergon
d0f7067471
lvm.static no longer interacts with dmeventd unless explicitly asked to.
2007-01-24 23:43:27 +00:00
Alasdair Kergon
be5b4c38a7
fix earlier checkin
2007-01-24 22:06:11 +00:00
Alasdair Kergon
84e348fade
Add field definitions to report help text.
...
Remove unnecessary cmd arg from target_*monitor_events().
2007-01-24 16:51:24 +00:00
Alasdair Kergon
ee6e6529ee
Long-lived processes write out persistent dev cache in refresh_toolcontext().
2007-01-23 16:03:54 +00:00
Alasdair Kergon
9d944d6cf9
Fix refresh_toolcontext() always to wipe persistent device filter cache.
...
Add is_long_lived to toolcontext.
2007-01-23 15:58:06 +00:00
Alasdair Kergon
2493c46970
Streamline dm_report_field_* interface.
2007-01-22 15:07:21 +00:00
Alasdair Kergon
f4bd12e8e9
register->monitor etc.
2007-01-19 22:21:45 +00:00
Alasdair Kergon
9d98c3278d
No longer necessary to specify alignment for report fields.
2007-01-18 17:48:29 +00:00
Alasdair Kergon
1106b7775a
Fix a segfault if an empty config file section encountered.
2007-01-17 16:22:59 +00:00
Alasdair Kergon
ae2852156d
merge _target_*register_events
...
introduce _create_dm_event_handler()
2007-01-17 15:00:57 +00:00
Alasdair Kergon
a81926503d
use updated dm_event_get_registered_device interface
2007-01-16 23:05:13 +00:00
Alasdair Kergon
d24d563ebc
Move basic reporting functions into libdevmapper.
2007-01-16 18:06:12 +00:00
Alasdair Kergon
edb9c3cc9f
Fix partition table processing after sparc changes (introduced in 2.02.16).
...
Fix cmdline PE range processing segfault (introduced in 2.02.13).
2007-01-15 21:55:11 +00:00
Alasdair Kergon
b4f9531475
Some libdevmapper-event interface changes.
2007-01-15 18:22:02 +00:00
Alasdair Kergon
c975a100b1
Report dmeventd mirror monitoring status.
2007-01-12 20:38:30 +00:00
Alasdair Kergon
2b48fad426
updated dmeventd interface
2007-01-11 22:24:32 +00:00
Alasdair Kergon
0b9cfc278b
dumpconfig accepts a list of configuration variables to display.
...
Change dumpconfig to use --file to redirect output to a file.
2007-01-09 23:22:31 +00:00
Alasdair Kergon
459023d171
Free memory in _raw_read_mda_header() error paths.
...
Fix ambiguous vgsplit error message for split LV.
Fix lvextend man page typo.
2007-01-09 21:12:41 +00:00
Alasdair Kergon
fd6570720a
Add configure --with-dmdir to compile against a device-mapper source tree.
...
Use no flush suspending for mirrors.
2007-01-09 20:31:08 +00:00
Milan Broz
faff865cfd
Fix create mirror with name longer than 22 chars.
2007-01-05 15:53:40 +00:00
Alasdair Kergon
742ab55a9a
Fix some activate.c prototypes when compiled without devmapper.
2006-12-20 16:19:01 +00:00
Alasdair Kergon
bc03f7bad3
When lvconvert allocates a mirror log, respect parallel area constraints.
...
Use loop to iterate through the now-ordered policy list in _allocate().
Check for failure to allocate just the mirror log.
Introduce calc_area_multiple().
Support mirror log allocation when there is only one PV: area_count now 0.
(See lvm-devel list archives for further details.)
2006-12-13 03:39:58 +00:00
Alasdair Kergon
a1c8bd3846
Fix detection of smallest area in _alloc_parallel_area() for cling policy.
2006-12-12 19:30:10 +00:00
Patrick Caulfield
9dee30ff0e
Fix gulm operation of clvmd. including a hang when attempting to
...
exclusively lock an LV that is already locked no another node.
2006-12-11 14:00:26 +00:00
Alasdair Kergon
b9ba9ffad2
clvmd ia64 alignment fixes etc. (pjc)
2006-12-01 23:10:26 +00:00
Alasdair Kergon
ee68d715bf
Adjust some alignments for ia64 and sparc.
...
(Some of the changes are probably unnecessary.)
2006-11-30 23:11:42 +00:00
Alasdair Kergon
224084f056
Fix mirror segment removal to use temporary error segment.
2006-11-30 17:52:47 +00:00
Alasdair Kergon
4e1342b641
fix _find_config_node: null parameter is permitted
2006-11-21 15:13:36 +00:00
Alasdair Kergon
8ab6d72519
Fix check for snapshot module when activating snapshot.
2006-11-20 16:45:45 +00:00
Alasdair Kergon
0933036366
Warn if certain duplicate config file entries are seen.
...
(not thoroughly tested)
2006-11-16 17:36:00 +00:00
Alasdair Kergon
9acdc2f6bf
Fix a label_verify error path.
2006-11-14 15:03:07 +00:00
Alasdair Kergon
23115f4116
fix cast
2006-11-10 20:15:10 +00:00
Alasdair Kergon
cf5f48e6cc
Fix adjusted_mirror_region_size() for 64-bit size.
2006-11-10 19:35:03 +00:00
Alasdair Kergon
997fa756ad
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
6531e88761
Protect .cache manipulations with fcntl locking.
...
Change .cache timestamp comparisons to use ctime.
2006-11-04 03:34:10 +00:00
Alasdair Kergon
45be8a836b
fix last check-in: lv->size is in sectors
2006-11-03 21:07:15 +00:00
Alasdair Kergon
df2577ace2
Fix high-level free space check for partial allocations.
2006-10-30 16:10:55 +00:00
Alasdair Kergon
5bb8efa41f
Perform high-level free space check before each allocation attempt.
2006-10-23 15:54:51 +00:00
Alasdair Kergon
85e6042941
Cope if same PV is included more than once in cmdline PE range list.
2006-10-21 23:18:43 +00:00
Alasdair Kergon
a5f282f156
Set PV size to current device size if it is found to be zero.
2006-10-19 12:53:47 +00:00