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

91 Commits

Author SHA1 Message Date
Petr Rockai
97a4b5165e Replace const usage of dm_config_find_node with more appropriate value-lookup
functionality. A number of bugs (copied and pasted all over the code) should
disappear:

- most string lookup based on dm_config_find_node would segfault when
  encountering a non-zero integer (the intention there was to print an
  error message instead)
- check for required sections in metadata would have been satisfied by
  values as well (i.e. not sections)
- encountering a section in place of expected flag value would have
  segfaulted (due to assumed but unchecked cn->v != NULL)
2011-08-31 15:19:19 +00:00
Petr Rockai
e59e2f7c3c Move the core of the lib/config/config.c functionality into libdevmapper,
leaving behind the LVM-specific parts of the code (convenience wrappers that
handle `struct device` and `struct cmd_context`, basically). A number of
functions have been renamed (in addition to getting a dm_ prefix) -- namely,
all of the config interface now has a dm_config_ prefix.
2011-08-30 14:55:15 +00:00
Zdenek Kabelac
3c9ff9e142 Use lv_activate_opts struct instead of ACTIVATE_EXCL status flag. 2011-06-17 14:17:16 +00:00
Zdenek Kabelac
81beded3af Add lv_activate_opts structure
To avoid modification of 'read-only' volume group structure
add a new structure to pass local data around the code for LV
activation.

As origin_only is one such flag - replace this parameter with new
struct lv_activate_opts.

More parameters might eventually become part of lv_activate_opts.
2011-06-17 14:14:19 +00:00
Petr Rockai
833a287337 Make vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can be
issued repeatedly on the same VG, keeping the PARTIAL_LV flags up to date.
2011-05-07 13:32:05 +00:00
Alasdair Kergon
919ab56b6d pre-release clean-ups 2011-04-29 00:21:13 +00:00
Jonathan Earl Brassow
58bdd1654b Replace malloc with zalloc when creating segment_type's 2011-03-25 21:59:42 +00:00
Zdenek Kabelac
ab8b85fb80 Fix !DEVMAPPER_SUPPORT build
Fix build when devmapper is disabled.
2011-02-18 14:29:39 +00:00
Zdenek Kabelac
a5d006d515 Remove unused variable mirr_state and its assignment 2011-01-05 12:27:56 +00:00
Zdenek Kabelac
9d9de35dca Remove const usage from destroy callbacks
As const segment_type or const format_type are never released
use their non-const version and remove const downcast from dm_free calls.
This change fixes many gcc warnings we were getting from them.
2010-12-20 13:32:49 +00:00
Zdenek Kabelac
760d1fac55 Add more strict const pointers around config tree
To have better control were the config tree could be modified use more
const pointers and very carefully downcast them back to non-const
(for config tree merge).
2010-12-20 13:12:55 +00:00
Zdenek Kabelac
414813e349 Check lv_info() success
Add log_error message for lv_info failure and exit from futher
processing.

Replace 'leg' occurence in debug message with 'image' which
is used in other messages.
2010-12-01 13:01:36 +00:00
Petr Rockai
8191fe4f4a Refactor the percent (mirror sync, snapshot usage) handling code to use
fixed-point values instead of a combination of a float value and an enum.
2010-11-30 11:53:31 +00:00
Alasdair Kergon
2d6fcbf67d Allow internal suspend and resume of origin without its snapshots. 2010-08-17 16:25:32 +00:00
Alasdair Kergon
f92b4f9482 Monitor origin -real device below snapshot instead of overlay device. (brassow) 2010-08-17 01:16:41 +00:00
Alasdair Kergon
d1e8046f56 Various small cleanups and fixes related to monitoring. 2010-08-16 22:54:35 +00:00
Petr Rockai
851aaf4ecc Reduce severity of the "mirror transient status" log message (this was never
intended to be a log_error).
2010-08-04 15:55:03 +00:00
Jonathan Earl Brassow
9baacefc77 Building without the '--enable-cmirrord' option means that
CMIRRORD_PIDFILE is not defined.  This makes the build fail.
Therefore, we need to conditionalize the check for cmirrord
based on if CMIRRORD_PIDFILE is defined.
2010-07-21 15:21:24 +00:00
Jonathan Earl Brassow
405c4a45d8 It's not enough to check for the kernel module in the case of cluster
mirrors, we must also check that the log daemon (cmirrord) is running.
The log module can be auto-loaded, but the daemon cannot be
"auto-started".  Failing to check for the daemon produces cryptic
messages that customers have a hard time deciphering.  (The system
messages do report that the log daemon is not running, but people
don't seem to find this message easily.)

Here are examples of what is printed when the module is available,
but the log daemon has not been started.

[root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg
  Shared cluster mirrors are not available.

[root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg -v
    Setting logging type to disk
    Finding volume group "vg"
    Archiving volume group "vg" metadata (seqno 3).
    Creating logical volume lv
    Executing: /sbin/modprobe dm-log-userspace
    Cluster mirror log daemon is not running
  Shared cluster mirrors are not available.
    Creating volume group backup "/etc/lvm/backup/vg" (seqno 4).
2010-07-21 13:40:21 +00:00
Alasdair Kergon
08f1ddea6c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
Alasdair Kergon
ba61f84874 Replace strncmp kernel version number checks with proper ones 2010-05-24 23:11:34 +00:00
Alasdair Kergon
5782a38543 Choose between clustered log versions based on kernel version.
Add fixmes for broken strcmp.
2010-05-24 17:46:47 +00:00
Alasdair Kergon
1493f24e3e Update clustered log kernel module name to log-userspace. 2010-05-24 16:30:15 +00:00
Petr Rockai
d345bf2cd3 Account for mirror transient status when doing lvconvert --repair. 2010-05-24 15:32:20 +00:00
Peter Rajnoha
bda3982016 Use UUIDs instead of names while processing event handlers.
Internally, we used DM names instead of UUIDs while processing event
handlers. This caused problems while trying to vgrename a VG with active LVs
where the names are being changed and so the devices were not found then.
The patch also contains a little bit of refactoring, moving "build_dlid" code
found in dev_manager.c to "build_dm_uuid", now in lvm-string.c (so we have
build_dm_uuid and build_dm_name at one place).
2010-04-14 13:01:38 +00:00
Zdenek Kabelac
a362bb23c0 Use macro outsize() with check for error return value. 2010-01-07 14:46:51 +00:00
Milan Broz
20babc7b4f Fix pvmove region_size overflow for very large PVs.
Fixes problem reported in
https://www.redhat.com/archives/dm-devel/2009-November/msg00104.html

The region size multiplication can overflow when using 32bit integer.
2009-11-18 16:48:10 +00:00
Alasdair Kergon
78ad1549a5 Introduce percent_range_t and centralise snapshot full/mirror in-sync checks. 2009-10-01 00:35:29 +00:00
Jonathan Earl Brassow
03c65b7ade mirror table generating code: Properly handle 'block_on_errors' and 'cluster' features
The device-mapper mirror CTR table has been changing over time.  This has
now been corrected to handle the old and new methods for invoking the
'block_on_errors' and 'cluster' features.  (The code that does this was
accidentally committed in the previous check-in.  This check-in finishes
the job.)
2009-08-13 19:36:04 +00:00
Milan Broz
25497e2fa5 Fix confusing metadata syntax error messages.
If there is syntax error in metadata, it now prints messages
like:
  Couldn't read 'start_extent' for segment 'extent_count'.
  Couldn't read all logical volumes for volume group vg_test.

The segment specification is wrong and confusing.

Patch fixes it by introducing "parent" member in config_node which
points to parent section and config_parent_name function, which
provides pointer to node section name.

Also it adds several LV references where possible.
2009-07-09 11:29:00 +00:00
Alasdair Kergon
81680dce3c Fix last check-ins: seg can be NULL. 2009-02-28 20:04:24 +00:00
Alasdair Kergon
ed82bfd2ba Attempt cleanup in child before execing new binary in exec_cmd() 2009-02-28 00:54:06 +00:00
Alasdair Kergon
2c44337bd5 Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
Alasdair Kergon
2cde7dfdb3 add libdevmapper-event.h 2008-10-31 22:41:51 +00:00
Alasdair Kergon
9125b72b15 Change clustered mirror kernel module name from cmirror to dm-log-clustered. 2008-07-31 14:43:39 +00:00
Alasdair Kergon
82185ada82 Cease recognising snapshot-in-use percentages returned by early development kernels. 2008-07-15 00:25:52 +00:00
Alasdair Kergon
3cde54c50e . 2008-04-10 18:53:36 +00:00
Dave Wysochanski
985ca02b6a Add vg_is_clustered() helper function.
Should be no functional change.
2008-04-10 17:09:32 +00:00
Milan Broz
5619c629f6 Add detection of clustered mirror log capability.
Currently only check for kernel module presence.
2008-04-07 10:23:47 +00:00
Alasdair Kergon
4e9083db10 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
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
0c06de632a pre-release review cleanups 2008-01-17 17:17:09 +00:00
Alasdair Kergon
876003dc44 allow a mirror to contain only one mimage 2008-01-16 19:18:51 +00:00
Alasdair Kergon
a1ff319fda Don't use block_on_error with mirror targets above version 1.12. 2008-01-16 15:24:25 +00:00
Alasdair Kergon
be6845999b Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Alasdair Kergon
57fc4cc0b6 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
8a37910d51 register->monitor etc. 2007-01-19 22:21:45 +00:00
Alasdair Kergon
0e2084da9c merge _target_*register_events
introduce _create_dm_event_handler()
2007-01-17 15:00:57 +00:00
Alasdair Kergon
e430b424df use updated dm_event_get_registered_device interface 2007-01-16 23:05:13 +00:00