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

369 Commits

Author SHA1 Message Date
Alasdair Kergon
9abda62c5b Manage without dm_udev_cleanup? 2009-08-03 18:01:45 +00:00
Alasdair Kergon
bce8cac1f4 cleanup some ignored return values & 'stack's 2009-08-03 11:20:15 +00:00
Alasdair Kergon
4171d0c301 deal with error-related FIXMEs 2009-08-03 11:01:26 +00:00
Alasdair Kergon
39270f9647 Set cookies in activation code and wait for udev to complete processing. 2009-07-31 18:30:31 +00:00
Alasdair Kergon
3b6a147653 Add udevcomplete and --noudevwait to dmsetup. 2009-07-31 17:51:45 +00:00
Alasdair Kergon
fd69075a8b another fixme 2009-07-31 16:57:06 +00:00
Alasdair Kergon
dfed228991 Add libdevmapper functions to support synchronisation with udev. 2009-07-31 15:53:11 +00:00
Alasdair Kergon
5e3369aba3 Add log_errno to set a specific errno and replace log_error in due course. 2009-07-16 00:52:06 +00:00
Alasdair Kergon
7da36611dc Use log_error macro consistently throughout in place of log_err. 2009-07-15 20:02:46 +00:00
Alasdair Kergon
a06d6839e1 New LOG_MESG macro to fix file/line number logging for memory leaks after
LOG_LINENO macro was added.
2009-07-15 14:18:38 +00:00
Alasdair Kergon
7e7274b002 Add dm_log_with_errno and dm_log_with_errno_init, deprecating the old
Change plog to use dm_log_with_errno unless deprecated dm_log_init was used.
Rename plog macro to LOG_LINE and use in dm_dump_memory_debug.
2009-07-10 09:59:37 +00:00
Alasdair Kergon
5628024d45 Fix whitespace in linear target line to fix identical table line detection.
(only tested with linear so far)
2009-07-07 16:36:05 +00:00
Alasdair Kergon
7acff3b938 Add device number to more log messages during activation. 2009-07-03 12:45:55 +00:00
Milan Broz
f7c1e5f60d Fix backward compatibility for major:minor query.
Is an application uses query and set major:minor
to device, it should not fallback to default major by default.

Add new function whoich allows that (and use it in lvm2).
2009-06-17 20:55:24 +00:00
Milan Broz
25d9591416 Support crypt segment in libdevmapper tree.
- it can support multiple segments, but note that
to work properly, correct IV (initialization vector)
offset parameter must be set properly.

Because most usage of IV start offset is when we join
several crypto segments together (so iv_offset is the segment
start offset), DM_CRYPT_IV_DEFAULT is defined to simplify
the process.

Function accepts the string in cipher agrument (already
including chainmode and iv type; chainmode and iv parameters are NULL
in this case) or user can provide split parameters which will
join into dm-crypt cipher specification "cipher-chainmode-iv".

All these parameters must be supplied in correct dm-crypt format.
2009-06-09 16:10:20 +00:00
Alasdair Kergon
90cc3a0f05 Make mempool optional in dm_split_lvm_name() 2009-06-03 11:40:23 +00:00
Milan Broz
bb6db55686 Use suspend with flush when device size was changed during table preload.
This allows online mirror resize, also removes condition to preventing
code to do this.
2009-05-20 09:52:37 +00:00
Milan Broz
d784303591 Helper function to catch memory pool leaks. 2009-04-10 09:56:58 +00:00
Zdeněk Kabeláč
dddd2f9202 Do not create some dm and lvm static librarie when they are not requested
by configure option
Add dependency for static dmeventd library
2009-04-08 14:04:35 +00:00
Milan Broz
9ab1d88a91 Fix debug pool grow object to properly support delta=0
(It prints garbage for some reports)
2009-04-02 15:02:18 +00:00
Milan Broz
77dd12a028 fix some issues when compiling with -D DEBUG_POOL
- fix compilation issues
- fix wrong pool object maipulation (lvm dumpconfig triggers assert)
- second iteration in loop _log_parallel_areas operates on non-existing object
2009-03-26 09:25:18 +00:00
Dave Wysochanski
74adacf96a Fix some clean rules, fix previous distclean checkin.
In libdm/Makefile.in, we need to cleanup the symlink properly.
Adding to CLEAN_TARGETS seemed like the simplest way to do this
in the current build framework.  We could redo dependencies for
VERSIONED_SHLIB, but for now just add to CLEAN_TARGETS.

For scripts/Makefile.in, we should be adding to DISTCLEAN_TARGETS.
The generic rule in make.tmpl.in takes care of the cleanup.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-16 20:00:10 +00:00
Alasdair Kergon
e28d3f8cbd If kernel supports only one dm major number, use in place of any supplied.
No longer require kernel and metadata major numbers to match.
2009-02-12 20:42:07 +00:00
Milan Broz
d0143d6f3e 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.)
2009-02-09 09:45:49 +00:00
Dave Wysochanski
c848ce66c5 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.
2009-01-19 20:53:35 +00:00
Alasdair Kergon
9a96645b53 Add <report_type>_all to help text. 2009-01-10 03:14:24 +00:00
Alasdair Kergon
ffa1b19e26 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.
2009-01-10 03:01:35 +00:00
prajnoha
a479761be5 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.
2009-01-07 12:17:40 +00:00
Alasdair Kergon
023a61c0e5 Use dm_snprintf to avoid duplicating the snprintf compatibility code. 2008-12-12 18:45:58 +00:00
Zdeněk Kabeláč
77ac863bb8 Replace _dm_snprintf with EMIT_PARAMS macro for creating target lines 2008-12-11 16:25:51 +00:00
Alasdair Kergon
f5c395adb2 some makefile fixes for liblvm2cmd & remove some hardcoded .so 2008-11-14 20:59:56 +00:00
Alasdair Kergon
abba6e0642 make install_device-mapper 2008-11-04 17:25:32 +00:00
Alasdair Kergon
2a550ef96d more fixes 2008-11-04 15:07:45 +00:00
Alasdair Kergon
03ed7d73fc more missing bits 2008-11-04 14:57:06 +00:00
Alasdair Kergon
a2bfad1c29 Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
Alasdair Kergon
645aa55abc add list fns 2008-11-03 20:03:00 +00:00
Alasdair Kergon
05329c885a more tweaking to get things to compile - dmlib.h for log fns, list.h 2008-11-03 18:59:59 +00:00
Alasdair Kergon
57854c2231 Use simple x.y.z library version in libdevmapper.pc 2008-11-01 20:48:09 +00:00
Alasdair Kergon
ba70dce803 further progress 2008-11-01 02:19:19 +00:00
Alasdair Kergon
306dfa2043 Add dm-logging.h ready for libdevmapper. 2008-10-30 17:54:12 +00:00
Alasdair Kergon
43924e31b8 Split out dm-logging.h from log.h 2008-10-30 17:24:04 +00:00
Alasdair Kergon
3b34fcf59f Add libdm subdir to begin merging the device-mapper tree. 2008-10-30 15:31:33 +00:00
Alasdair Kergon
bc633e03aa Fix last checkin - tested wrong dnode. 2008-09-18 22:55:33 +00:00
Alasdair Kergon
026cc120e7 Only resume devices in dm_tree_preload_children if size changes. 2008-09-18 18:34:53 +00:00
Alasdair Kergon
874f42ad6c Extend deptree buffers so the largest possible device numbers fit. 2008-09-02 12:16:07 +00:00
Alasdair Kergon
a8c5758222 Underline longer report help text headings. 2008-06-25 19:52:52 +00:00
Alasdair Kergon
b097aa787b pre-commit 2008-06-25 14:24:17 +00:00
Alasdair Kergon
723be0fe69 Align struct memblock in dbg_malloc for sparc. 2008-06-25 14:10:33 +00:00
Alasdair Kergon
f0597a03de Cope with missing field values. 2008-06-25 00:10:36 +00:00
Alasdair Kergon
65f0656f54 Add --rows to dmsetup. 2008-06-24 22:53:48 +00:00
Alasdair Kergon
366e89bda0 dmsetup --unquoted 2008-06-24 20:16:47 +00:00
Alasdair Kergon
fe74f013e3 Fix inverted no_flush debug message. (mpatocka) 2008-06-10 11:19:19 +00:00
Alasdair Kergon
6da1ca0cb9 rename some config vars 2008-06-06 20:44:35 +00:00
Alasdair Kergon
f148280c99 switch to single quotes rather than double for nameprefixes 2008-06-06 19:07:47 +00:00
Alasdair Kergon
6196ac7995 Initialise params buffer to empty string in _emit_segment. 2008-06-05 19:10:35 +00:00
Alasdair Kergon
0c6271dabc Skip add_dev_node when ioctls disabled.
Make dm_hash_iter safe against deletion.
Accept a NULL pointer to dm_free silently.
2008-05-21 16:14:46 +00:00
Alasdair Kergon
a636299680 Add field name prefix option to reporting functions. 2008-04-20 00:11:08 +00:00
Alasdair Kergon
08e5bd5b72 Calculate string size within dm_pool_grow_object. 2008-04-19 15:50:18 +00:00
Alasdair Kergon
456e42257c make list_move consistent with other list fns 2008-04-10 19:14:27 +00:00
Dave Wysochanski
74adbb77b7 Add list_move() support function for list manipulation. 2008-03-26 16:20:54 +00:00
Alasdair Kergon
05ed5c0d74 Use log_warn for reporting field help text instead of log_print. 2008-01-20 01:14:38 +00:00
Jonathan Earl Brassow
0336bc9de9 - The automatic log module loading patch proposed for the upstream kernel
works on '-'s, not '_'s.  This is due to the preference to have log
  module file names that do not mix '_'s and '-'s.
2008-01-15 22:48:11 +00:00
Alasdair Kergon
50827a5f69 more readahead node fixes/debug messages 2007-12-14 19:49:27 +00:00
Alasdair Kergon
2d6444c924 Fix deptree to pass new name to _resume_node after a rename. 2007-12-14 17:57:04 +00:00
Alasdair Kergon
1d2675d9aa Add node operation stack debug messages. 2007-12-14 17:26:09 +00:00
Alasdair Kergon
ad98990a8e Report error when empty device name passed to readahead functions. 2007-12-13 02:25:45 +00:00
Alasdair Kergon
fb806f61d4 Fix minimum readahead debug message. 2007-12-05 18:57:34 +00:00
Alasdair Kergon
a6afae2356 clarify when read_ahead may be set 2007-12-05 16:28:19 +00:00
Alasdair Kergon
0eea7070a7 work out device name to use for read ahead request 2007-12-05 16:24:41 +00:00
Alasdair Kergon
82bb0e8dda fix ioctls to use long not int
update dm-ioctl.h after compat tidy-up
2007-12-05 14:11:26 +00:00
Alasdair Kergon
5a4c5b4155 fixes 2007-12-03 22:48:36 +00:00
Alasdair Kergon
7c082d2471 missing #include 2007-12-03 17:56:36 +00:00
Alasdair Kergon
f3cafcf983 fix 2007-11-30 16:44:42 +00:00
Alasdair Kergon
75073e4aa6 readahead support completed - untested 2007-11-30 16:42:26 +00:00
Alasdair Kergon
a3c23f650c read_ahead node ops 2007-11-30 14:59:57 +00:00
Alasdair Kergon
49b2006824 add read_ahead functions to library and dmsetup --readahead
(Not live yet.)
2007-11-27 20:57:05 +00:00
Alasdair Kergon
ceec4455df Add DM_READ_AHEAD_MINIMUM_FLAG 2007-11-12 20:47:18 +00:00
Alasdair Kergon
ccb85cc719 Define DM_READ_AHEAD_AUTO and DM_READ_AHEAD_NONE. 2007-11-09 16:52:36 +00:00
Jim Meyering
d4b1003a97 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
38e54b626e Arrange for "make clean" to remove the symlink, too.
* make.tmpl.in ($(VERSIONED_SHLIB)): Move rule to...
* lib/Makefile.in ($(VERSIONED_SHLIB)): ...here, removing the
$(interface)/ prefix.
Reported by Milan Broz.

Author: Jim Meyering <meyering@redhat.com>
2007-10-03 10:48:27 +00:00
Jim Meyering
c8c4dbb409 Create a symlink, e.g., libdevmapper.so.1.02, in the build dir,
alongside the .so file.  This helps build dynamically linked LVM.

* lib/Makefile.in (VERSIONED_SHLIB): Define.
* make.tmpl.in (TARGETS): Append $(VERSIONED_SHLIB).
($(VERSIONED_SHLIB)): New rule.


Author: Jim Meyering <jim@meyering.net>
2007-09-18 13:02:58 +00:00
Alasdair Kergon
ebc26c7421 Remove obsolete dmfs code from tree and update INSTALL. 2007-08-21 18:41:58 +00:00
Alasdair Kergon
1ad58e1121 Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-21 16:26:07 +00:00
Alasdair Kergon
3f507a26fb Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Jim Meyering
7454664997 Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Alasdair Kergon
541ea4dc63 improve changelog 2007-08-06 13:09:46 +00:00
Jim Meyering
4d418dee0e Export dm_create_dir (was create_dir) to help fix LVM2 link error
* lib/libdm-file.c (dm_create_dir): Rename from create_dir.
* lib/libdevmapper.h (dm_create_dir): Declare.
* lib/.exported_symbols: Add dm_create_dir.
* lib/ioctl/libdm-iface.c (_create_control): Update sole use.
Patch by Jun'ichi Nomura.  Details in
http://www.redhat.com/archives/lvm-devel/2007-July/msg00040.html
2007-07-28 10:48:36 +00:00
Jim Meyering
06fe319347 Make the libdevmapper version of create_dir equivalent to the LVM2 one.
(_create_dir_recursive): Refrain from logging a mkdir failure due to EROFS.
Patch by Jun'ichi Nomura.
2007-07-28 10:27:34 +00:00
Jim Meyering
9dd7e3fb24 Introduce log_sys_* macros from LVM2.
Convert existing "<string>: <function> failed: <strerror>" type messages
to use this macro.  Patch by Jun'ichi Nomura.
2007-07-28 10:23:02 +00:00
Jim Meyering
b14b97599d dm_fclose: new function
* lib/libdevmapper.h: Declare it.
* lib/libdm-file.c (dm_fclose): Define it.
* lib/.exported_symbols: Add dm_fclose.
2007-07-24 14:15:45 +00:00
Petr Rockai
5ee976d276 Make warnings go to stderr. Adds log_warn macro for that purpose,
log_print continues to print to stdout.
2007-06-28 17:27:02 +00:00
Alasdair Kergon
a249de3b72 Standardise protective include file #defines. 2007-04-27 19:07:43 +00:00
Alasdair Kergon
b9f5a18a76 Add regex functions to library. 2007-04-27 18:40:23 +00:00
Alasdair Kergon
d7ba0e01a5 Avoid trailing separator in reports when there are hidden sort fields. 2007-04-27 15:22:27 +00:00
Alasdair Kergon
477ec611d5 Deal with some more compiler warnings. Hope this doesn't break anything... 2007-04-27 14:52:41 +00:00
Alasdair Kergon
369ab1e0b2 Introduce _add_field() and _is_same_field() to libdm-report.c. 2007-04-19 20:24:00 +00:00
Alasdair Kergon
b1b6c97f7c Fix a few leaks in reporting error paths. 2007-02-14 15:12:16 +00:00
Alasdair Kergon
684eecba1d Use fixed-size fields in report interface. 2007-01-29 17:23:54 +00:00
Alasdair Kergon
217f70952f don't remove libdm-common.h any more 2007-01-25 15:45:10 +00:00
Alasdair Kergon
d851289d8a Add some missing close() and fclose() return value checks. 2007-01-25 14:16:20 +00:00