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

587 Commits

Author SHA1 Message Date
Zdenek Kabelac
23b059e7b7 INSTALL rules updates
Patch is inspired by Debian's extra patch.

- removes OWNER & GROUP make vars they are parts of INSTALL command.
- adds INSTALL_PROGRAM for executable, uses $(INSTALL)
- adds INSTALL_DATA for non-executable data, uses ($INSTALL)
- adds INSTALL_WDATA for writable non-executable data, uses ($INSTALL)
- adds configure option --enable-write_install - to support
  installatin of writable files used by distribution
- replaces usage of ifeq @LIB_SUFFIX@ with $(LIB_SUFFIX)
- installs .a files from static builds without executable flag
- installs .a files to $(usrlibdir) instead of $(libdir)
- installs all static binaries to $(staticdir)
- create .so links for devel package in $(usrlibdir) instead of
  $(libdir)
- makes .so and .so.LIB_VERSION files within builddir
- removes VERSIONED_SHLIB and created versioned LIB_SHARED automagicaly
- install LIB_SHARED via install_lib_shared target
- install plugins via install_lib_shared_plugin target
- prints whole 'install' command during installation instead of less
  informative "Installing  $(something) $(somewhere)"
- install multiple man pages with one INSTALL command
- use DISTCLEAN_TARGETS instead of creating multiple distclean targets
2010-04-09 21:42:48 +00:00
Zdenek Kabelac
c737d34804 Use vpath instead of VPATH.
Usage of VPATH makes troubles when used within $(builddir).
Not only source files are being found through VPATH,
but targets as well. (make --debug=v)

Thus if user builds the code in $(srcdir) and also in some $(builddir)
he gets mangled results as some generated files (i.e. .export.sym)
are 'reused' from $(srcdir) instead of $(builddir).

This patch switches to use vpath were we could explicitly name
suffixes that should be looked via vpath - we must take care,
we do not generate files with these suffixes:
.c, .in, .po, .exported_symbols
2010-04-09 21:34:25 +00:00
Alasdair Kergon
18e0f9342d Only fail if the top-level LV fails to be deactivated - allow deactivation
of its dependencies to fail.
2010-04-07 23:51:34 +00:00
Alasdair Kergon
e6ff36ab61 Issue a message if the new type of deactivation failure happens.
If this can happen during 'normal' operations, I need to know.
2010-04-07 21:25:09 +00:00
Alasdair Kergon
f55021f487 Fix incorrect removal of symlinks after LV deactivation fails. 2010-04-07 20:04:41 +00:00
Milan Broz
fb3bcb9f74 Wipe dm-ioctl parameters in memory after use. 2010-04-07 15:57:20 +00:00
Zdenek Kabelac
b7be589ed0 Fixing another set of distclean problems where we left some generated files
in clvmd, dmevend, man, tests.

Don't include dependency files for clow and cscope.out targets

Improve dependency tracking for dmeventd and liblvm2cmd sources.
2010-03-29 14:17:59 +00:00
Zdenek Kabelac
b41f5924bf Update cflow file generation - support build dir and use $(top_srcdir)
to obtain sources. Create make.tmpl target for
simplier generation of cflow files with the help of
CFLOW_LIST, CFLOW_LIST_TARGET, CFLOW_TARGET.
Still cflow usage is not perfect.
2010-03-29 14:11:17 +00:00
Alasdair Kergon
b8175c33da Use INTERNAL_ERROR definition consistently in internal error messages. 2010-03-25 18:22:04 +00:00
Peter Rajnoha
91345610f8 Strictly require libudev if udev_sync is used.
This prevents some confusion when libudev was not found so udev_sync was disabled
automatically. Configure was successful though giving only a tiny warning.

Also, if "dmsetup udevcreatecookie" is used, never return 0x000000 as a result if
udev is not running and keep the output blank.
2010-03-23 14:43:18 +00:00
Peter Rajnoha
ac3691f70e Add support for ioctl's DM_UEVENT_GENERATED_FLAG.
We need to know whether we should wait for any uevent or not when
using udev_sync. A kernel patch was posted recently that changed the
way uevents are sent on dm device resume - it is sent only if the
device has been suspended before. There's also a new DM_UEVENT_GENERATED_FLAG
in the ioctl to notify userspace whether the event was generated.

If the uevent was not generated (e.g. the situation where the device is
*not* suspended and we call a resume), we just call dm_udev_complete
explicitly from within libdevmapper itself to prevent infinite waiting
while trying to synchronise with udev processing.
2010-03-23 14:38:37 +00:00
Zdenek Kabelac
db724a449b Use UDEV_LIBS, and link -ludev only when needed. 2010-03-04 12:12:34 +00:00
Zdenek Kabelac
f8f6ec92b1 This patch add SELINUX_LIBS and STATIC_LIBS variables.
For static builds dependency for SELinux libs is not handled by 'ar'.
Till better solution is found, for static builds STATIC_LIBS is used.

Patch updates SELinux detection to use 3rd & 4th parameter for Success/Fail.
Also removes detection of pthread from this check as we know which
version of libdevmapper we are going to link with lvm after merge.

SELinux header check moved to the SELinux test code.
2010-03-04 12:08:26 +00:00
Zdenek Kabelac
0c330786f5 This patch moves inclusion of the make.tmpl before DEFS modification,
so it goes in the same order on the compilation line.
(i.e. HAVE_CONFIG_H goes first)
2010-03-04 09:56:56 +00:00
Zdenek Kabelac
814aebc4e9 Use $(top_builddir) for inclusion of make.tmpl in Makefiles. 2010-03-04 09:51:37 +00:00
Zdenek Kabelac
d98d855918 Fix dm_report_field_uint64 to really use 64bit.
(function is currently not in use)
2010-02-15 18:36:48 +00:00
Zdenek Kabelac
88c4995d1d * add more 'const' - fixes gcc constness warning 2010-02-15 18:34:00 +00:00
Peter Rajnoha
f0e073fcdc Several changes in dmsetup and libdevmapper:
- add DM_UDEV_DISABLE_LIBRARY_FALLBACK udev flag to rely on udev only

 - export dm_udev_create_cookie function to create new cookies on demand

 - add --udevcookie, udevcreatecookie and udevreleasecookie for dmsetup
   (to support "udev transactions" where one cookie value can be used for
    several dmsetup calls)

 - don't use DM_UDEV_DISABLE_CHECKING env. var. anymore and set the state
   automatically (based on udev and libdevmapper dev path comparison)
2010-02-15 16:21:33 +00:00
Alasdair Kergon
c75ebae789 remove no-longer-used header 2010-01-19 17:04:05 +00:00
Alasdair Kergon
49095061cd remove no-longer-used files 2010-01-19 17:01:17 +00:00
Alasdair Kergon
f7729ec651 more build fixes 2010-01-19 01:10:46 +00:00
Jonathan Earl Brassow
49b95a5e21 Off-by-one count was causing not all the mirror table parameters
that were necessary to be passed on to userspace.

The cluster mirror table (log portion only) used to look like this:
        clustered-disk <parm_count> <disk> <region_size> <uuid> \
                        [[no]sync] [block_on_error]
Now it looks like this:
        userspace <parm_count> <uuid> clustered-disk <disk> <region_size> \
                        [[no]sync]

So, there is one extra argument in the latter case - this was
unaccounted for.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 16:00:23 +00:00
Zdenek Kabelac
04bde319a9 Cleanup gcc warning: cast discards qualifiers from pointer target type
API of the library should remain the same as the 'const' is not
mangled into the function name in C.
2010-01-14 10:15:23 +00:00
Zdenek Kabelac
f7b692d29f Cleanup gcc warning: cast from function call of type 'struct dm_list *'
to non-matching type 'long unsigned int'

Casting pointer to long and back to pointer could be easily
handled with just pointer arithmetic.
2010-01-14 10:12:44 +00:00
Mike Snitzer
aa6f4e51a7 Add support for "snapshot-merge" target.
Introduces new libdevmapper function dm_tree_node_add_snapshot_merge_target

Verifies that the kernel (dm-snapshot) provides the 'snapshot-merge'
target.

Activate origin LV as snapshot-merge target.  Using snapshot-origin
target would be pointless because the origin contains volatile data
while a merge is in progress.

Because snapshot-merge target is activated in place of the
snapshot-origin target it must be resumed after all other snapshots
(just like snapshot-origin does) --- otherwise small window for data
corruption would exist.

Ideally the merging snapshot would not be activated at all but if it is
to be activated (because snapshot was already active) it _must_ be done
after the snapshot-merge.  This insures that DM's snapshot-merge target
will perform exception handover in the proper order (new->resume before
old->resume).  DM's snapshot-merge does support handover if the reverse
sequence is used (old->resume before new->resume) but DM will fail to
resume the old snapshot; leaving it suspended.

To insure the proper activation sequence dm_tree_activate_children() was
updated to accommodate an additional 'activation_priority' level.  All
regular snapshots are 0, snapshot-merge is 1, and merging snapshot is 2.
2010-01-13 01:39:44 +00:00
Alasdair Kergon
12b646541b Add missing items to WHATS_NEW files.
Continue to use 'field' to describe reporting elements.
2010-01-11 21:28:04 +00:00
Peter Rajnoha
d2b43c4b34 Add support to disable udev checking: DM_UDEV_DISABLE_CHECKING=1 env. variable.
Sometimes it is really needed to switch off udev checking and the warnings we show when
we detect that udev has not done its job right - the messages like "Udev should have done
this and that. Falling back to direct node creation/removal. " etc.

This would be especially handy while setting DM_DEV_DIR env var that could be set to a
different location than standard /dev (udev can't create nodes/symlinks out of that one
directory that is configured into udevd). The exact same situation happens while we're
running our tests.
2010-01-11 15:36:24 +00:00
Peter Rajnoha
cda69e17ef Add activation/udev_rules config option in lvm.conf.
Add dm_tree_add_dev_with_udev_flags to provide wider support for udev flags.
2010-01-07 19:54:21 +00:00
Zdenek Kabelac
876835f2f1 Error message prints unrecognized key. 2010-01-07 14:32:44 +00:00
Zdenek Kabelac
2c352d7b1e Show all fields for 'dmsetup info -c -o all'. 2010-01-07 14:30:47 +00:00
Mike Snitzer
b7eb2ad04d Return error to dm_tree_deactivate_children() callers.
Otherwise deactivate_lv can fail silently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-01-05 21:06:26 +00:00
Mike Snitzer
68085c93b0 Return error to dm_tree_suspend_children() callers.
Otherwise suspend_lv and its variants can fail silently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-01-05 21:05:40 +00:00
Mike Snitzer
2ca6b865f6 Return error to dm_tree_preload_children() and
dm_tree_activate_children() callers.

Otherwise resume_lv and its variants can fail silently.

Catching these failures is especially important now that dm targets like
crypt and snapshot-merge can fail in .preresume

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-01-05 21:04:37 +00:00
Zdenek Kabelac
b1ebf028de Cleanup returns for void functions. 2009-12-11 13:16:37 +00:00
Zdenek Kabelac
08e64ce5e9 minor whitespace indentation 2009-12-03 09:58:30 +00:00
Dave Wysochanski
ccb601a3cb Remove unnecessary / duplicate dm_list macros and functions.
These are no longer used by anyone.  The dm_list defines are all in
libdevmapper.h and libdm/datastruct/list.c contains any function definitions.
There is some code in "old-tests" that still use this but this code is not
being maintained.

Thanks to Zdenek for spotting this.
2009-11-25 20:44:07 +00:00
Peter Rajnoha
584d1fb7d1 Support udev flags even when udev_sync is disabled or not compiled in.
This provides better support for environments where udev rules are installed
but udev_sync is not compiled in (however, using udev_sync is highly
recommended). It also provides consistent and expected functionality even
when '--noudevsync' option is used.

There is still requirement for kernel >= 2.6.31 for the flags to work though
(it uses DM cookies to pass the flags into the kernel and set them in udev
event environment that we can read in udev rules).
2009-11-13 12:43:21 +00:00
Peter Rajnoha
9c20c7af59 Remove 'last_rule' from udev rules.
'last_rule' option has been removed from udev (version >= 147).

From now on, we require foreign rules to check and honor
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG} instead. Foreign
rules should be skipped totally when this flag is set.
2009-11-13 12:33:27 +00:00
Alasdair Kergon
9abf5e70be Add support for querying a device's inactive table.
Currently this data is invisible to userspace.
Requires dm >= 4.16 (likely to be in linux 2.6.33).
2009-11-06 00:43:08 +00:00
Alasdair Kergon
eb82f939ee Fix hash lookup segfault when keys compared are different lengths. 2009-11-03 00:45:35 +00:00
Peter Rajnoha
b040e267a2 Cleanup of previous commit with latest changes in udev support code. 2009-10-26 21:38:35 +00:00
Peter Rajnoha
421671b1c2 Several changes to udev support code:
- we have these levels when the udev rules are processed:
   10-dm.rules --> [11-dm-<subsystem>.rules] --> [12-dm-permissions.rules] -->
   13-dm-disk.rules --> [...all the other foreign rules...] --> 95-dm-notify.rules

 - each level can be disabled now by
   DM_UDEV_DISABLE_{DM, SUBSYSTEM, DISK, OTHER}_RULES_FLAG

 - add DM_UDEV_DISABLE_DM_RULES_FLAG to disable 10-dm.rules

 - add DM_UDEV_DISABLE_OTHER_RULES_FLAG to disable all the other (non-dm) rules.
   We cutoff these rules by using the 'last_rule', so this one should really be
   used with great care and in well-founded situations. We use this for lvm's
   hidden and layer devices now.

 - add a parameter for add_dev_node, rm_dev_node and rename_dev_node so it's
   possible to switch on/off udev checks

 - use DM_UDEV_DISABLE_DM_RULES_FLAG and DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG
   if there's no cookie set and we have resume, remove and rename ioctl.
   This could happen when someone uses the libdevmapper that is compiled with
   udev_sync but the software does not make use of it. This way we can switch
   off the rules and fallback to libdevmapper node creation so there's no
   udev/libdevmapper race.
2009-10-26 14:29:33 +00:00
Peter Rajnoha
f16aea9ebd Use udev flags support in LVM and provide dm_tree_add_new_dev_with_udev_flags wrapper for dm_tree_add_new_dev. 2009-10-22 13:00:07 +00:00
Peter Rajnoha
5f1f31f942 Add udev flags support in libdevmapper and provide 'dmsetup udevflags' command to decode them. 2009-10-22 12:55:47 +00:00
Fabio M. Di Nitto
2cec0e4562 Merge Debian patch 05 debian: keep libdm-abi consistent.
This appears to be the only user visible feature that can change libdm ABI
at build time.

Thanks to Bastian Blank for the patch.
2009-10-12 04:06:42 +00:00
Alasdair Kergon
e1b8a236b7 Only include selinux libs in libdevmapper.pc when selinux build enabled. 2009-10-05 12:11:30 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Alasdair Kergon
2b33edfcf7 missing dm_snprintf 2009-09-25 19:06:05 +00:00
Alasdair Kergon
536f0e0881 pre-release 2009-09-25 18:30:27 +00:00
Alasdair Kergon
42870d441d ensure dm_strdup succeeds 2009-09-25 18:19:09 +00:00
Alasdair Kergon
c0b23a1491 remove unused var & rename fn 2009-09-25 18:13:17 +00:00
Alasdair Kergon
1178220354 Handle any path supplied to dm_task_set_name() by looking up in /dev/mapper. 2009-09-25 18:08:04 +00:00
Peter Rajnoha
96e46b8edb Use the same default umask for /dev dirs (DM_DEV_DIR_UMASK). 2009-09-25 11:58:00 +00:00
Jonathan Earl Brassow
3c74075fb1 '_emit_areas_line' returns 1 for success and 0 for failure. This always
confuses me, so I've added a comment at the top of the function to
remind me of this.

I also found that 'mirror_emit_segment_line' was returning 0 (return_0)
on failure /and/ success.  It now returns 1 for success and 0 for failure -
just like '_emit_areas_line' and its calling function, '_emit_segment_line'.
2009-09-22 16:26:59 +00:00
Alasdair Kergon
6087b1581d dm release cleanup 2009-09-15 11:41:38 +00:00
Peter Rajnoha
221b941eb5 Move dm_cookie_supported check into dm_udev_get_sync_supprt function.
We don't have to call dm_cookie_supported with dm_udev_get_sync_support
this way. Also, it's necessary for the current code to work properly on
systems without cookie support (older kernels).
2009-09-11 16:11:25 +00:00
Peter Rajnoha
9b77df2ae7 Add one define that is necessary for older (experimental) libudev to work. 2009-09-11 15:57:51 +00:00
Peter Rajnoha
93d1fdba4b Check that udev is running and set internal state appropriately. 2009-09-11 15:56:06 +00:00
Dave Wysochanski
5f1c57d008 Restore umask when device node creation fails.
Author: Florian Zumbiehl <florz@florz.de>
Acked-by: Dave Wysochanski <dwysocha@redhat.com>
2009-09-03 21:51:26 +00:00
Jonathan Earl Brassow
afa8ea4078 Cluster log server (clogd): Add new build files.
Might be a good idea to add the new files to the repository.  :(
2009-08-13 20:51:41 +00:00
Jonathan Earl Brassow
8f26e18c13 Cluster log daemon (clogd): use LVM bitops in place of ext2 bitops
Eliminate dependency on outside library, since the same functionality
exists in our tree.

[It is important that the bitops work in the same way, as the bitmaps
must remain backwards compatible.  I haven't tested every architecture,
but the x86* archs work.  My test involved using the old ext2fsprogs
bitops, memcpy'ing the bits over to the LVM bitset array and ensuring
that only the bits set via the old methods were set.]
2009-08-13 16:31:01 +00:00
Alasdair Kergon
7cec175dfc pre-release 2009-08-06 17:08:01 +00:00
Peter Rajnoha
f9ff23dffe Add 'udevcomplete_all' command for dmsetup. Export DM_COOKIE_MAGIC in libdevmapper.h. 2009-08-06 15:04:30 +00:00
Peter Rajnoha
2be430435f Fix failure situations in dm_task_run for udev sync. 2009-08-06 15:02:01 +00:00
Peter Rajnoha
1879e85672 Detect udev problems in _rename_dev_node. 2009-08-06 15:00:25 +00:00
Alasdair Kergon
fa5617d7f5 Additional logging 2009-08-05 19:50:08 +00:00
Alasdair Kergon
252239bdac Add default udev rules.
Update dm-ioctl.h comments.
2009-08-03 18:44:54 +00:00
Alasdair Kergon
f9e17e36aa Add udev checks. 2009-08-03 18:33:08 +00:00
Alasdair Kergon
a74be32bf6 Manage without dm_udev_cleanup? 2009-08-03 18:01:45 +00:00
Alasdair Kergon
f86117e3d5 cleanup some ignored return values & 'stack's 2009-08-03 11:20:15 +00:00
Alasdair Kergon
b59c9854e8 deal with error-related FIXMEs 2009-08-03 11:01:26 +00:00
Alasdair Kergon
bd90c6b2c2 Set cookies in activation code and wait for udev to complete processing. 2009-07-31 18:30:31 +00:00
Alasdair Kergon
2c0dfdf839 Add udevcomplete and --noudevwait to dmsetup. 2009-07-31 17:51:45 +00:00
Alasdair Kergon
b634751cc4 another fixme 2009-07-31 16:57:06 +00:00
Alasdair Kergon
4d8c4ea7e6 Add libdevmapper functions to support synchronisation with udev. 2009-07-31 15:53:11 +00:00
Alasdair Kergon
9fac443591 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
b8f47d5f69 Use log_error macro consistently throughout in place of log_err. 2009-07-15 20:02:46 +00:00
Alasdair Kergon
eac6599c5e 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
a9cb6969b0 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
609faae9a5 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
4b2cae463e Add device number to more log messages during activation. 2009-07-03 12:45:55 +00:00
Milan Broz
6391d03f54 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
12ca060e9f 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
c9ee46569c Make mempool optional in dm_split_lvm_name() 2009-06-03 11:40:23 +00:00
Milan Broz
eb91c4eee3 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
d828b9a4d7 Helper function to catch memory pool leaks. 2009-04-10 09:56:58 +00:00
Zdenek Kabelac
beeae21dbb 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
fe41c21be9 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
aa8111b3cd 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
d917c98cd8 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
0f817d38f7 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
ea0cdd28c1 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
1a0280b313 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
1c96ddd735 Add <report_type>_all to help text. 2009-01-10 03:14:24 +00:00
Alasdair Kergon
1f1aaf43ea 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
Peter Rajnoha
c48e40391b 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
7b6c011c54 Use dm_snprintf to avoid duplicating the snprintf compatibility code. 2008-12-12 18:45:58 +00:00
Zdenek Kabelac
ffa9b6a571 Replace _dm_snprintf with EMIT_PARAMS macro for creating target lines 2008-12-11 16:25:51 +00:00
Alasdair Kergon
cee9a8d87e some makefile fixes for liblvm2cmd & remove some hardcoded .so 2008-11-14 20:59:56 +00:00
Alasdair Kergon
77b69aa724 make install_device-mapper 2008-11-04 17:25:32 +00:00
Alasdair Kergon
56d8844068 more fixes 2008-11-04 15:07:45 +00:00
Alasdair Kergon
e50d0e97b1 more missing bits 2008-11-04 14:57: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
28f60ff82f add list fns 2008-11-03 20:03:00 +00:00
Alasdair Kergon
3e5b6ed214 more tweaking to get things to compile - dmlib.h for log fns, list.h 2008-11-03 18:59:59 +00:00
Alasdair Kergon
597c3f8e0f Use simple x.y.z library version in libdevmapper.pc 2008-11-01 20:48:09 +00:00
Alasdair Kergon
0782ad5002 further progress 2008-11-01 02:19:19 +00:00
Alasdair Kergon
301fd74ecf Add dm-logging.h ready for libdevmapper. 2008-10-30 17:54:12 +00:00
Alasdair Kergon
0b1bf1f56b Split out dm-logging.h from log.h 2008-10-30 17:24:04 +00:00
Alasdair Kergon
10a9579a63 Add libdm subdir to begin merging the device-mapper tree. 2008-10-30 15:31:33 +00:00
Alasdair Kergon
3776c4941a Fix last checkin - tested wrong dnode. 2008-09-18 22:55:33 +00:00
Alasdair Kergon
bb875bb9e4 Only resume devices in dm_tree_preload_children if size changes. 2008-09-18 18:34:53 +00:00
Alasdair Kergon
7d7d93ac6c Extend deptree buffers so the largest possible device numbers fit. 2008-09-02 12:16:07 +00:00
Alasdair Kergon
b6943304c9 Underline longer report help text headings. 2008-06-25 19:52:52 +00:00
Alasdair Kergon
6e1898a5a2 pre-commit 2008-06-25 14:24:17 +00:00
Alasdair Kergon
9070816ebb Align struct memblock in dbg_malloc for sparc. 2008-06-25 14:10:33 +00:00
Alasdair Kergon
aa882ea539 Cope with missing field values. 2008-06-25 00:10:36 +00:00
Alasdair Kergon
ca8d363d2c Add --rows to dmsetup. 2008-06-24 22:53:48 +00:00
Alasdair Kergon
f1839ac87c dmsetup --unquoted 2008-06-24 20:16:47 +00:00
Alasdair Kergon
afbf31eba9 Fix inverted no_flush debug message. (mpatocka) 2008-06-10 11:19:19 +00:00
Alasdair Kergon
2bd5b63f4a rename some config vars 2008-06-06 20:44:35 +00:00
Alasdair Kergon
9df5c6e987 switch to single quotes rather than double for nameprefixes 2008-06-06 19:07:47 +00:00
Alasdair Kergon
12ea7cb133 Initialise params buffer to empty string in _emit_segment. 2008-06-05 19:10:35 +00:00
Alasdair Kergon
b947f34393 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
c791f186ce Add field name prefix option to reporting functions. 2008-04-20 00:11:08 +00:00
Alasdair Kergon
f44e3ff46a Calculate string size within dm_pool_grow_object. 2008-04-19 15:50:18 +00:00
Alasdair Kergon
0b2a795ece make list_move consistent with other list fns 2008-04-10 19:14:27 +00:00
Dave Wysochanski
43aa463780 Add list_move() support function for list manipulation. 2008-03-26 16:20:54 +00:00
Alasdair Kergon
ad1fc08312 Use log_warn for reporting field help text instead of log_print. 2008-01-20 01:14:38 +00:00
Jonathan Earl Brassow
d6d4661517 - 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
fc795d8701 more readahead node fixes/debug messages 2007-12-14 19:49:27 +00:00
Alasdair Kergon
bafa2f39cf Fix deptree to pass new name to _resume_node after a rename. 2007-12-14 17:57:04 +00:00
Alasdair Kergon
4a41a93a7a Add node operation stack debug messages. 2007-12-14 17:26:09 +00:00
Alasdair Kergon
3a2234162d Report error when empty device name passed to readahead functions. 2007-12-13 02:25:45 +00:00
Alasdair Kergon
de4ddace2e Fix minimum readahead debug message. 2007-12-05 18:57:34 +00:00
Alasdair Kergon
a8524c3942 clarify when read_ahead may be set 2007-12-05 16:28:19 +00:00
Alasdair Kergon
9a22e746b5 work out device name to use for read ahead request 2007-12-05 16:24:41 +00:00
Alasdair Kergon
fec8f8382a 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
0b7d16bc09 fixes 2007-12-03 22:48:36 +00:00
Alasdair Kergon
15d2547427 missing #include 2007-12-03 17:56:36 +00:00
Alasdair Kergon
1d4e9f245b fix 2007-11-30 16:44:42 +00:00
Alasdair Kergon
e81af2f3fe readahead support completed - untested 2007-11-30 16:42:26 +00:00
Alasdair Kergon
2d1eead2e8 read_ahead node ops 2007-11-30 14:59:57 +00:00
Alasdair Kergon
52b8440916 add read_ahead functions to library and dmsetup --readahead
(Not live yet.)
2007-11-27 20:57:05 +00:00
Alasdair Kergon
6dd60469ba Add DM_READ_AHEAD_MINIMUM_FLAG 2007-11-12 20:47:18 +00:00
Alasdair Kergon
14772580cd Define DM_READ_AHEAD_AUTO and DM_READ_AHEAD_NONE. 2007-11-09 16:52:36 +00:00
Jim Meyering
06b8fee542 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
4ab5b20654 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
78ecdf8d65 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
1f84815c12 Remove obsolete dmfs code from tree and update INSTALL. 2007-08-21 18:41:58 +00:00
Alasdair Kergon
147d5faccf Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-21 16:26:07 +00:00
Alasdair Kergon
be6845999b Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Jim Meyering
08c9ff434b Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Alasdair Kergon
ee80c0f0e3 improve changelog 2007-08-06 13:09:46 +00:00
Jim Meyering
3f311f1daa 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
1c200869d9 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
87518d850b 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
0c3cd7e292 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
ba117ad80e 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
42c798229f Standardise protective include file #defines. 2007-04-27 19:07:43 +00:00
Alasdair Kergon
38862fcd3f Add regex functions to library. 2007-04-27 18:40:23 +00:00
Alasdair Kergon
af998ff6c2 Avoid trailing separator in reports when there are hidden sort fields. 2007-04-27 15:22:27 +00:00
Alasdair Kergon
8d2b0f24d3 Deal with some more compiler warnings. Hope this doesn't break anything... 2007-04-27 14:52:41 +00:00
Alasdair Kergon
7b74504f40 Introduce _add_field() and _is_same_field() to libdm-report.c. 2007-04-19 20:24:00 +00:00
Alasdair Kergon
012869d6d2 Fix a few leaks in reporting error paths. 2007-02-14 15:12:16 +00:00
Alasdair Kergon
9f069f7bef Use fixed-size fields in report interface. 2007-01-29 17:23:54 +00:00
Alasdair Kergon
820810da65 don't remove libdm-common.h any more 2007-01-25 15:45:10 +00:00
Alasdair Kergon
232da7ecc7 Add some missing close() and fclose() return value checks. 2007-01-25 14:16:20 +00:00
Alasdair Kergon
5c46d66871 Adjust report field help description layout. 2007-01-24 16:41:33 +00:00
Alasdair Kergon
66ed1bc5e1 fix earlier checkin 2007-01-23 23:58:55 +00:00
Alasdair Kergon
85feafd996 Add descriptions to reporting field definitions. 2007-01-23 19:18:52 +00:00
Alasdair Kergon
d28dfb5720 add a dso-private variable to dmeventd interface
more inline docn
2007-01-23 17:38:39 +00:00
Alasdair Kergon
4dcaa2300c Add dm_event_handler_[gs]et_timeout functions.
Streamline dm_report_field_* interface.
2007-01-22 15:03:57 +00:00
Alasdair Kergon
866a1a0836 Add DM_LIB_VERSION definition to configure.h. 2007-01-19 15:53:01 +00:00
Alasdair Kergon
09e206d393 Suppress 'Unrecognised field' error if report field is 'help'. 2007-01-18 22:15:04 +00:00
Alasdair Kergon
122337ba0d fix last checkin 2007-01-18 21:59:02 +00:00
Alasdair Kergon
03c6979264 Some internal renaming.
Add --separator and --sort to dmsetup (unused as yet).
Make alignment flag optional when specifying report fields.
2007-01-18 17:47:58 +00:00
Alasdair Kergon
f6af1a67b5 more little fixes 2007-01-16 21:13:07 +00:00
Alasdair Kergon
61997bb9bb Add basic reporting functions to libdevmapper. 2007-01-16 18:04:15 +00:00
Alasdair Kergon
931d24a4b1 More libdevmapper-event interface changes and fixes.
Rename dm_saprintf() to dm_asprintf().
2007-01-15 18:21:01 +00:00
Alasdair Kergon
080f3fa1e0 Report error if NULL pointer supplied to dm_strdup_aux(). 2007-01-15 14:39:12 +00:00
Alasdair Kergon
3165248642 Lots of dmeventd-related changes. 2007-01-11 21:54:53 +00:00
Alasdair Kergon
4594807a24 Use CFLAGS when linking so mixed sparc builds can supply -m64. 2007-01-11 16:23:22 +00:00
Alasdair Kergon
b9ffd32cd3 Add dm_tree_use_no_flush_suspend(). 2007-01-09 19:44:07 +00:00
Alasdair Kergon
616c3eccfd fix last checkin 2007-01-08 15:35:08 +00:00
Alasdair Kergon
5b95f17814 Lots of dmevent changes.
Export dm_basename().
Cope with a trailing space when comparing tables prior to possible reload.
2007-01-08 15:18:52 +00:00
Alasdair Kergon
b700541f3b Avoid deptree attempting to suspend a device that's already suspended. 2006-10-13 14:03:35 +00:00
Alasdair Kergon
9dd3071462 noflush code fixes: missing debug log; non-standard variable name 2006-10-12 17:29:05 +00:00
Alasdair Kergon
f916f0a7b7 Add suspend noflush support.
Add basic dmsetup loop support.
2006-10-12 15:42:25 +00:00
Alasdair Kergon
6fb265fa3b Reorder mm bounds_check code to reduce window for a dmeventd race. (dm_free_aux) 2006-09-19 17:30:04 +00:00
Alasdair Kergon
9e063b223e Add dm_snprintf 2006-08-21 12:52:39 +00:00
Alasdair Kergon
7d7736b7b4 Add dm_split_words() and dm_split_lvm_name() to libdevmapper. 2006-08-21 12:07:03 +00:00
Alasdair Kergon
d6a93541b6 reorder bounds check code 2006-08-18 21:38:58 +00:00
Alasdair Kergon
433b160fad Add lockfs indicator to debug output. 2006-08-08 21:22:31 +00:00
Alasdair Kergon
def6f767c3 Don't suppress identical table reloads if permission changes. 2006-06-14 22:00:03 +00:00
Alasdair Kergon
311d6d811b Fix corelog segment line.
Suppress some compiler warnings.
2006-05-16 16:20:29 +00:00
Alasdair Kergon
9723090c92 Add DM_CORELOG flag to dm_tree_node_add_mirror_target(). 2006-05-11 19:10:55 +00:00
Alasdair Kergon
7dc850db3e coverity fixes 2006-05-10 16:23:41 +00:00
Alasdair Kergon
9e8a7c7dab remove inlines 2006-04-19 18:12:33 +00:00
Alasdair Kergon
b4cbeca164 fix makefile 2006-04-19 17:32:05 +00:00
Alasdair Kergon
0c8ff3ad63 make pkgconfig installation step optional, and clean up generated files 2006-04-19 16:38:56 +00:00
Alasdair Kergon
8a2fc58645 Check for libsepol.
Add some cflow & scope support.
Separate out DEFS from CFLAGS.
Remove inlines and use unique function names.
2006-04-19 15:33:07 +00:00
Alasdair Kergon
d81e3d0bad configure/makefile tidying + pkg-config support. 2006-04-19 15:23:10 +00:00
Alasdair Kergon
99048d18b9 Use name-based device refs if kernel doesn't support device number refs.
Fix memory leak (struct dm_ioctl) when struct dm_task is reused.
2006-04-03 15:56:02 +00:00
Alasdair Kergon
73f378f226 If _create_and_load_v4 fails part way through, revert the creation. 2006-03-30 15:15:47 +00:00
Alasdair Kergon
f4db3724f9 Add file & line to dm_strdup_aux(). 2006-02-23 19:11:51 +00:00
Alasdair Kergon
6ef080af04 A setgeometry implementation. [untested] 2006-02-20 23:55:58 +00:00
Alasdair Kergon
2d2b610fb9 fix mirror log parm count 2006-02-08 14:14:13 +00:00
Alasdair Kergon
67b25ed49f add clustered log uuid 2006-02-06 20:18:10 +00:00
Alasdair Kergon
90a34450e5 Change prefix for clustered log from "clustered " to "clustered_" 2006-02-06 19:32:18 +00:00
Alasdair Kergon
b5d8ff1014 Add exported functions to set uid, gid and mode. [Bastian Blank] 2006-02-03 14:23:22 +00:00
Alasdair Kergon
044810c229 remove unnecessary 0 in format string 2006-02-02 17:23:04 +00:00
Alasdair Kergon
5e3bd86778 Rename _log to dm_log and export.
Fix misc compile-time warnings.
2006-01-31 14:50:38 +00:00
Alasdair Kergon
c55b141005 Add dm_tree_skip_lockfs. 2006-01-30 23:36:04 +00:00
Alasdair Kergon
c507b684ce Fix dm_strdup debug definition. 2006-01-11 15:40:54 +00:00
Alasdair Kergon
fe94f9f170 Fix dm_strdup debug definition. 2006-01-10 22:19:41 +00:00
Alasdair Kergon
b6b0c621f6 Fix hash function to avoid using a negative array offset. 2006-01-09 20:35:24 +00:00
Alasdair Kergon
e7ab6006c5 Don't inline _find in hash.c and tidy signed/unsigned etc. 2006-01-04 16:07:27 +00:00
Alasdair Kergon
1c9b9a5ecf Fix libdevmapper.h #endif 2006-01-04 16:05:44 +00:00
Alasdair Kergon
ce7ed2c0a9 Change dm_tree_node_add_mirror_target_log parm order 2005-12-19 21:03:17 +00:00
Alasdair Kergon
dbcb64b80f Add sync, nosync and block_on_error mirror log parameters.
Add hweight32.
2005-12-13 15:49:27 +00:00
Alasdair Kergon
dd3ec4e87a dmeventd updates 2005-12-02 15:39:16 +00:00
Alasdair Kergon
774ed5fc39 Export dm_task_update_nodes.
Use names instead of numbers in messages when ioctls fail.
2005-12-01 23:11:41 +00:00
Alasdair Kergon
56c282920c Resume snapshot-origins last. 2005-11-22 20:00:35 +00:00
Alasdair Kergon
7707ea90f4 Suppress unnecessary resumes. 2005-11-22 19:31:20 +00:00
Alasdair Kergon
ec289b64b9 Drop leading zeros from dm_format_dev.
Suppress attempt to reload identical table.
2005-11-22 18:43:12 +00:00
Alasdair Kergon
87f98002b5 Additional LVM- prefix matching for transitional period. 2005-11-12 22:46:48 +00:00
Alasdair Kergon
5dd9b4656f more debug fixes 2005-11-11 16:16:37 +00:00
Alasdair Kergon
bf9c60feb5 Fix selinux compile. 2005-11-10 18:31:17 +00:00
Alasdair Kergon
91a7cf559d fix debug linking 2005-11-10 16:33:04 +00:00
Alasdair Kergon
e422819389 remove a debugging line 2005-11-10 15:17:54 +00:00
Alasdair Kergon
e6a6954ef1 revert - alternative pvmove fix, disabling preloading completely for now 2005-11-09 23:57:40 +00:00
Alasdair Kergon
abbca21248 more mirror fixing 2005-11-09 18:13:10 +00:00
Alasdair Kergon
24b026e333 some fixes for mirrors 2005-11-09 17:32:31 +00:00
Alasdair Kergon
908db0785f fix last checkin 2005-11-09 15:41:42 +00:00
Alasdair Kergon
b4f1578fc2 rename deptree 2005-11-09 14:10:50 +00:00
Alasdair Kergon
165e4a112b New activation code. [Not ready to be used yet.] 2005-11-08 22:50:11 +00:00
Alasdair Kergon
872dea0401 fix strncmps 2005-10-26 18:33:47 +00:00
Alasdair Kergon
268e8dd406 Fix incorrect checkin 2005-10-26 18:32:57 +00:00
Alasdair Kergon
1a44c009b0 Fix strncmps. 2005-10-26 18:17:36 +00:00
Alasdair Kergon
19f792df43 Also suppress error if device doesn't exist with DM_DEVICE_STATUS. 2005-10-26 17:51:10 +00:00
Alasdair Kergon
2b69db1f25 attempt to cope with uuid transition 2005-10-26 15:21:13 +00:00
Alasdair Kergon
690a5da2e7 check parents suspended 2005-10-26 14:08:24 +00:00
Alasdair Kergon
db208f51fd unfinished suspend functions 2005-10-25 19:09:41 +00:00
Alasdair Kergon
3aeb569036 Export dm_set_selinux_context. 2005-10-25 17:30:00 +00:00
Alasdair Kergon
bc70fb17c0 zero suppress 2005-10-20 20:38:18 +00:00
Alasdair Kergon
3618f6eba7 fix dev no printf 2005-10-20 20:29:58 +00:00
Alasdair Kergon
a6d97ede7b cope with null uuid_prefix 2005-10-18 13:57:11 +00:00
Alasdair Kergon
a38bf76bab Tidy some log mesgs. 2005-10-18 13:07:41 +00:00
Alasdair Kergon
3e8c6b731a Add deactivation functions 2005-10-18 12:37:53 +00:00