Dave Wysochanski
0589e19fd7
Update error return and comments for lvm_list_vg_names/uuids.
...
The two liblvm functions that return a list of vgnames and vguuids use
cmd->mem to allocate the list. Make it clear to the caller that this
memory will be freed when the LVM handle is freed.
Clean up and clarify the return value of the functions. In the
case of a memory allocation error, add a couple log_errnos to the internal
code, and make it clear that memory allocation returns a NULL pointer.
If there are no VGs in the system, the list returned is an empty list.
Make a note of the fact that currently we return hidden VG names, how
these can be detected (always start with "#"), and that they should
not be used.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-27 11:00:17 +00:00
Milan Broz
bf3423d355
Fix pool leak in lvmcache_read_vg error path.
...
(Introduced in previous patches.)
2009-04-24 12:03:55 +00:00
Alasdair Kergon
9b99f3337b
Index cached vgmetadata by vgid not vgname to cope with duplicate vgnames. (dwyso)
2009-02-17 18:56:41 +00:00
Alasdair Kergon
615de1b59b
Suppress 'duplicate PV' message when it's only a cache update not a real
...
duplicate.
2008-11-28 15:51:40 +00:00
Alasdair Kergon
e2675481f0
Don't skip updating pvid hash when lvmcache_info struct got swapped.
2008-11-27 18:13:50 +00:00
Alasdair Kergon
2c44337bd5
Right, a simple build (without options) is working again.
2008-11-03 22:14:30 +00:00
Alasdair Kergon
a0e00ccf3f
Avoid repeatedly wiping cache while VG_GLOBAL is held in vgscan & pvscan.
2008-09-16 18:05:11 +00:00
Alasdair Kergon
59743245b4
Fix up cache for PVs without mdas after consistent VG metadata is processed.
2008-06-27 15:18:31 +00:00
Alasdair Kergon
56637f2a85
Fix tracking of validity of PVs with no mdas in lvmcache.
2008-06-11 11:02:05 +00:00
Alasdair Kergon
80b7fe0e88
Fix segfault after _free_vginfo by remembering to remove vginfo from list.
2008-06-09 16:22:33 +00:00
Alasdair Kergon
f0dfe9dcda
fix _free_vginfo not to remove a ref to a *different* vginfo from the vgid cache
2008-06-06 12:43:40 +00:00
Alasdair Kergon
d0de492ff3
cope with volatile vginfo in vg_read
2008-06-06 11:12:50 +00:00
Alasdair Kergon
e350c2f648
Decode numbers in clvmd debugging output.
2008-06-05 14:24:28 +00:00
Alasdair Kergon
e4b34bfad0
When activating, if precommitted metadata is still cached, assume it's live.
2008-06-05 13:06:39 +00:00
Alasdair Kergon
bdce11cb30
Avoid spurious duplicate VG messages referring to VGs that are gone.
...
(untested)
2008-05-28 22:27:47 +00:00
Alasdair Kergon
fc54be1062
Refactor some vginfo manipulation code.
2008-05-19 19:49:56 +00:00
Alasdair Kergon
98fd1ce332
More P_ and V_ lock cleanup.
2008-05-09 18:45:15 +00:00
Alasdair Kergon
3d6af3e35e
Add missing mutex around clvmd lvmcache_drop_metadata library call.
2008-05-09 15:13:20 +00:00
Alasdair Kergon
3835ad6b1c
When asked to drop cached committed VG metadata, invalidate cached PV labels.
2008-05-08 18:28:27 +00:00
Alasdair Kergon
d3ccaf8ae5
remove unused lvmcache_drop_vg prototype
2008-05-08 18:00:47 +00:00
Alasdair Kergon
b5618c07d8
Exclude VG_GLOBAL from internal concurrent VG lock counter.
...
(Avoids 'device left open' warning messages from vgscan etc.)
2008-04-24 02:22:07 +00:00
Alasdair Kergon
082628eb2c
missing stack
2008-04-15 14:57:12 +00:00
Milan Broz
581b17def2
Drop cached VG metadata before and after committing changes to it.
2008-04-15 14:46:19 +00:00
Alasdair Kergon
8b1ae3c140
Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34)
2008-04-14 19:24:16 +00:00
Alasdair Kergon
6eb44b5091
Fix vgreduce to use vg_split_mdas to check sufficient mdas remain.
...
Add (empty) orphan VGs to lvmcache during initialisation.
Fix orphan VG name used for format_pool.
2008-04-08 12:49:21 +00:00
Alasdair Kergon
906935e580
Add some basic internal VG lock validation.
2008-04-03 18:56:40 +00:00
Alasdair Kergon
bf7dea978e
Add per-command flags to control which commands use the VG metadata cache.
2008-04-02 21:23:39 +00:00
Alasdair Kergon
6e210a6c54
Cache VG metadata internally while VG lock is held.
2008-04-01 22:40:13 +00:00
Alasdair Kergon
7284f3f966
preparation for vg cache
2008-03-17 16:51:31 +00:00
Alasdair Kergon
bb097a97ea
split orphan VG by format type
2008-02-06 15:47:28 +00:00
Alasdair Kergon
16e2a5aa3b
only read labels once between each lock event
2008-01-30 16:18:37 +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
962b2a559d
Rely upon internally-cached PV labels while corresponding VG lock is held.
2008-01-29 23:45:48 +00:00
Alasdair Kergon
180b4569e2
fix inverted orphan test
2007-11-05 17:12:50 +00:00
Bryn M. Reeves
8b98c12815
Add is_orphan_vg() and change all hardcoded checks to use it.
2007-11-02 13:06:42 +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
17a6fc0b45
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
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
e3ad1d19d5
Add --trustcache option to reporting commands in preparation for supporting
...
event-driven model. Without changes to the way the cache gets updated, the
option is currently unreliable without a global lock to prevent any lvm2
commands from running concurrently.
2006-08-01 14:56:33 +00:00
Alasdair Kergon
2415c1ef87
Fix PV tools to include orphaned PVs in default output again.
2006-06-14 20:11:22 +00:00
Alasdair Kergon
898e6f8e41
Add mirror_library description to example.conf.
...
More compile-time cleanup.
2006-05-11 17:58:58 +00:00
Alasdair Kergon
2c7fbadeef
more coverity fixes
2006-05-10 17:49:25 +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
26b2524996
Invalidate cache if composition of VG changed externally.
2006-04-21 19:12:41 +00:00
Alasdair Kergon
05ffaffe0c
Fix vgid string termination in recent cache code.
2006-04-21 14:44:33 +00:00
Alasdair Kergon
dbd3026f8a
vgrename accepts vgid and exported VG.
2006-04-13 21:08:29 +00:00
Alasdair Kergon
2ab16287e6
When choosing between identically-named VGs, also consider creation_host.
2006-04-13 17:32:24 +00:00
Alasdair Kergon
a5fe5a7cdd
Fix vgexport/vgimport to set/reset PV exported flag so pv_attr is correct.
...
Add vgid to struct physical_volume and pass with vg_name to some functions.
2006-04-12 21:23:04 +00:00
Alasdair Kergon
e8db70239e
If two or more VGs are found with the same name, use one that is not exported.
2006-04-12 17:54:11 +00:00