]> sourceware.org Git - lvm2.git/log
lvm2.git
15 years agoProvide da and mda locations in debug message when writing text format label.
Alasdair Kergon [Fri, 20 Feb 2009 23:19:28 +0000 (23:19 +0000)]
Provide da and mda locations in debug message when writing text format label.

15 years agoMention the restriction on file descriptors at invocation on the lvm man page.
Alasdair Kergon [Fri, 20 Feb 2009 01:47:02 +0000 (01:47 +0000)]
Mention the restriction on file descriptors at invocation on the lvm man page.

15 years agoIn testsuite's not.c, print a notice when program dies of a fatal signal.
Petr Rockai [Tue, 17 Feb 2009 19:37:28 +0000 (19:37 +0000)]
In testsuite's not.c, print a notice when program dies of a fatal signal.

15 years agoFix test output collection in harness.c.
Petr Rockai [Tue, 17 Feb 2009 19:36:16 +0000 (19:36 +0000)]
Fix test output collection in harness.c.

15 years agoIndex cached vgmetadata by vgid not vgname to cope with duplicate vgnames. (dwyso)
Alasdair Kergon [Tue, 17 Feb 2009 18:56:41 +0000 (18:56 +0000)]
Index cached vgmetadata by vgid not vgname to cope with duplicate vgnames.  (dwyso)

15 years agoFix lvm.static build dependence (to properly propagate changes in libdevmapper).
Milan Broz [Tue, 17 Feb 2009 11:07:59 +0000 (11:07 +0000)]
Fix lvm.static build dependence (to properly propagate changes in libdevmapper).

15 years agoOnly fail when tests have failed, but not when they have been just skipped.
Petr Rockai [Mon, 16 Feb 2009 16:49:21 +0000 (16:49 +0000)]
Only fail when tests have failed, but not when they have been just skipped.

15 years agoIf kernel supports only one dm major number, use in place of any supplied.
Alasdair Kergon [Thu, 12 Feb 2009 20:42:07 +0000 (20:42 +0000)]
If kernel supports only one dm major number, use in place of any supplied.
No longer require kernel and metadata major numbers to match.

15 years agoRe-implement the test harness in C. This lets us pass through signals and
Petr Rockai [Thu, 12 Feb 2009 19:54:45 +0000 (19:54 +0000)]
Re-implement the test harness in C. This lets us pass through signals and
trigger proper test teardown upon harness interrupt or termination. I also
tweaked the output somewhat while I was at it...

15 years agoAdd a fully-functional get_cluster_name() to clvmd corosync interface.
Christine Caulfield [Wed, 11 Feb 2009 10:13:20 +0000 (10:13 +0000)]
Add a fully-functional get_cluster_name() to clvmd corosync interface.

15 years agoRemove duplicate cpg_initialize from clvmd startup.
Christine Caulfield [Tue, 10 Feb 2009 13:22:18 +0000 (13:22 +0000)]
Remove duplicate cpg_initialize from clvmd startup.

15 years agoAdd option to /etc/sysconfig/cluster to select cluster type for clvmd.
Christine Caulfield [Tue, 10 Feb 2009 11:53:33 +0000 (11:53 +0000)]
Add option to /etc/sysconfig/cluster to select cluster type for clvmd.

15 years agoAllow clvmd to start up if its lockspace already exists.
Christine Caulfield [Tue, 10 Feb 2009 11:52:40 +0000 (11:52 +0000)]
Allow clvmd to start up if its lockspace already exists.

15 years agoSeparate PV label attributes which do not need parse metadata when reporting.
Milan Broz [Mon, 9 Feb 2009 09:45:49 +0000 (09:45 +0000)]
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.)

15 years agoRemove external dependency on the 'cut' command in fsadm
Zdenek Kabelac [Fri, 6 Feb 2009 14:28:06 +0000 (14:28 +0000)]
Remove external dependency on the 'cut' command in fsadm

15 years agoFix pvs segfault when pv mda attributes requested for not available PV.
Milan Broz [Fri, 6 Feb 2009 12:41:51 +0000 (12:41 +0000)]
Fix pvs segfault when pv mda attributes requested for not available PV.

15 years agoadd support for ext4 resize in fsadm
Zdenek Kabelac [Wed, 4 Feb 2009 12:47:05 +0000 (12:47 +0000)]
add support for ext4 resize in fsadm

15 years agoMove locking_type reading inside init_locking().
Dave Wysochanski [Tue, 3 Feb 2009 16:23:19 +0000 (16:23 +0000)]
Move locking_type reading inside init_locking().

No functional change.

15 years agoRename get_vgs() to get_vgnames() and clarify related error messages.
Dave Wysochanski [Tue, 3 Feb 2009 16:19:25 +0000 (16:19 +0000)]
Rename get_vgs() to get_vgnames() and clarify related error messages.

get_vgs() really returns a list of vgnames.  In the future we will use
get_vgs() to return a list of vg structures, similar to get_pvs().

15 years agoAllow clvmd to be built with all cluster managers & select one on cmdline.
Christine Caulfield [Mon, 2 Feb 2009 14:34:24 +0000 (14:34 +0000)]
Allow clvmd to be built with all cluster managers & select one on cmdline.

15 years agoMention --with-clvmd=corosync in ./configure
Christine Caulfield [Thu, 29 Jan 2009 15:23:15 +0000 (15:23 +0000)]
Mention --with-clvmd=corosync in ./configure

15 years agoAdd as-yet-unused vg_read_error() and vg_might_exist(). (mornfall)
Alasdair Kergon [Tue, 27 Jan 2009 01:48:47 +0000 (01:48 +0000)]
Add as-yet-unused vg_read_error() and vg_might_exist().  (mornfall)

15 years agoIntroduce as-yet-unused replacement vg_read() and vg_read_for_update()
Alasdair Kergon [Tue, 27 Jan 2009 00:40:44 +0000 (00:40 +0000)]
Introduce as-yet-unused replacement vg_read() and vg_read_for_update()
functions.  (mornfall)

15 years ago Replace internal vg_check_status() implementation. (mornfall)
Alasdair Kergon [Mon, 26 Jan 2009 22:42:59 +0000 (22:42 +0000)]
 Replace internal vg_check_status() implementation.  (mornfall)

15 years agoProperly enforce cluster locking in as-yet-unused _vg_lock_and_read. (mornfall)
Alasdair Kergon [Mon, 26 Jan 2009 22:22:07 +0000 (22:22 +0000)]
Properly enforce cluster locking in as-yet-unused _vg_lock_and_read. (mornfall)

15 years agoIntroduce as-yet-unused _vg_lock_and_read() and associated header file
Alasdair Kergon [Mon, 26 Jan 2009 22:13:22 +0000 (22:13 +0000)]
Introduce as-yet-unused _vg_lock_and_read() and associated header file
definitions.

15 years agoRename vg_read() to vg_read_internal(). (mornfall)
Alasdair Kergon [Mon, 26 Jan 2009 19:01:32 +0000 (19:01 +0000)]
Rename vg_read() to vg_read_internal(). (mornfall)

15 years agopost-release
Alasdair Kergon [Mon, 26 Jan 2009 14:46:08 +0000 (14:46 +0000)]
post-release

15 years agoand another one missing
Alasdair Kergon [Mon, 26 Jan 2009 14:40:06 +0000 (14:40 +0000)]
and another one missing

15 years agoAdd stuff people missed.
Alasdair Kergon [Mon, 26 Jan 2009 13:34:07 +0000 (13:34 +0000)]
Add stuff people missed.

15 years agopre-release
Alasdair Kergon [Mon, 26 Jan 2009 13:14:22 +0000 (13:14 +0000)]
pre-release

15 years agoAdd a corosync/DLM cluster service to clvmd.
Christine Caulfield [Thu, 22 Jan 2009 10:21:12 +0000 (10:21 +0000)]
Add a corosync/DLM cluster service to clvmd.

It's not integrated in the configure system yet though.

15 years agoUse tools.h in for lvm-static.
Milan Broz [Tue, 20 Jan 2009 20:37:41 +0000 (20:37 +0000)]
Use tools.h in for lvm-static.

15 years agoAdd --unquoted to pvs, vgs, lvs man pages.
Dave Wysochanski [Tue, 20 Jan 2009 17:39:07 +0000 (17:39 +0000)]
Add --unquoted to pvs, vgs, lvs man pages.

15 years agoAdd missing --segments to pvs man pg.
Dave Wysochanski [Tue, 20 Jan 2009 17:27:11 +0000 (17:27 +0000)]
Add missing --segments to pvs man pg.

15 years agoAdd --nameprefixes to pvs, vgs, lvs man pages.
Dave Wysochanski [Tue, 20 Jan 2009 17:10:44 +0000 (17:10 +0000)]
Add --nameprefixes to pvs, vgs, lvs man pages.

15 years agoFix problems with static build
Milan Broz [Tue, 20 Jan 2009 17:07:53 +0000 (17:07 +0000)]
Fix problems with static build

 - compiler warning (missing header)

 - configure should set static flag early to be able
   use STATIC_LINK flag during configure script

15 years agoAdd --rows option to pvs, vgs, lvs man pages.
Dave Wysochanski [Tue, 20 Jan 2009 16:55:24 +0000 (16:55 +0000)]
Add --rows option to pvs, vgs, lvs man pages.

15 years agoRename _parse_options() to _parse_fields() for naming consistency.
Dave Wysochanski [Mon, 19 Jan 2009 20:53:35 +0000 (20:53 +0000)]
Rename _parse_options() to _parse_fields() for naming consistency.

In libdm, we only ever use 'fields', while the tools use 'options' and
'fields' interchangeably.

Ideally it would be good to use 'fields' consistently everywhere.
However, 'options' most likely comes from the tool commandline '-o' and
'--options' which cannot be changed.

15 years agoAdd skeleton of fsadm nightly test but skip (doesn't work yet).
Dave Wysochanski [Thu, 15 Jan 2009 17:14:38 +0000 (17:14 +0000)]
Add skeleton of fsadm nightly test but skip (doesn't work yet).

15 years agoFix fsadm lvresize for filesystem block sizes != 1024.
Dave Wysochanski [Thu, 15 Jan 2009 14:44:48 +0000 (14:44 +0000)]
Fix fsadm lvresize for filesystem block sizes != 1024.

Fixes rhbz 480022.

15 years agoA C implementation of "not" that handles fatal signals rather more
Petr Rockai [Mon, 12 Jan 2009 18:45:44 +0000 (18:45 +0000)]
A C implementation of "not" that handles fatal signals rather more
intelligently than the shell implementation. C code by Jaroslav Stava.

I have done a rudimentary review and checked that tests still pass.

15 years ago...and a few more uninitialised dummy fields.
Alasdair Kergon [Sat, 10 Jan 2009 17:21:17 +0000 (17:21 +0000)]
...and a few more uninitialised dummy fields.

15 years agoMore fields can cause segfaults with orphans.
Alasdair Kergon [Sat, 10 Jan 2009 17:09:40 +0000 (17:09 +0000)]
More fields can cause segfaults with orphans.
Fix these by populating the dummy VG struct more completely.

15 years agoFix pvs segfault when run with orphan PV and vg_mda_size or vg_mda_free fields
Dave Wysochanski [Sat, 10 Jan 2009 15:04:28 +0000 (15:04 +0000)]
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().

15 years agoFix some checks in lvm-utils.sh. Note that "$(test ...)" is always empty, since
Petr Rockai [Sat, 10 Jan 2009 12:19:41 +0000 (12:19 +0000)]
Fix some checks in lvm-utils.sh. Note that "$(test ...)" is always empty, since
"test" never prints anything. Therefore, "return $(test ...)" is equivalent to
just "return;" which means success in sh (same as return 0). We can however,
thanks to set -e, use "test foo = bar" as an assertion.

PS: test a == b is invalid syntax. It is either = or -eq: = is textual and -eq
is numeric comparison.

15 years agoAdd <report_type>_all to help text.
Alasdair Kergon [Sat, 10 Jan 2009 03:14:24 +0000 (03:14 +0000)]
Add <report_type>_all to help text.

15 years agoAdd an "all" field which expands to all fields of the report type.
Alasdair Kergon [Sat, 10 Jan 2009 03:01:35 +0000 (03:01 +0000)]
Add an "all" field which expands to all fields of the report type.

For example in LVM2, "pv_all" gives all PV fields.
"seg_all" gives all LV segment fields.

"all" gives all fields of the final report type.  I think this is more
useful than just adding the current prefix.

So "lvs -o seg_all" gives all the LV segment fields, whilst
"lvs --segments -o all" adds in LV and VG fields too.

"lvs -o all -O vg_name" has report type LVS+VGS so includes all LV and all
VG fields.

15 years agoDisplay a 'dev_size' of zero for missing devices in reports.
Alasdair Kergon [Sat, 10 Jan 2009 02:43:51 +0000 (02:43 +0000)]
Display a 'dev_size' of zero for missing devices in reports.

15 years agoAdd pv_mda_size to pvs and vg_mda_size to vgs.
Dave Wysochanski [Fri, 9 Jan 2009 22:48:22 +0000 (22:48 +0000)]
Add pv_mda_size to pvs and vg_mda_size to vgs.

15 years agoAdd pv_mda_size to 'pvs' and vg_mda_size to 'vgs'.
Dave Wysochanski [Fri, 9 Jan 2009 22:44:33 +0000 (22:44 +0000)]
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.

15 years agoDocument current state of inconsistent metadata behaviour of a few commands in
Petr Rockai [Fri, 9 Jan 2009 10:16:57 +0000 (10:16 +0000)]
Document current state of inconsistent metadata behaviour of a few commands in
a test. Should make changes to the !consistent bits of code easier. To be
expanded.

15 years agoInitial import of the cluster log daemon from the 'cluster' repository.
Jonathan Earl Brassow [Thu, 8 Jan 2009 17:12:33 +0000 (17:12 +0000)]
Initial import of the cluster log daemon from the 'cluster' repository.

There is a rudimentary make file in place so people can build by hand
from 'LVM2/daemons/clogd'.  It is not hooked into the main build system
yet.  I am checking this in to provide people better access to the
source code.

There is still work to be done to make better use of existing code in
the LVM repository.  (list.h could be removed in favor of existing list
implementations, for example.  Logging might also be removed in favor
of what is already in the tree.)

I will probably defer updating WHATS_NEW_DM until this code is linked
into the main build system (unless otherwise instructed).

15 years agoAdd checks for device names in dmsetup and show proper error messages.
Peter Rajnoha [Wed, 7 Jan 2009 12:17:40 +0000 (12:17 +0000)]
Add checks for device names in dmsetup and show proper error messages.

Checks added for DM device names to allow only names < DM_NAME_LEN,
otherwise a part of lengthy name would be silently ignored and could
cause confusion while using dmsetup. Also, the name should not contain
'/' character, if it is used in context of creating a new device
or renaming the existing one (because we do not consider full path
to devices, they do not exist in filesystem yet) and appropriate error
messages are shown.

15 years agoFix lvmdump /sys listing to include virtual devices directory.
Milan Broz [Tue, 6 Jan 2009 18:02:57 +0000 (18:02 +0000)]
Fix lvmdump /sys listing to include virtual devices directory.

15 years agoFix "Calculate mirror log size" commit, the le_count should be always set.
Milan Broz [Tue, 6 Jan 2009 17:24:21 +0000 (17:24 +0000)]
Fix "Calculate mirror log size" commit, the le_count should be always set.

15 years agoAdd "--refresh" functionality to vgchange and vgmknodes.
Peter Rajnoha [Mon, 22 Dec 2008 09:04:35 +0000 (09:04 +0000)]
Add "--refresh" functionality to vgchange and vgmknodes.

15 years agoAdd "--refresh" functionality to vgchange and vgmknodes.
Peter Rajnoha [Mon, 22 Dec 2008 09:00:51 +0000 (09:00 +0000)]
Add "--refresh" functionality to vgchange and vgmknodes.

15 years agolvm2cmdline.h:31: warning: declaration of `is_static' shadows a global declaration
Alasdair Kergon [Fri, 19 Dec 2008 18:51:02 +0000 (18:51 +0000)]
lvm2cmdline.h:31: warning: declaration of `is_static' shadows a global declaration

15 years agoDo not issue write behind lv size.
Milan Broz [Fri, 19 Dec 2008 15:26:01 +0000 (15:26 +0000)]
Do not issue write behind lv size.

pvcreate $DEV
vgcreate -s 1k vg_test $DEV
lvcreate -l 1 -n lv1 vg_test
..
/dev/vg_test/lv1: write failed after 1024 of 4096 at 0: No space left on device

Just check for maximum write size in set_lv.

15 years agoCalculate mirror log size instead of hardcoding 1 extent size.
Milan Broz [Fri, 19 Dec 2008 15:24:52 +0000 (15:24 +0000)]
Calculate mirror log size instead of hardcoding 1 extent size.

It fails for 1k PE now.

Patch adds log_region_size into allocation habdle struct
and use it in _alloc_parallel_area() for proper log size calculation
instead of hardcoded 1 extent - which can fail.

Reproducer for incorrect log size calculation:
        DEV=/dev/sd[bcd]

        pvcreate $DEV
        vgcreate -s 1k vg_test $DEV
        lvcreate -m1 -L 12M -n mirr vg_test

https://bugzilla.redhat.com/show_bug.cgi?id=477040

The log size calculation is mostly copied from kernel code.

15 years agoFail add tree node when requested major/minor is used.
Milan Broz [Fri, 19 Dec 2008 15:23:03 +0000 (15:23 +0000)]
Fail add tree node when requested major/minor is used.

Check for major/minor collision is added in _add_dev_to_dtree()
where we already read info by uuid,
so in the case of requesting major/minor it queries device-mapper
by major/minor for device availability.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=204992

15 years agoFix incorrect return value in help function.
Peter Rajnoha [Fri, 19 Dec 2008 14:43:02 +0000 (14:43 +0000)]
Fix incorrect return value in help function.

15 years agoFix vgrename using UUID in case there are VGs with the same name.
Peter Rajnoha [Fri, 19 Dec 2008 14:22:48 +0000 (14:22 +0000)]
Fix vgrename using UUID in case there are VGs with the same name.

15 years agoCreate global is_static() to eliminate from the library init function.
Dave Wysochanski [Thu, 18 Dec 2008 05:27:17 +0000 (05:27 +0000)]
Create global is_static() to eliminate from the library init function.

Very simple / crude method of removing 'is_static' from initialization.
Why should we require an application tell us whether it is linked
statically or dynamically to libLVM?  If the application is linked
statically, but libraries exist and dlopen() calls succeed, why
do we care if it's statically linked?

15 years agoRemove struct arg * from struct cmd_context and create_toolcontext().
Dave Wysochanski [Wed, 17 Dec 2008 16:46:45 +0000 (16:46 +0000)]
Remove struct arg * from struct cmd_context and create_toolcontext().

This allows us to remove one argument from create_toolcontext() and
moves it closer to a generic library init function.

In the arg_*() functions, we just use _the_args() directly.
For now we leave the first parameter to these
arg_*() functions (struct cmd_context *) because
of the number of files involved in removing the
parameter.

15 years agoMove arg_* functions from toollib.c to lvmcmdline.c.
Dave Wysochanski [Wed, 17 Dec 2008 16:45:32 +0000 (16:45 +0000)]
Move arg_* functions from toollib.c to lvmcmdline.c.

In preparation for removing cmd->args.
IMO, it makes more sense to put these accessor functions
in the same location as the static array _the_args.
Next patch will update arg_* functions to use _the_args[]
directly and remove cmd->args.

15 years agoRemove status=noxfer from test, not all dd versions support this (RHEL4 for example).
Milan Broz [Tue, 16 Dec 2008 20:02:52 +0000 (20:02 +0000)]
Remove status=noxfer from test, not all dd versions support this (RHEL4 for example).

15 years agoRename 'cmd' to 'clvmd_cmd' to remove ambiguity.
Dave Wysochanski [Tue, 16 Dec 2008 12:30:39 +0000 (12:30 +0000)]
Rename 'cmd' to 'clvmd_cmd' to remove ambiguity.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: James Cameron <james.cameron@hp.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
15 years agoFix segfault when invalid field given in reporting commands.
Dave Wysochanski [Mon, 15 Dec 2008 13:30:45 +0000 (13:30 +0000)]
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

15 years agoUse dm_snprintf to avoid duplicating the snprintf compatibility code.
Alasdair Kergon [Fri, 12 Dec 2008 18:45:58 +0000 (18:45 +0000)]
Use dm_snprintf to avoid duplicating the snprintf compatibility code.

15 years agoCreate _init_globals() and call from bottom of create_toolcontext().
Dave Wysochanski [Fri, 12 Dec 2008 03:30:41 +0000 (03:30 +0000)]
Create _init_globals() and call from bottom of create_toolcontext().

Move init_full_scan_done(0) and init_mirror_in_sync(0) from init_lvm()
after call to create_toolcontext() to _init_globals(), called from bottom
of create_toolcontext().  No functional change.

Author: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: James Cameron <james.cameron@hp.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
15 years agoReplace _dm_snprintf with EMIT_PARAMS macro for creating target lines
Zdenek Kabelac [Thu, 11 Dec 2008 16:25:51 +0000 (16:25 +0000)]
Replace _dm_snprintf with EMIT_PARAMS macro for creating target lines

15 years ago*** empty log message ***
Dave Wysochanski [Thu, 11 Dec 2008 13:45:28 +0000 (13:45 +0000)]
*** empty log message ***

15 years agoMove initialization of cmd->fmt into init_formats().
Dave Wysochanski [Thu, 11 Dec 2008 03:36:16 +0000 (03:36 +0000)]
Move initialization of cmd->fmt into init_formats().

init_formats() sets up the command formats, and currently sets cmd->fmt_backup
but does not set cmd->fmt to a default value.  This seems incorrect so we
set it to cmd->default_settings.fmt before returning.

The call we remove here may set cmd->fmt based on a command line setting.
But it is safe to remove this, because the only caller of init_lvm() that
cares about the cmdline override is the cmdline tools (clvmd does not care),
called from lvm2_main().  After lvm2_main() calls init_lvm(), it later calls
lvm_run_command().  In lvm_run_command(), we have a call to _apply_settings(),
which has the identical assignment of cmd->fmt that this patch removes.

15 years agoRemove redundant init_msg_prefix() and init_cmd_name().
Dave Wysochanski [Thu, 11 Dec 2008 03:34:43 +0000 (03:34 +0000)]
Remove redundant init_msg_prefix() and init_cmd_name().

This is very obvious - _init_logging() makes the identical init_msg_prefix()
and init_cmd_name() calls with cmd->default_settings so these calls are
clearly redundant after calling create_toolcontext().

15 years agoRemove redundant set_activation() call after create_toolcontext() calls.
Dave Wysochanski [Thu, 11 Dec 2008 03:34:12 +0000 (03:34 +0000)]
Remove redundant set_activation() call after create_toolcontext() calls.

Very similar argument to removal of init_debug() and other calls.

create_toolcontext() calls _process_config() which sets
cmd->default_settings.activation, then calls
set_activation(cmd->default_settings.activation).  Later, create_toolcontext()
sets cmd->current_settings = cmd->default_settings.  So these calls
set_activation(cmd->current_settings.activation) are redundant.

15 years agoRemove backup_enable() calls after create_toolcontext() calls.
Dave Wysochanski [Thu, 11 Dec 2008 03:33:35 +0000 (03:33 +0000)]
Remove backup_enable() calls after create_toolcontext() calls.

Identical argument to previous patch which removed archive_enable() calls.
We add a new parameter to backup_init() which sets the enable value based
on the cmd->default_settings.backup value.  This value was used to set
cmd->current_settings.backup, used in the removed backup_enable() call.

15 years agoRemove archive_enable() calls after create_toolcontext() calls.
Dave Wysochanski [Thu, 11 Dec 2008 03:32:56 +0000 (03:32 +0000)]
Remove archive_enable() calls after create_toolcontext() calls.

_init_backup() calls archive_init(), which originally set 'enabled' to
a hardcoded '1' value.  This seems incorrect based on my read of other
areas of the code so here we add a 'enabled' paramter to archive_init().
We pass in cmd->default_settings.archive, which is obtained from the
config tree.  Later in create_toolcontext, cmd->current_settings is
set to cmd->default_settings.  The archive_enable() call we remove
here was using cmd->current_settings to set the 'archive' enable
value.  The final value of cmd->archive_params->enabled should thus
be equivalent to the original code.

15 years agoMove init_test() from _apply_settings into _init_logging().
Dave Wysochanski [Thu, 11 Dec 2008 03:31:47 +0000 (03:31 +0000)]
Move init_test() from _apply_settings into _init_logging().

This one we actually need to move.  _init_logging() is called from
    create_toolcontext(), which makes this call:
        /* Test mode */
        cmd->default_settings.test =
            find_config_tree_int(cmd, "global/test", 0);

But it does not call init_test().  So we need an init_test() somewhere.
The most logical place is to put it inside _init_logging(), since this
is where the config value is read and default_settings are set.  Placing
the init_test() call here matches what is done with other variables and
seems to make sense.

15 years agoRemove handles_missing_pvs assignment after call to create_toolcontext().
Dave Wysochanski [Thu, 11 Dec 2008 03:31:10 +0000 (03:31 +0000)]
Remove handles_missing_pvs assignment after call to create_toolcontext().

This variable is set at the top of create_toolcontext() to 0.
Nothing later in create_toolcontext() changes the value.
In init_lvm(), nothing between create_toolcontext() call and this assignment
changes the value.  Thus, the assignment is redundant.

15 years agoRemove init_verbose() calls immediately after create_toolcontext() calls.
Dave Wysochanski [Thu, 11 Dec 2008 03:30:19 +0000 (03:30 +0000)]
Remove init_verbose() calls immediately after create_toolcontext() calls.

The rationale for removing init_verbose() call is very similar to removing
init_debug() call.  create_toolcontext() calls _init_logging() which
makes these calls:
        /* Verbose level for tty output */
        cmd->default_settings.verbose =
            find_config_tree_int(cmd, "log/verbose", DEFAULT_VERBOSE);
        init_verbose(cmd->default_settings.verbose + VERBOSE_BASE_LEVEL);

And being that create_toolcontext() copies default_settings into
current_settings at the bottom, the init_verbose() call we are removing:
        init_verbose(cmd->current_settings.verbose + VERBOSE_BASE_LEVEL);

is redundant.

15 years agoRemove init_debug() calls immediately after create_toolcontext() call.
Dave Wysochanski [Thu, 11 Dec 2008 03:29:37 +0000 (03:29 +0000)]
Remove init_debug() calls immediately after create_toolcontext() call.

We can safely remove because create_toolcontext() calls _init_logging(),
which makes these calls:
        /* Debug level for log file output */
        cmd->default_settings.debug =
            find_config_tree_int(cmd, "log/level", DEFAULT_LOGLEVEL);
        init_debug(cmd->default_settings.debug);

Then at the bottom of create_toolcontext() we do this:
        cmd->current_settings = cmd->default_settings;

So the call we are removing from init_lvm() functions (clvmd and lvmcmdline):
        init_debug(cmd->current_settings.debug);

Just sets the value of debug based on 'cmd->current_settings.debug'.
Since cmd->current_settings is equivalent to cmd->default_settings, and
init_debug() was called with cmd->default_settings, the call we remove is
redundant.

15 years agoReplace _apply_settings() after create_toolcontext() with equivalent inline.
Dave Wysochanski [Thu, 11 Dec 2008 03:28:54 +0000 (03:28 +0000)]
Replace _apply_settings() after create_toolcontext() with equivalent inline.

Subsequent patches will refactor / remove each of these lines, as many of
them are redundant when called immediately after create_toolcontext().

15 years agooperate on test subdirectory instead on main /dev
Zdenek Kabelac [Wed, 10 Dec 2008 16:16:53 +0000 (16:16 +0000)]
operate on test subdirectory instead on main /dev

15 years agoadd simple test for dev node usability (detect devices mounted with nodev)
Zdenek Kabelac [Wed, 10 Dec 2008 16:15:41 +0000 (16:15 +0000)]
add simple test for dev node usability (detect devices mounted with nodev)

15 years agoAdd liblvm interactive test infrastructure to build.
Dave Wysochanski [Sun, 7 Dec 2008 19:37:07 +0000 (19:37 +0000)]
Add liblvm interactive test infrastructure to build.

15 years agoMake _init_rand() thread safe - use rand_r() instead of rand().
Dave Wysochanski [Sun, 7 Dec 2008 04:27:56 +0000 (04:27 +0000)]
Make _init_rand() thread safe - use rand_r() instead of rand().

Use good entropy for seed value if possible.

15 years agoAdd generic function to read /dev/urandom, used in uuid calculation.
Dave Wysochanski [Sun, 7 Dec 2008 04:23:37 +0000 (04:23 +0000)]
Add generic function to read /dev/urandom, used in uuid calculation.

15 years agoFix test-utils.h for rhel4 backward compatability.
Dave Wysochanski [Fri, 5 Dec 2008 05:03:23 +0000 (05:03 +0000)]
Fix test-utils.h for rhel4 backward compatability.

for losetup, break out of the loop when successful setup of loop device,
and only look at 7 loop devices (default loop module setting)
for blockdev, use old option if new one is not available

15 years agoAdded displayable_lvs_in_vg and lv_is_displayable functions to deal with
Peter Rajnoha [Thu, 4 Dec 2008 15:54:26 +0000 (15:54 +0000)]
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.

15 years agoFix vgcreate race which could allow two parallel vgcreates to succeed,
Dave Wysochanski [Mon, 1 Dec 2008 20:14:33 +0000 (20:14 +0000)]
Fix vgcreate race which could allow two parallel vgcreates to succeed,
with the second vgcreate overwriting the first.

Obtain lock before calling vg_create(), which checks for existence of vgname
and fails if it already exists.

15 years agoFix uninitialised lv_count in vgdisplay -c
Alasdair Kergon [Mon, 1 Dec 2008 17:38:35 +0000 (17:38 +0000)]
Fix uninitialised lv_count in vgdisplay -c

15 years agoSuppress 'duplicate PV' message when it's only a cache update not a real
Alasdair Kergon [Fri, 28 Nov 2008 15:51:40 +0000 (15:51 +0000)]
Suppress 'duplicate PV' message when it's only a cache update not a real
duplicate.

15 years agoDon't skip updating pvid hash when lvmcache_info struct got swapped.
Alasdair Kergon [Thu, 27 Nov 2008 18:13:50 +0000 (18:13 +0000)]
Don't skip updating pvid hash when lvmcache_info struct got swapped.

15 years agoAdd tinfo to termcap search path for pld-linux.
Alasdair Kergon [Mon, 24 Nov 2008 13:33:16 +0000 (13:33 +0000)]
Add tinfo to termcap search path for pld-linux.

16 years agoFix a starup race in clvmd that could result in huge waits for the first command...
Christine Caulfield [Fri, 21 Nov 2008 13:48:00 +0000 (13:48 +0000)]
Fix a starup race in clvmd that could result in huge waits for the first command to be processed.

16 years agogenerate init script
Alasdair Kergon [Wed, 19 Nov 2008 20:14:24 +0000 (20:14 +0000)]
generate init script

16 years agoregenerate
Alasdair Kergon [Wed, 19 Nov 2008 19:34:32 +0000 (19:34 +0000)]
regenerate

16 years agoGenerate clvmd init script at configuration time for Red Hat-based distros.
Alasdair Kergon [Wed, 19 Nov 2008 19:33:25 +0000 (19:33 +0000)]
Generate clvmd init script at configuration time for Red Hat-based distros.

This page took 0.070288 seconds and 5 git commands to generate.