summaryrefslogtreecommitdiff
path: root/libdm/dm-tools
Commit message (Collapse)AuthorAgeFilesLines
* cov: hide some false positivesZdenek Kabelac2023-05-101-0/+1
| | | | | | Hide some false positives. Note: there must not a be blank line after coverity hiding comment.
* configure.ac: add STATIC_LDFLAGSDavid Seifert2023-02-231-2/+2
| | | | Add support for specif STATIC_LDFLAGS when linking static binaries.
* cov: fix buffer size usageZdenek Kabelac2022-12-201-1/+1
| | | | Count with extra 1 byte for buffer end '\0'.
* dmsetup: fix udev event handling for createZdenek Kabelac2022-11-251-5/+9
| | | | | | | | | | | | | | | | | | | | With newer kernels (>5.13) DM_CREATE no longer generates uevent for DM devices without table. There are even no sysfs block device entries in such case, although device has asigned major:minor and it is being listed by 'dmsetup info'. So this patch calculates amount of 'table' lines and in case no table line comes from cmdline or stdin - waiting on cookie is avoided generically instead of disabling just case with option --notable - which then also skipped handling of an option --addnodeoncreate (which is however historical and should be avoided) As a result there should be no leaking udev cookies and endlessly waiting commands like this: dmsetup create mytestdev </dev/null
* dmsetup: check also for ouf of range valueZdenek Kabelac2022-08-191-1/+2
| | | | Check errno result from strtoull().
* cov: validate subcommand existanceZdenek Kabelac2021-10-151-2/+2
| | | | | Before dereference of subcommand pointer, check it's not NULL as coverity believes there exists theoretical path for this...
* dmsetup: fix measure handlingZdenek Kabelac2021-09-271-1/+2
| | | | | | Previous patch f853a1bc7afdebb44aeb8c1167e8784d155cad84 enabled ima measurement unconditionally for every status call, but it needs to be set only for 'dmsetup measure' command.
* libdm: dmsetup measure support for IMAAlasdair G Kergon2021-09-231-0/+4
| | | | | | | Add support for DM_IMA_MEASUREMENT_FLAG with DM_TABLE_STATUS_CMD. This feature requires DM version 4.45 (5.15+ kernels)
* cov: ignore leak of fd descriptorZdenek Kabelac2021-09-211-5/+4
| | | | There is no 'fd' leak.
* cov: mask some warning about leakageZdenek Kabelac2021-09-201-0/+1
| | | | Mask false-positive leak report.
* cov: hide reports from optarg being NULLZdenek Kabelac2021-09-201-2/+2
| | | | | | It's basically irrelavant which value we assing to optarg, since it's set by getopt() function, but Coverity tool is incorrectly reporting possibly dereference of NULL.
* cov: add explicit NULL pointer checkZdenek Kabelac2021-09-201-3/+4
| | | | Make obvious to coverity strcmp() is not getting NULL pointer.
* cov: use different variable nameZdenek Kabelac2021-09-201-4/+4
| | | | Better for Coverity to see no change for possibly opened handle.
* gcc-fanalyzer: better losetup error pathZdenek Kabelac2021-09-201-0/+3
| | | | | Fix leaking memory on error path on _process_losetup_switches(). However real impact is close to zero as dm-loop target isn't really used.
* cov: daemonize avoid leak of FD on error pathZdenek Kabelac2021-04-231-10/+13
| | | | | Use our common patter for reopening FDs to /dev/null that avoids leaking FD on error path.
* makefiles: static linking enhancementsZdenek Kabelac2021-04-121-12/+13
|
* libdm: use libdm header util.hZdenek Kabelac2021-03-301-0/+41
| | | | Avoid using lvm header for libdm build.
* make: cflow target works againZdenek Kabelac2021-03-201-0/+5
| | | | | Restored 'make cflow' functinality. Produces some quick referece of function chaining and usage.
* cov: ensure buffer is initializedZdenek Kabelac2021-03-101-0/+1
|
* debug: change sys_error to sys_debugZdenek Kabelac2021-03-101-4/+4
| | | | | These messages do not cause command error - so changing logging level to just 'sys_debug' (so visible only with -vvvv)
* makefiles: better loggingZdenek Kabelac2021-03-021-2/+2
| | | | | Show only filename instead of full path name when building in builddir != srcdir
* dmsetup: initilize winsize structZdenek Kabelac2020-09-011-1/+1
| | | | Ensure winsize struct is always defined.
* gcc: do not use return with void functionZdenek Kabelac2020-08-281-4/+8
| | | | | Follow C norm and do not use 'return' in void function to call other functions.
* dmsetup: no memleak on failed realocationZdenek Kabelac2020-02-041-2/+4
| | | | clang: keep old buf pointer for release on failing realloc() codepath.
* dm: fix compilation of dmsetupMarian Csontos2019-10-221-1/+1
| | | | | Fix: 889c88e9dab33195efc4dc0400a4b0aaa3383948 Use correct enum DM_DEVICE_GET_TARGET_VERSION.
* dm: introduce DM_GET_TARGET_VERSIONMikulas Patocka2019-10-041-0/+28
| | | | | | | | Adds support for the DM_GET_TARGET_VERSION to dmsetup. It introduces a new comman "target-version" that will accept list of targets and print their version. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
* dmsetup: do not treat no groups as an error in dmstats list --groupBryn M. Reeves2019-09-301-2/+4
| | | | | | Analogous to the case of a device with no regions, it is not an error to attempt to list the stats groups on a device that has no configured groups: just return success and continue.
* dmsetup: missed trailing newlineZdenek Kabelac2019-08-261-1/+1
|
* dmsetup: debug printZdenek Kabelac2019-08-201-0/+1
| | | | | | | Udev debugging is a bit tricky, so to more easily pair cookie ID, which is the lowest 16 bit - print cookie as hexa number. This simplify pairing of processed cookies while the 'higher bit flags' are changed for the same cookie.
* dmsetup: Fix multi-line concise table parsingAlasdair G Kergon2019-02-251-1/+1
| | | | | | | | Use the correct loop variable within the loop, instead of reusing the initial value. Table lines after the first don't get terminated in the right place. Signed-off-by: Kurt Garloff <kurt@garloff.de>
* configure: avoid repeative inclusion of configure.hZdenek Kabelac2018-12-211-1/+0
| | | | | | | | | | Since configure.h is a generated header and it's missing traditional ifdefs preambule - it can be included & parsed multiple times. Normally compiler is fine when defines have same value and there is no warning - yet we don't need to parse this several times and by adding -include directive we can ensure every file in the package is rightly compile with configure.h as the first header file.
* makefiles: dm-tools improve MakefileZdenek Kabelac2018-12-171-48/+39
|
* dmfilemapd: avoid linking with DL_LIBSZdenek Kabelac2018-12-141-2/+2
| | | | | Dmfilemapd is not using dlopen so doesn't need to be linked with DL_LIBS.
* headers: use configure.h as 1st. headerZdenek Kabelac2018-12-141-2/+0
| | | | | | | | | | | Ensure configure.h is always 1st. included header. Maybe we could eventually introduce gcc -include option, but for now this better uses dependency tracking. Also move _REENTRANT and _GNU_SOURCE into configure.h so it doesn't need to be present in various source files. This ensures consistent compilation of headers like stdio.h since it may produce different declaration.
* makefiles: updates for less verbosityZdenek Kabelac2018-11-291-4/+8
|
* cov: remove unused assignsZdenek Kabelac2018-11-051-2/+2
|
* cov: hide intentionaly ptr arithmetic reportZdenek Kabelac2018-11-031-0/+1
| | | | Only single region count is ever replaced with on-stack uint64_t.
* dmsetup: fix stats report command outputBryn M. Reeves2018-11-011-7/+3
| | | | | | | | | | | | | | Since the stats handle is neither bound nor listed before the attempt to call dm_stats_get_nr_regions(), it will always return zero: this prevents reporting of any dmstats regions on any device. Remove the dm_stats_get_nr_regions() check and instead rely on the correct return status from dm_stats_populate() which only returns 0 in the case that there are regions to inspect (and which logs a specific error for all other cases). Reported-by: Bryan Gurney <bgurney@redhat.com>
* cov: dmstats check for failing mallocZdenek Kabelac2018-10-151-1/+4
| | | | Add missing check for allocation success.
* dmsetup: fix error propagation in _display_info_cols()Bryn M. Reeves2018-06-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 3f35146 added a check on the value returned by the _display_info_cols() function: 1024 if (!_switches[COLS_ARG]) 1025 _display_info_long(dmt, &info); 1026 else 1027 r = _display_info_cols(dmt, &info); 1028 1029 return r; This exposes a bug in the dmstats code in _display_info_cols: the fact that a device has no regions is explicitly not an error (and is documented as such in the code), but since the return code is not changed before leaving the function it is now treated as an error leading to: # dmstats list Command failed. When no regions exist. Set the return code to the correct value before returning.
* build: include configure.hZdenek Kabelac2018-06-221-2/+2
| | | | | | It's important to consistenly include configure.h as the 1st. header. It containts #defines influencing behavior of other included header files.
* dmfilemapd: Move to libdm/dm-toolsJoe Thornber2018-06-143-4/+874
| | | | No longer uses any lvm code.
* dmsetup: move to libdm/dm-tools/dmsetupJoe Thornber2018-06-144-0/+7612
links against libdevmapper again. no longer includes code from lvm.