1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

728 Commits

Author SHA1 Message Date
Dave Wysochanski
9ea1d647af 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
8fd14f09e2 Non-functional change - refactor vg_add_snapshot fid parameter. 2007-10-11 18:51:21 +00:00
Jim Meyering
06b8fee542 Allow $DM_DEV_DIR envvar to override default of "/dev".
* dmsetup/dmsetup.c (DEV_PATH): Remove definition.
(parse_loop_device_name): Add parameter: dev_dir.
Declare the "dev" parameter to be "const".
Use dev_dir, not DEV_PATH.  Handle the case in which dev_dir
does not end in a "/".
(_get_abspath): Declare "path" parameter "const", to match.
(_process_losetup_switches): Add parameter: dev_dir.
Pass dev_dir to parse_loop_device_name.
(_process_switches): Add parameter: dev_dir.
Pass dev_dir to _process_losetup_switches.
(main): Set dev_dir from the DM_DEV_DIR envvar, else to "/dev".
Call dm_set_dev_dir.
* lib/libdm-common.c (dm_set_dev_dir): Rewrite to be careful
about boundary conditions, now that dev_dir may be tainted.
* man/dmsetup.8: Mention $DM_DEV_DIR.


Author: Jim Meyering <meyering@redhat.com>
2007-10-09 12:14:48 +00:00
Jim Meyering
4df0c15074 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
Jim Meyering
d634df5764 Revert last change. fsadm must not depend on -llvm.
Author: Jim Meyering <meyering@redhat.com>
2007-10-03 16:08:18 +00:00
Jim Meyering
0fc5422941 Avoid link failure when building fsadm.
* tools/fsadm/Makefile.in (LVMLIBS): Define.
(fsadm): Link with $(LVMLIBS).

Author: Nix <nix@esperi.org.uk>
2007-10-03 09:46:57 +00:00
Dave Wysochanski
cd3ae9bc99 Remove unused pargc parameter 2007-10-01 15:01:26 +00:00
Dave Wysochanski
bf4f5b21a4 Some const fixups for previous checkins 2007-09-24 21:30:00 +00:00
Dave Wysochanski
f18ef24471 Refactor lvcreate mirror parameter validation. 2007-09-24 13:29:49 +00:00
Dave Wysochanski
479921f1ef Refactor lvcreate stripe parameter validation. 2007-09-24 13:25:31 +00:00
Jim Meyering
f955ed718f Don't emit a trailing newline to stderr.
* tools/lvmcmdline.c (_short_usage): Remove trailing "\n".
Spotted by Alasdair G. Kergon.


Author: Jim Meyering <jim@meyering.net>
2007-09-21 18:43:55 +00:00
Jim Meyering
01c2ec4be5 Print --help output to stdout, not stderr.
* tools/lvmcmdline.c (_usage): Use log_print, not log_error.


Author: Jim Meyering <jim@meyering.net>
2007-09-21 18:06:56 +00:00
Jim Meyering
60c453a2e2 After a diagnostic, suggest --help, rather than printing all --help output.
Print just one line:
Use `COMMAND --help' for more information.
after "real" diagnostic(s), rather than all of the usage lines.
Otherwise, the 30-40+ lines of --help output could obscure the real diagnostic.


Author: Jim Meyering <jim@meyering.net>
2007-09-21 18:06:33 +00:00
Jim Meyering
7f8f8bfa09 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
dfef7f6942 Add %PVS extents option to lvresize, lvextend, and lvcreate. 2007-09-20 21:39:08 +00:00
Alasdair Kergon
13aba0817b Remove no-longer-correct restrictions on PV arg count with stripes/mirrors.
[E.g. They fail if tags or --alloc anywhere used.]
2007-09-17 17:18:37 +00:00
Jim Meyering
66e941e83f Avoid static link failure with some SELinux libraries.
Author: Jim Meyering <jim@meyering.net>
2007-09-12 16:54:23 +00:00
Jim Meyering
3851b7a364 Diagnose invalid PE values given on the pvmove command line (64-bit systems).
* tools/toollib.c (xstrtouint32): New function.
(_parse_pes): Use xstrtouint32; don't cast strtoul's unsigned
long to uint32_t.  Detect overflow.


Author: Jim Meyering <jim@meyering.net>
2007-09-11 20:12:54 +00:00
Dave Wysochanski
1102c4ee95 Fix last checkin 2007-09-06 22:35:01 +00:00
Dave Wysochanski
406a97546a Fixup _lvresize error return codes and modularize function 2007-09-06 21:08:16 +00:00
Dave Wysochanski
e38a476e72 prepare to move guts of vgrename into library function 2007-08-31 19:09:49 +00:00
Dave Wysochanski
c6ea067fed move guts of pvresize into library 2007-08-30 20:30:41 +00:00
Dave Wysochanski
4463d20448 prepare to move guts of pvresize into library 2007-08-30 20:16:01 +00:00
Alasdair Kergon
2b849ab4d1 Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
Correct --mirrorlog argument name in man pages (not --log).
2007-08-30 19:34:19 +00:00
Jonathan Earl Brassow
a2cb3d17a7 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
f603fe64bd 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
Alasdair Kergon
e935d21752 Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R. 2007-08-23 15:02:26 +00:00
Alasdair Kergon
3b3948f1d2 Change lvconvert_mirrors to use mirror segtype not striped. 2007-08-22 20:03:46 +00:00
Alasdair Kergon
ea041b12f1 Fix lvconvert_mirrors detection of number of existing mirrors. 2007-08-22 19:32:39 +00:00
Alasdair Kergon
21bc366486 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
91953ca3aa Fix (C) ! 2007-08-21 19:56:18 +00:00
Alasdair Kergon
edb3374d32 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
16669b5aa0 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
3d33abbb8c Prepare to move guts of vgremove into lvm library.
Fixup force_t.
2007-08-21 16:40:33 +00:00
Alasdair Kergon
147d5faccf Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-21 16:26:07 +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
Dave Wysochanski
9eb05d9761 Prepare to move guts of lvremove into lvm library 2007-08-20 16:16:54 +00:00
Dave Wysochanski
62af220c9e Fix "lvconvert -s" from always failing with argument error message.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>.
2007-08-10 13:33:49 +00:00
Jonathan Earl Brassow
64119287c3 - change new log_ARG variable to more explicit mirrorlog_ARG. 2007-08-09 21:25:08 +00:00
Jim Meyering
08c9ff434b Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Dave Wysochanski
b7cd307f9b 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
19583d115c This patch changes the arguments that specify the mirror
log type.  Previously, we had a '--corelog' argument that
would change the default type from 'disk' to 'core'.  I
think that creates too much confusion - especially when
doing conversions on mirrors.

The new argument '--log' takes either "disk" or "core"
as a parameter.  This could be expanded in the future
for additional logging types as well.

Examples:
# Creating a 2-way mirror
$> lvcreate -m1 ... # implicitly use default disk logging
$> lvcreate -m1 --log disk ... # explicit disk logging
$> lvcreate -m1 --log core ... # specify core logging
$> lvcreate -m1 --corelog ... # old way still works

# Conversion examples
$> lvconvert --log core ... # convert to core logging
$> lvconvert --log disk ... # convert to disk logging
$> lvconvert -mX --corelog ... # old way still works
$> lvconvert -mX ... # old way of converting to disk logging still works

Changes are reflected in the man pages.
2007-08-01 21:01:06 +00:00
Jonathan Earl Brassow
579d086d7a - cleanup excessive indentation in tools/lvconvert.c:lvconvert_mirrors 2007-08-01 20:54:28 +00:00
Dave Wysochanski
0c8b215a60 Update lvconvert and lvrename to use vg_lock_and_read 2007-07-23 22:20:42 +00:00
Dave Wysochanski
d2f218cc46 Fix error introduced with previous checkin 2007-07-23 21:10:36 +00:00
Dave Wysochanski
4f629c3bba Add CORRECT_INCONSISTENT and FAIL_INCONSISTENT flags to vg_lock_and_read 2007-07-23 21:03:42 +00:00
Dave Wysochanski
891c3d298b Add vg_lock_and_read() external library function. 2007-07-23 17:27:55 +00:00
Jim Meyering
6c35e3c84c 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
Alasdair Kergon
03eee0e2ed Split metadata-external.h out from metadata.h for the tools to use. 2007-07-18 15:38:58 +00:00