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

1933 Commits

Author SHA1 Message Date
Zdenek Kabelac
0b6ee2252c Use absolute paths in commands
clvmd restart does not work at all if clvmd binary is not in current
dir.
2010-06-03 13:50:26 +00:00
Dave Wysochanski
224457fb0f Revert _init_rand() to reset errno - restores original init behavior. 2010-06-01 21:47:57 +00:00
Dave Wysochanski
cacbf14d8e Do not fail lvm_init() if init_logging() generates an errno.
Revert to original behavior of lvm commands if init_logging() generated an
errno.  Fixes rhbz 592967.
2010-06-01 21:46:29 +00:00
Alasdair Kergon
b00dc7153a Don't merge unchanged persistent cache file before dumping if tool scanned. 2010-06-01 19:02:12 +00:00
Peter Rajnoha
97617cfc76 Fix incorrect memory pool deallocation while using vg_read for files.
We create a separate pool "lvm2 vg_read" for vg_read and we don't use
cmd->mem anymore.
2010-06-01 12:08:50 +00:00
Alasdair Kergon
bc653452a7 Replace strncmp kernel version number checks with proper ones 2010-05-24 23:11:34 +00:00
Alasdair Kergon
ca92b9a5f0 Avoid selecting names under /dev/block if there is an alternative. 2010-05-24 22:53:48 +00:00
Alasdair Kergon
fa7fa300e3 Choose between clustered log versions based on kernel version.
Add fixmes for broken strcmp.
2010-05-24 17:46:47 +00:00
Alasdair Kergon
4e553333d9 Update clustered log kernel module name to log-userspace. 2010-05-24 16:30:15 +00:00
Petr Rockai
954df8f3d7 Account for mirror transient status when doing lvconvert --repair. 2010-05-24 15:32:20 +00:00
Zdenek Kabelac
c4655582e6 Update Copyright date for resently modifed files 2010-05-24 09:04:27 +00:00
Zdenek Kabelac
f20300cc8b Replicator: add replicator to dtree
Adding all replicator related LVs to dtree.
Start of one replicator_dev initiate start of all other related.
2010-05-24 09:01:05 +00:00
Zdenek Kabelac
c5eb266a80 Replicator: update _create_partial_dtree()
Adding function _add_partial_replicator_to_dtree() to create
partial tree for Replicator target.

Using dm_tree_node_set_presuspend_node() for Replicator.
2010-05-21 14:47:58 +00:00
Zdenek Kabelac
04f3cea84a Replicator: activate checks for missing vgs
Activation needs to have all remote VGs locked to pass for replicator.
So if activated LV is replicator-dev LV - read all remote VGs.
2010-05-21 14:34:01 +00:00
Zdenek Kabelac
c1fe5092c3 Replicator: lock_lv_vol() finds missing VGs
Find and check for all needed VGs before calling lock_vol().
2010-05-21 14:29:49 +00:00
Zdenek Kabelac
8571d54f61 Replicator: add read and release VGs for rsites
Add functions to read and release remote VGs for replicator sites
in activation context.
2010-05-21 14:07:16 +00:00
Zdenek Kabelac
13fed1e445 Add toolcontext.h header file. 2010-05-21 13:34:09 +00:00
Zdenek Kabelac
2179ff624c Remove files from wrong directory 2010-05-21 13:18:25 +00:00
Zdenek Kabelac
8b3434061e Right directory name for replicator files.
My local CVS was placing file in slightly different directory by using
obsolete files.
2010-05-21 13:17:20 +00:00
Zdenek Kabelac
68a6a348b5 Hmm - fixing cvs import mistake 2010-05-21 13:14:02 +00:00
Zdenek Kabelac
d8659175cd Replicator: add find_replicator_vgs
Adding find_replicator_vgs() function to find all needed
VGs for replicator-dev LV.

This function is later called before taking lock_vol().
2010-05-21 12:55:25 +00:00
Zdenek Kabelac
1431ddad9c Replicator: add sorted cmd_vg list
Introduce struct cmd_vg to store information about needed
volume group name, vgid, flags and the pointer to opened VG.

Keep VGs list in alphabetical order for locking order.

Introduce functions:
cmd_vg_add() add new cmd_vg entry.
cmd_vg_lookup() search cmd_vgs for vg_name.
cmd_vg_read() open VGs in cmd_vgs list.
cmd_vg_release() close VGs in reversed order.
2010-05-21 12:52:01 +00:00
Zdenek Kabelac
5f860775c8 Replicator: extend volume_group with list of VGs and flag
Add pointer to linked list of opened VGs. List temporarily keeps
the information about needed or locked and opened VGs for replicator target.

Also add cmd_missing_vgs flag information for quick check and
also for possible continuos process_each_lv() usage where we need
to detect whether failure has been caused by missing VG or
some other reason.
2010-05-21 12:47:46 +00:00
Zdenek Kabelac
65f5ed533f Replicator: extend _lv_each_dependency() with dependencies for Replicator devices 2010-05-21 12:45:18 +00:00
Zdenek Kabelac
c4276aad11 Replicator: check replicator segment
Check for possible problems within replicator structures.
Used also by vg_validate.
2010-05-21 12:43:02 +00:00
Zdenek Kabelac
d4ae0dedf2 Replicator: new files for Replicator target 2010-05-21 12:40:05 +00:00
Zdenek Kabelac
312a15d24e Replicator: base lvm2 support
Adding configure.in support for Replicators.
Adding basic lib lvm support for Replicators.
Adding flags REPLICATOR and REPLICATOR_LOG.
Adding segments SEG_REPLICATOR and SEG_REPLICATOR_DEV.
Adding basic methods for handling replicator metadata.
2010-05-21 12:36:30 +00:00
Alasdair Kergon
6b3f81e647 backup->cache 2010-05-20 22:32:44 +00:00
Alasdair Kergon
eedf87f891 If unable to obtain snapshot percentage leave value blank on reports. 2010-05-20 22:24:33 +00:00
Alasdair Kergon
ae1ec1b418 Add install_system_dirs makefile target.
Add configure options for system and locking directories.
2010-05-20 13:47:21 +00:00
Dave Wysochanski
ada4c61860 Add find_vgname_from_{pvname|pvid} functions.
Some commands start with a pvname, but we'd like to force users to
start with a vg handle to obtain a pv handle.  Our best option seems
to be providing a way to look up the vgname from the pvname, and then
require them to use vg_read/vg_open.

In addition to the pvname lookup function, this patch also provides a
lookup by pvid.  The lookup by pvid can be used in conjunction with
lvmcache_get_pvids to process all pvs in the system.

The pvid find function first calls lvmcache_vgname_from_pvid, which may
cause the label to be read if it is not in the cache.  If the vgname is
returned is an orphan, we then check to see if there are metadata areas,
and if not, we scan every PV on the system by calling scan_vgs_for_pvs().
In most cases we should not need to do this, and by using the info->mdas
count, we avoid calling pv_read() as prior code did.  So this patch is a
bit cleaner and should allow us to refactor more of the pv code.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-05-19 11:52:37 +00:00
Dave Wysochanski
9bcaa94756 Add lvmcache_vgname_from_pvid().
Add lvmcache function to lookup a vgname from a pvid.
2010-05-19 11:52:21 +00:00
Dave Wysochanski
49a81e190e Add pvid_from_devname() lvmcache function.
Add supporting function for mappings from devname -> pvid -> vgname.
2010-05-19 11:52:07 +00:00
Alasdair Kergon
5303eca8fa Add is_global_vg and split out from is_orphan_vg. 2010-05-19 02:36:33 +00:00
Alasdair Kergon
1b37183e74 Validate orphan and VG_GLOBAL lock order too. 2010-05-19 02:08:50 +00:00
Alasdair Kergon
09f17bf72d Note that orphan lock is always obtained last 2010-05-19 01:49:08 +00:00
Alasdair Kergon
449ffc7b05 Accept orphan VG names as parameters to lock_vol() and related functions. 2010-05-19 01:16:40 +00:00
Alasdair Kergon
bea9cf6725 Use is_orphan_vg in place of hard-coded prefix tests. 2010-05-19 00:52:55 +00:00
Alasdair Kergon
3eb97ffa25 pre-release 2010-05-17 18:39:01 +00:00
Jonathan Earl Brassow
0d272a6964 Disallow toggling the cluster attribute of a volume group if there
are active mirrors or snapshots.

We don't have the mechanisms in place to change the device-mapper
tables for those targets that have behavioral differences between
cluster and single machine instances.  Allowing users to change
the attribute but not changing the target's behavior can lead to
data corruption.

The following bugs are fixed/avoided by this patch:
235123 - vgchange -c [ny] do not change target types when necessary
289331 - RFE: switching from cluster domain to local domain needs to deactivate volume somehow
289541 - when changing from local to cluster, volumes can not appear to be deactivated
2010-05-14 15:19:42 +00:00
Milan Broz
5899d9b442 Another one internal device layer fix... 2010-05-14 12:39:52 +00:00
Milan Broz
40026b0762 Fix empty layer detection is scan devices. 2010-05-14 12:30:43 +00:00
Milan Broz
83b4f8366a Fix device_is_usable to properly detect only internal LV names. 2010-05-14 12:03:32 +00:00
Milan Broz
2b129732b0 Skip also special lvm devices in scan (if ignore suspended is used).
This should avoid various races between dmeventd on multiple nodes
in cluster where one node already repairing device and another
run full scan and locks the device.
2010-05-13 18:38:38 +00:00
Milan Broz
5ee39f1a1d Currently if clvmd is running and user issues vgscan,
the device cache file is dumped both in vgscan and clvmd process.

Unfortunately, clvmd calls lvmcache_label_scan,
it properly destroys persistent filter, but during
persistent_filter_dump it merges old cache content back!

This causes that change in filters is not properly propagated
into device cache after vgscan on cluster.
(Only new devices are added.)

https://bugzilla.redhat.com/show_bug.cgi?id=591861
2010-05-13 13:04:03 +00:00
Peter Rajnoha
ac24748b47 Add new --sysinit option for vgchange and lvchange.
A shortcut for --ignorelockingfailure, --ignoremonitoring, --poll n options
and LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable used all at
once in initialisation scripts (e.g. rc.sysinit or initrd).
2010-05-06 11:15:55 +00:00
Zdenek Kabelac
cd3475a8cb Install plugins to subdirs
Target install_dm_plugin installs files to libdir/device-mapper.
Target install_lvm2_plugin installs files to libdir/lvm2.

Both targets creates relative links to libdir to keep the code
compatible with current dlopen handling.

Once we will be able to read plugins from subdir, links
could be removed.
2010-05-06 10:07:46 +00:00
Petr Rockai
9d3faa4753 Suppress duplicate error messages about read failures and missing devices. 2010-05-05 22:37:52 +00:00
Zdenek Kabelac
4f732b1989 Initialise _vginfos list staticaly so there is no problem with using uninitialised
variables in case, lvmcache_destory() is called without lvmcache_init().
2010-04-30 12:54:31 +00:00
Zdenek Kabelac
78b8276111 Release pools for regex if there is error during processing
(fixes error messages about unreleased pools).
2010-04-30 12:37:04 +00:00