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

170 Commits

Author SHA1 Message Date
Alasdair Kergon
8344acfa2d update old comment 2011-12-01 14:57:30 +00:00
Peter Rajnoha
2f64783850 Add --retry option for dmsetup remove to retry removal if not successful. 2011-09-22 17:12:28 +00:00
Alasdair Kergon
9a9dde2d8c pre-release fixes incl make distclean and configure --with-raid=none/shared 2011-08-11 19:18:17 +00:00
Milan Broz
cc2dcab096 Remove dev name prefix from dmsetup line output if major and minor is used. 2011-08-11 17:06:24 +00:00
Zdenek Kabelac
45e96ab875 Minor memory leak fix
Defer the test of the function return value after the string memory is released.
Otherwise in this error path the string would present memory leak.
(Thought in this case we are already out of memory...)
2011-08-04 12:40:24 +00:00
Alasdair Kergon
4ccc44282e Remove dev name prefix from dmsetup line output if exactly one dev requested. 2011-07-08 17:08:19 +00:00
Alasdair Kergon
0eee66e257 Add framework for validation of ioctls. Doesn't do any checks yet.
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
2011-07-01 14:09:19 +00:00
Alasdair Kergon
06577e86d8 Add age filter to dmsetup udevcomplete_all to minimise concurrency problems. 2011-06-29 21:56:46 +00:00
Alasdair Kergon
ea687806b3 Move udev_only logic inside stacked node op code.
(We still need to treat add+readhead+del as a no-op.)
Rename udev_fallback to verify_udev_operations.
Rename --udevfallback to --verifyudev
2011-06-27 21:43:58 +00:00
Peter Rajnoha
c99e816790 Disable udev fallback and add --udevfallback option to dmsetup. 2011-06-17 14:55:51 +00:00
Peter Rajnoha
b7c85c8aa6 Require libudev >= 143 when compiling with udev support.
Old versions of libudev < 143 were experimental and unstable. Require recent
and stable versions only (version 143 is old enough anyway).
2011-04-22 11:56:41 +00:00
Zdenek Kabelac
1f7f7cb701 Fix some unmatching sign comparation gcc warnings
Simple replacement for unsigned type - usually in for() loops.
2011-04-08 14:40:18 +00:00
Zdenek Kabelac
8207745583 Add attribute printf 2011-03-29 21:56:53 +00:00
Zdenek Kabelac
c2759c3644 Const warning fixes
With recent update of dm_report_field_string() API call to accept
completely const objects - we no longer need loose constness here
and keep it forwarding.
2011-03-29 21:49:18 +00:00
Alasdair Kergon
fa61ff55de Accept multiple mapped device names on many dmsetup command lines. 2011-03-02 02:44:56 +00:00
Alasdair Kergon
9a45e3dbbb Fix dm_udev_wait calls in dmsetup to occur before readahead display not after.
Include an implicit dm_task_update_nodes() within dm_udev_wait().
2011-03-02 00:29:57 +00:00
Zdenek Kabelac
aed211833d Fix gcc warnings for unused variables
Put dead assigment code into comment.
2011-02-18 16:17:56 +00:00
Zdenek Kabelac
b44de841ff Add configure option --with-device-nodes-on
Make configurable default behaviour how to deal with device node creates.
With udev system natural options should be  'resume'.
For older systems where user expect there is node in /dev/mapper immediately
after  dmsetup create --notable  -  use 'create'

FIXME:
Code needs fixing passing this flag through udev cookie.
2011-02-04 22:17:54 +00:00
Zdenek Kabelac
84f191ce5a Add --addnodeonresume, --addnodeoncreate
Add new function dm_task_set_add_node() to select between 2 types
of node creation in device directory.

DM_ADD_NODE_ON_RESUME is now default and ensures node is created on
resume. Old original behavior is accessible with DM_ADD_NODE_ON_CREATE.
In this case node would be created during dmsetup create --notable.

For the user 2 new options for dmsetup create are added:
[{--addnodeonresume | --addnodeoncreate }]

Properly working node creation on resume is needed for proper operation
stacking and ability to correctly check in which state the device should
after whole udev transation.
2011-02-04 19:33:53 +00:00
Zdenek Kabelac
0f3ab63a24 Remove dead assignment
Variable 'r' is never read so remove it and just cast result from
_error_device function to (void).
2010-12-20 14:36:12 +00:00
Zdenek Kabelac
1c6b3062bf Switch void* to char* arithmetic 2010-12-20 13:37:26 +00:00
Zdenek Kabelac
c697497923 Test uuid for NULL
Add test for NULL before passing uuid as src argument to memcpy.
As memcpy function is declared as function not accepting NULL.
Though we pass NULL only with zero length so this patch presents
no functional change to the code.
2010-11-30 22:53:37 +00:00
Zdenek Kabelac
732528e1c0 Fix memory leak in error path
Release allocated path buffer in error path.
2010-11-24 09:43:18 +00:00
Zdenek Kabelac
c755772a23 Fix constness warning
Fix usage of const 'data' pointer and also assign void* directly without
uneeded cast for C.
2010-10-25 13:36:57 +00:00
Alasdair Kergon
5426e85284 Add --setuuid to dmsetup rename.
Add dm_task_set_newuuid to set uuid of mapped device post-creation. (pjones)
2010-10-15 01:10:27 +00:00
Alasdair Kergon
a65df0e598 Add dm_zalloc and use it and dm_pool_zalloc throughout. 2010-09-30 21:06:50 +00:00
Zdenek Kabelac
a7ca42cb22 Wait for node creation before displaying debug info in dmsetup.
Readahead check needs to see created node - so wait till udev gets in sync.
2010-08-03 13:04:32 +00:00
Zdenek Kabelac
a8dc5260b7 Fix return status 0 for "dmsetup info -c -o help".
Solution returns success for _report_init when help is passed,
and caller needs to check for _report existance.
2010-08-03 12:56:00 +00:00
Alasdair Kergon
2d3164a59f Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
Zdenek Kabelac
69ca87abad Revert previous commit as it would return also for incorrect syntax. 2010-07-08 14:29:26 +00:00
Zdenek Kabelac
8a9f96b21c Set return value 0 for 'dmsetup -c -o help' 2010-07-08 13:31:03 +00:00
Alasdair Kergon
b02de599a0 Fix dmlosetup snprintf %llu compiler warning. 2010-07-05 22:56:31 +00:00
Peter Rajnoha
68c7b86df1 Add support for new IMPORT{db} udev rule.
This rule appeared in udev v152 and it helps us to support spurious events
where we didn't have any flags set (events originated in udevadm trigger
or the watch rule). These flags are important to direct the rule application.
Now, with the help of this rule, we can regenerate old udev db content.
To implement this correctly, we need to flag all proper DM udev events with
DM_UDEV_PRIMARY_SOURCE_FLAG. That happens automatically for all ioctls
generating events originated in libdevmapper.
2010-04-28 13:37:36 +00:00
Milan Broz
7b030379ec Wipe dm-ioctl parameters in memory after use. 2010-04-07 15:57:20 +00:00
Peter Rajnoha
940c32c5dd 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
Milan Broz
985d87b5eb Add --help dmsetup option as the synonym for help command. 2010-03-08 16:05:07 +00:00
Peter Rajnoha
276d32973f 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
zkabelac
44e17e2aa9 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
Peter Rajnoha
8e7c6b60fb 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
837adeea7f Add --noudevrules option for dmsetup to disable /dev node management by udev. 2010-01-07 19:45:12 +00:00
zkabelac
b1f8076da0 Cleanup returns for void functions. 2009-12-11 13:16:37 +00:00
zkabelac
98af0ba143 Fix coredump and memory leak for 'dmsetup help -c' 2009-12-11 13:04:30 +00:00
Peter Rajnoha
88b0c82a0d 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
Alasdair Kergon
21ed352ac5 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
Peter Rajnoha
0f64ddf2fb 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
68069c70e1 Add udev flags support in libdevmapper and provide 'dmsetup udevflags' command to decode them. 2009-10-22 12:55:47 +00:00
Peter Rajnoha
0d98ee8916 Add y|--yes option for dmsetup to provide a default 'YES' answer to questions. 2009-09-11 15:53:57 +00:00
Peter Rajnoha
99b7ce7bf5 Fix semaphore includes in dmsetup for udev sync. 2009-08-06 15:56:50 +00:00
Peter Rajnoha
afc8c05f7f Add 'udevcookies' command for dmsetup. 2009-08-06 15:05:10 +00:00
Peter Rajnoha
886e528490 Add 'udevcomplete_all' command for dmsetup. Export DM_COOKIE_MAGIC in libdevmapper.h. 2009-08-06 15:04:30 +00:00