summaryrefslogtreecommitdiff
path: root/libdm/misc
Commit message (Collapse)AuthorAgeFilesLines
* libdm: dmsetup measure support for IMAAlasdair G Kergon2021-09-231-3/+9
| | | | | | | Add support for DM_IMA_MEASUREMENT_FLAG with DM_TABLE_STATUS_CMD. This feature requires DM version 4.45 (5.15+ kernels)
* libdm: support DM_NAME_LIST_FLAGZdenek Kabelac2021-09-231-0/+14
| | | | | | | | | | | | | | | | | Kernel patch 8b638081bd4520f63db1defc660666ec5f65bc15 introduced support to return UUID in DM_LIST_DEVICES_CMD. Useful when asking for UUID of each device where the list could be now returned directly with NAME && UUID for each device. Returning UUID is done in backward-compatible way. There's one unused 32-bit word value after the event number. This patch sets the bit DM_NAME_LIST_FLAG_HAS_UUID if UUID is present and DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID if it isn't (if none of these bits is set, then we have an old kernel that doesn't support returning UUIDs). The UUID is stored after this word. The 'next' value is updated to point after the UUID, so that old version of libdevmapper will skip the UUID without attempting to interpret it.
* gcc: use more zero length arraysZdenek Kabelac2021-09-222-5/+5
| | | | Define last array struct member with zero size.
* libdm: fix compiling with older gccZdenek Kabelac2021-04-061-1/+4
|
* libdm: symbol versioning with -fltoZdenek Kabelac2021-04-061-5/+22
| | | | | | | | | | | | | Gcc10 introduced different strategy how to build shared libraries with their new LTO optimizer. Insired by: https://akkadia.org/drepper/symbol-versioning https://sourceware.org/pipermail/elfutils-devel/attachments/20200414/1c0c2903/attachment.bin https://github.com/InBetweenNames/gentooLTO/issues/459 https://github.com/linux-rdma/rdma-core/blob/master/util/symver.h https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200
* libdm: use libdm header util.hZdenek Kabelac2021-03-301-1/+1
| | | | Avoid using lvm header for libdm build.
* configure: support builds without versioningZdenek Kabelac2021-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not all libc (like musl, uclibc dietlibc) libraries support full symbol version resolution in runtime like glibc. Add support to not generate symbol versions when compiling against them. Additionally libdevmapper.so was broken when compiled against uclibc. Runtime linker loader caused calling dm_task_get_info_base() function recursively, leading to segmentation fault. Introduce --with-symvers=STYLE option, which allows to choose between gnu and disabled symbol versioning. By default gnu symbol versioning is used. __GNUC__ check is replaced now with GNU_SYMVER. Additionally ld version script is included only in case of gnu option, which slightly reduces output size. Providing --without-symvers to configure script when building against uclibc library fixes segmentation fault error described above, due to lack of several versions of the same symbol in libdevmapper.so library. Based on: https://patchwork.kernel.org/project/dm-devel/patch/20180831144817.31207-1-m.niestroj@grinn-global.com/ Suggested-by: Marcin Niestroj <m.niestroj@grinn-global.com>
* gcc: zero-sized array to fexlible array C99Zdenek Kabelac2020-09-011-4/+4
| | | | | | | | | | | | | | Switch remaining zero sized struct to flexible arrays to be C99 complient. These simple rules should apply: - The incomplete array type must be the last element within the structure. - There cannot be an array of structures that contain a flexible array member. - Structures that contain a flexible array member cannot be used as a member of another structure. - The structure must contain at least one named member in addition to the flexible array member. Although some of the code pieces should be still improved.
* dm: introduce DM_GET_TARGET_VERSIONMikulas Patocka2019-10-041-0/+2
| | | | | | | | 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>
* configure: avoid repeative inclusion of configure.hZdenek Kabelac2018-12-211-2/+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.
* headers: use configure.h as 1st. headerZdenek Kabelac2018-12-141-3/+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.
* cleanup: move cast to det_t into MKDEV macroZdenek Kabelac2018-11-051-1/+1
|
* libdm: Stop libdm/misc/dmlib.h from including lib/misc/lib.hJoe Thornber2018-06-081-3/+64
|
* build: Don't generate symlinks in include/ dirJoe Thornber2018-05-143-4/+4
| | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* kernel: Refresh dm-ioctl.hAlasdair G Kergon2017-09-141-4/+6
| | | | Adds DM_DEV_ARM_POLL
* cleanup: fix some typosEric Ren2017-07-101-1/+1
| | | | | | | form -> from accomodate -> accommodate Signed-off-by: Eric Ren <zren@suse.com>
* libdm: use dm_log_with_errno alwaysZdenek Kabelac2016-11-031-8/+2
| | | | | | | | | | | | | | Instead of compiling 2 log call for 2 different logging functions, and runtime decide which version to use - use only 'newer' function and when user sets his own OLD dm_log logging translate it runtime for old arg list set. The positive part is - we get shorter generated library, on the negative part this translation means, we always have evaluate all args and print the message into local on stack buffer, before we can pass this buffer to the users' logging function with proper expected parameters (and such function may later decide to discard logging based on message level so whole printing was unnecessary).
* doc: change fsf addressZdenek Kabelac2016-01-213-3/+3
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* libdm: Add DM_INTERNAL_SUSPEND_FLAG.Alasdair G Kergon2015-04-231-3/+8
| | | | Still needs to be reported by dmsetup.
* libdm: Add DM_DEFERRED_REMOVE to dm-ioctl.h.Alasdair G Kergon2014-08-151-3/+14
|
* cleanup: self compilable headersZdenek Kabelac2013-12-121-0/+2
|
* gcc: replace #ifdef linux with __linux__Alasdair G Kergon2013-11-131-1/+1
|
* ioctl: add DM_DATA_OUT_FLAG to dm-ioctl.hAlasdair G Kergon2013-05-171-3/+8
|
* logging: add debug classesAlasdair G Kergon2013-01-071-0/+3
| | | | | | | | | | | | Add log/debug_classes to lvm.conf to allow debug messages to be classified and filtered at runtime. The dm_errno field is only used by log_error(), so I've redefined it for log_debug() messages to hold the message class. By default, all existing messages appear, but we can add categories that generate high volumes of data, such as logging all traffic to/from lvmetad.
* dmsetup: allow --noflush with status/wait for thinAlasdair G Kergon2012-07-271-5/+7
| | | | | Allow --noflush with dmsetup status and wait (for thin target 1.3.0 / ioctl 4.23.0).
* cmirrord now returns log name to kernel in CTR so it can be registeredJonathan Earl Brassow2011-10-141-5/+13
| | | | | | | | | | | | Version 2 of the userspace log protocol accepts return information during the DM_ULOG_CTR exchange. The return information contains the name of the log device that is being used (if there is one). The kernel can then register the device via 'dm_get_device'. Amoung other things, this allows for userspace to assemble a correct dependency tree of devices - critical for LVM handling of suspend/resume calls. Also, update dm-log-userspace.h to match the kernel header associated with this protocol change. (Includes a version inc.)
* Update stale libdm/misc/dm-log-userspace.hJonathan Earl Brassow2011-10-141-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream kernel version that this file mirrors has changed, here is the commit message: commit 86a54a4802df10d23ccd655e2083e812fe990243 Author: Jonathan Brassow <jbrassow@redhat.com> Date: Thu Jan 13 19:59:52 2011 +0000 dm log userspace: add version number to comms This patch adds a 'version' field to the 'dm_ulog_request' structure. The 'version' field is taken from a portion of the unused 'padding' field in the 'dm_ulog_request' structure. This was done to avoid changing the size of the structure and possibly disrupting backwards compatibility. The version number will help notify user-space daemons when a change has been made to the kernel/userspace log API. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
* Suport DM_SECURE_DATA_FLAG.Milan Broz2011-02-041-2/+8
| | | | | It will be user for cryptsetup to ensure buffers are properly wiped when sending sensitive data (key).
* Use a more-generic name for the new kernel flag so list_devices can share it.Alasdair Kergon2010-10-251-1/+1
|
* Add --setuuid to dmsetup rename.Alasdair Kergon2010-10-151-3/+9
| | | | Add dm_task_set_newuuid to set uuid of mapped device post-creation. (pjones)
* Use flexible data[] in cmirrord request to prevent abort in runtime size checks.Milan Broz2010-06-221-1/+1
|
* Add support for dm-mod module autoload.Peter Rajnoha2010-06-011-0/+1
| | | | | | | | A kernel patch is on its way for 2.6.35 adding support for dm-mod module autoload. Udev v155 and higher is able to read static node information given in modules.devname (extracted by depmod before) and will create such nodes at its start. The first access to such node will load the module automatically (directly in kernel) before the actual read/write operation is processed.
* Add support for ioctl's DM_UEVENT_GENERATED_FLAG.Peter Rajnoha2010-03-231-2/+7
| | | | | | | | | | | | | 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.
* more build fixesAlasdair Kergon2010-01-191-1/+1
|
* Add support for querying a device's inactive table.Alasdair Kergon2009-11-061-3/+10
| | | | | Currently this data is invisible to userspace. Requires dm >= 4.16 (likely to be in linux 2.6.33).
* Cluster log server (clogd): Add new build files.Jonathan Earl Brassow2009-08-131-0/+397
| | | | Might be a good idea to add the new files to the repository. :(
* Add default udev rules.Alasdair Kergon2009-08-031-2/+12
| | | | Update dm-ioctl.h comments.
* Add log_errno to set a specific errno and replace log_error in due course.Alasdair Kergon2009-07-161-3/+4
|
* New LOG_MESG macro to fix file/line number logging for memory leaks afterAlasdair Kergon2009-07-151-3/+5
| | | | LOG_LINENO macro was added.
* Add dm_log_with_errno and dm_log_with_errno_init, deprecating the oldAlasdair Kergon2009-07-101-1/+8
| | | | | 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.
* more tweaking to get things to compile - dmlib.h for log fns, list.hAlasdair Kergon2008-11-031-0/+26
|
* Add dm-logging.h ready for libdevmapper.Alasdair Kergon2008-10-301-0/+27
|
* Add libdm subdir to begin merging the device-mapper tree.Alasdair Kergon2008-10-302-0/+326