summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* spec: Update to use enable_lockd_*dev-mcsontos-lockd-testMarian Csontos2015-07-072-2/+25
|
* conf: regeneratePeter Rajnoha2015-07-072-0/+35
|
* tests: use old snapshot for huge volumesZdenek Kabelac2015-07-071-1/+1
| | | | Avoid stacking thins over thins.
* cache: support clear-needs-checkZdenek Kabelac2015-07-077-4/+84
| | | | | | | Support newer cache tool which support new option --clear-needs-check-flag. Code does same as for thin_check.
* lvmetactl: program to interact with lvmetadDavid Teigland2015-07-062-1/+188
| | | | | This is not installed; it's only a developer utility at this point.
* man lvmlockd: minor updatesDavid Teigland2015-07-061-11/+25
|
* configure: Separate sanlock and dlm lock config.Alasdair G Kergon2015-07-064-249/+292
|
* config: remove read_only_lock_modesDavid Teigland2015-07-062-19/+0
| | | | | It had been added as part of lvmlockd code, but it does not seem particularly useful.
* lockd: remove unused code for overriding lock modesDavid Teigland2015-07-063-127/+1
| | | | | | | | | | including the allow_override_lock_modes setting. It was not possible to override default lock modes any longer, since the command line options had already been removed. A mechanism will probably be required later that puts part of this back.
* config: rename lock_retries lvmlockd_lock_retriesDavid Teigland2015-07-064-9/+9
| | | | | Because it only applies to lvmlockd requests, but sounded too general.
* include: Standardise around new tool.h.Alasdair G Kergon2015-07-0637-137/+139
|
* configure: enable building lvmlockd without sanlock or dlmDavid Teigland2015-07-063-50/+275
|
* clean-up: typos s/bellow/below/Jonathan Brassow2015-07-064-4/+4
|
* macros: Wrap PRI with FMT.Alasdair G Kergon2015-07-0623-37/+68
| | | | | Create a set of wrappers with embedded % such as #define FMTu64 "%" PRIu64
* lockd: Clean up specMarian Csontos2015-07-042-5/+1
|
* Build lockd only for Fedora >= 22 and RHEL >= 7Marian Csontos2015-07-041-0/+2
|
* post-releaseAlasdair G Kergon2015-07-034-2/+8
|
* pre-releasev2_02_124Alasdair G Kergon2015-07-0312-21/+28
|
* tests: update for new thin pool messagingZdenek Kabelac2015-07-032-6/+3
|
* thin: move pool messaging from resume to suspendZdenek Kabelac2015-07-037-62/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing messaging intarface for thin-pool has a few 'weak' points: * Message were posted with each 'resume' operation, thus not allowing activation of thin-pool with the existing state. * Acceleration skipped suspend step has not worked in cluster, since clvmd resumes only nodes which are suspended (have proper lock state). * Resume may fail and code is not really designed to 'fail' in this phase (generic rule here is resume DOES NOT fail unless something serious is wrong and lvm2 tool usually doesn't handle recovery path in this case.) * Full thin-pool suspend happened, when taken a thin-volume snapshot. With this patch the new method relocates message passing into suspend state. This has a few drawbacks with current API, but overal it performs better and gives are more posibilities to deal with errors. Patch introduces a new logic for 'origin-only' suspend of thin-pool and this also relates to thin-volume when taking snapshot. When suspend_origin_only operation is invoked on a pool with queued messages then only those messages are posted to thin-pool and actual suspend of thin pool and data and metadata volume is skipped. This makes taking a snapshot of thin-volume lighter operation and avoids blocking of other unrelated active thin volumes. Also fail now happens in 'suspend' state where the 'Fail' is more expected and it is better handled through error paths. Activation of thin-pool is now not sending any message and leaves upto a tool to decided later how to finish unfinished double-commit transaction. Problem which needs some API improvements relates to the lvm2 tree construction. For the suspend tree we do not add target table line into the tree, but only a device is inserted into a tree. Current mechanism to attach messages for thin-pool requires the libdm to know about thin-pool target, so lvm2 currently takes assumption, node is really a thin-pool and fills in the table line for this node (which should be ensured by the PRELOAD phase, but it's a misuse of internal API) we would possibly need to be able to attach message to 'any' node. Other thing to notice - current messaging interface in thin-pool target requires to suspend thin volume origin first and then send a create message, but this could not have any 'nice' solution on lvm2 side and IMHO we should introduce something like 'create_after_resume' message. Patch also changes the moment, where lvm2 transaction id is increased. Now it happens only after successful finish of kernel transaction id change. This change was needed to handle properly activation of pool, which is in the middle of unfinished transaction, and also this corrects usage of thin-pool by external apps like Docker.
* libdm: support for posting messages in suspendZdenek Kabelac2015-07-032-0/+19
| | | | | | | | | | | | Add support for sending message in suspend tree for thin-pools. When this operation is requested whole subtree suspend is then skipped. This is experimantal support for new lvm2 code for sending message in suspend phase where 'thin-pool origin-only suspend' will send messages instead of really suspending thin-pool tree. When suspening thin volume origin-only - only thin volume is suspended, then messages are posted and thin-pool suspend is skipped.
* thin: check for overprovisioningZdenek Kabelac2015-07-035-0/+166
|
* report: select: add handler to recognize fuzzy time specificationPeter Rajnoha2015-07-034-2/+1040
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recognize date and time specification within selection criteria that is formulated in a more free-form way besides to the original basic YYYY-MM-DD HH:MM format that libdevmapper supports. Currently, this free-form format is recognized for lv_time field. Users are able to use expressions from this set: - weekday names ("Sunday" - "Saturday" or abbreviated as "Sun" - "Sat") - labels for points in time ("noon", "midnight") - labels for a day relative to current day ("today", "yesterday") - points back in time with relative offset from today (N is a number) ( "N" "seconds"/"minutes"/"hours"/"days"/"weeks"/"years" "ago") ( "N" "secs"/"mins"/"hrs" ... "ago") ( "N" "s"/"m"/"h" ... "ago") - time specification either in hh:mm:ss format or with AM/PM suffixes - month names ("January" - "December" or abbreviated as "Jan" - "Dec") For example: $ date Fri Jul 3 10:11:13 CEST 2015 $ lvmconfig --type full report/time_format time_format="%a %Y-%m-%d %T %z %Z [%s]" $ lvs LV VG Time lvol0 vg Fri 2014-08-22 21:25:41 +0200 CEST [1408735541] lvol2 vg Sun 2015-04-26 14:52:20 +0200 CEST [1430052740] root fedora Wed 2015-05-27 08:09:21 +0200 CEST [1432706961] swap fedora Wed 2015-05-27 08:09:21 +0200 CEST [1432706961] lvol1 vg Tue 2015-06-30 03:25:43 +0200 CEST [1435627543] lvol3 vg Tue 2015-06-30 14:52:23 +0200 CEST [1435668743] lvol6 vg Wed 2015-07-01 13:35:56 +0200 CEST [1435750556] lvol4 vg Thu 2015-07-02 12:12:02 +0200 CEST [1435831922] lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] $ lvs -S 'time=yesterday' LV VG Time lvol4 vg Thu 2015-07-02 12:12:02 +0200 CEST [1435831922] lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] $ lvs -S 'time since "June 30"' LV VG Time lvol1 vg Tue 2015-06-30 03:25:43 +0200 CEST [1435627543] lvol3 vg Tue 2015-06-30 14:52:23 +0200 CEST [1435668743] lvol6 vg Wed 2015-07-01 13:35:56 +0200 CEST [1435750556] lvol4 vg Thu 2015-07-02 12:12:02 +0200 CEST [1435831922] lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] $ lvs -S 'time since "noon June 30"' LV VG Time lvol3 vg Tue 2015-06-30 14:52:23 +0200 CEST [1435668743] lvol6 vg Wed 2015-07-01 13:35:56 +0200 CEST [1435750556] lvol4 vg Thu 2015-07-02 12:12:02 +0200 CEST [1435831922] lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] $ lvs -S 'time since "2 July 9AM"' LV VG Time lvol4 vg Thu 2015-07-02 12:12:02 +0200 CEST [1435831922] lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] $ lvs -S 'time since "2 July 1PM"' LV VG Time lvol5 vg Thu 2015-07-02 14:30:32 +0200 CEST [1435840232] ...and so on.
* report: call appropriate handler to evaluate fuzzy reserved names and ↵Peter Rajnoha2015-07-032-5/+72
| | | | | | | | | dynamic reserved values Wire the dm_report_reserved_handler instance call in reporting/selection infrastructure to handle reserved value actions (currently only DM_REPORT_RESERVED_PARSE_FUZZY_NAME and DM_REPORT_RESERVED_GET_DYNAMIC_VALUE actions).
* report: add infrastructure to recognize fuzzy reserved names and returning ↵Peter Rajnoha2015-07-035-4/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dynamic reserved values With fuzzy names we mean the names for which it's hard or even impossible to enumerate all possible variations of the name - the name needs to be evaluated. An example of fuzzy name is a name which has a base (substring) which matches and it can contain arbitrary variations around this base. We can cover human language better with fuzzy names as people may use several different names (or sentences) to denote the same thing. With dynamic values we mean the values which are not constants and they need to be evaluated in runtime. An example of dynamic value is a value which depends on current system state (e.g. time, current configuration or any other state which may change and it needs runtime evaluation). There's a handler that can be registered with reporting/selection using dm_report_reserved_handler instance. This is a central point in which the computation/evaluation happens when processing reserved values. Currently, there are two actions declared: DM_REPORT_RESERVED_PARSE_FUZZY_NAME (translates fuzzy name into canonical name) DM_REPORT_RESERVED_GET_DYNAMIC_VALUE (gets value for canonical name) The handler is then registered as value in struct dm_report_reserved_value (see explaining comments besided the struct dm_report_reserved_value in libdevmapper.h). Also, this patch provides support for simple caching of values used during report/selection via dm_report_value_cache_{set,get}. This is supposed to be used mainly in the dm_report_reserved_handler instances to save values among calls so all the handler calls work with the same base value used in computation/evaluation and/or possibly to save resources if the evaluation is more time-consuming. The cache is attached to the dm_report handle and so the cache is dropped one dm_report is dropped.
* cleanup: commit fe70b03 turned lv_time to STR, put it back to TIMPeter Rajnoha2015-07-031-1/+1
|
* lockd: fix stub functions for LV lockingDavid Teigland2015-07-021-3/+3
| | | | | The stub functions for lockd LV locking were returning the wrong result when lvm was compiled without lvmlockd.
* Add lvmlockddev-dct-lvmlockd-AZDavid Teigland2015-07-0294-441/+15680
|
* report: adjust shared flags based on expected type for reserved valuesPeter Rajnoha2015-07-021-0/+8
| | | | | | Generic numbers and time values share some operators so make sure we have the flags correctly adjusted based on expected type if we're using reserved values.
* tests: add test for 454782f (select with synonyms for string field types)Peter Rajnoha2015-07-021-0/+2
|
* report: fix regression while selecting string fields using synonymsPeter Rajnoha2015-07-022-2/+3
| | | | | | | | | | | | | | | $ lvs -o name,cache_policy vg/lvol0 LV Cache Policy lvol0 Before this patch: $ lvs -o name,cache_policy -S 'cache_policy=undefined' vg/lvol0 (no match) With this patch applied: $ lvs -o name,cache_policy -S 'cache_policy=undefined' vg/lvol0 LV Cache Policy lvol0
* display: missed to count with 0Zdenek Kabelac2015-07-022-1/+2
| | | | | | | | dm_snprintf() returns upon success the number of characters printed (excluding the null byte used to end output to strings). So add extra byte to preserve \0. This fixes regression when displaying more then a single lv name.
* libdm: enhance tracing messagesZdenek Kabelac2015-07-012-7/+11
| | | | Use new _node_name() and print name major:minor for thin-pool device.
* libdm: add helper function to print _node_nameZdenek Kabelac2015-07-011-0/+14
| | | | | | | | _node_name() prepares into dm_tree internal buffer device name and it (major:minor) for easy usage for debug messages. To avoid any allocation a small buffer in struct dm_tree is preallocated to store this message.
* config: report/time_format appeared in v2.02.123Peter Rajnoha2015-07-011-1/+1
|
* locking: Add missing error handling.Alasdair G Kergon2015-06-3012-21/+68
| | | | | Add missing error logging and detection to unlock_vg and callers of sync_local_dev_names etc.
* post-releaseAlasdair G Kergon2015-06-304-2/+8
|
* pre-releasev2_02_123Alasdair G Kergon2015-06-304-5/+7
|
* conf: Regenerate.Alasdair G Kergon2015-06-301-1/+1
| | | | Fix missing --clear-needs-check-flag.
* libdm: Rename struct time_value variables.Alasdair G Kergon2015-06-301-24/+24
| | | | warning: declaration of ‘time’ shadows a global declaration
* report: add support for time (basic)Peter Rajnoha2015-06-306-26/+591
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for time values used in reporting fields. The raw values are always stored as number of seconds since epoch. The support that comes with this patch is the basic one which allows only for recognition of strictly formatted date and time in selection criteria (the format follows a subset of formats defined by ISO 8601): date time timezone date: YYYY-MM-DD (or shortly YYYYMMDD) YYYY-MM (shortly YYYYMM), auto DD=1 YYYY, auto MM=01 and DD=01 time: hh:mm:ss (or shortly hhmmss) hh:mm (or shortly hhmm), auto ss=0 hh (or shortly hh), auto mm=0, auto ss=0 timezone (always with + or - sign): +hh:mm or -hh:mm (or shortly +hhmm or -hhmm) +hh or -hh Or directly the time (number of seconds) since Epoch (1970-01-01 00:00:00 UTC) when the number value is prefixed by "@": @number_of_seconds_since_epoch This patch also adds aliases for comparison operators used together with time values which are more intuitive to use: since (as alias for >=) after (as alias for >) until (as alias for <=) before (as alias for <) For example: $ lvmconfig --type full report/time_format time_format="%Y-%m-%d %T %z %Z [%s]" $ lvs -o name,time vg LV Time lvol0 2015-06-28 21:25:41 +0200 CEST [1435519541] lvol1 2015-06-30 03:25:43 +0200 CEST [1435627543] lvol2 2015-04-26 14:52:20 +0200 CEST [1430052740] lvol3 2015-06-30 14:52:23 +0200 CEST [1435668743] $ lvs vg -o name,time -S 'time since "2015-04-26 15:00" && time until "2015-06-30"' LV Time lvol0 2015-06-28 21:25:41 +0200 CEST [1435519541] lvol1 2015-06-30 03:25:43 +0200 CEST [1435627543] lvol3 2015-06-30 14:52:23 +0200 CEST [1435668743] $ lvs vg -o name,time -S 'time since "2015-04-26 15:00" && time until "2015-06-30 6:00"' LV Time lvol0 2015-06-28 21:25:41 +0200 CEST [1435519541] lvol1 2015-06-30 03:25:43 +0200 CEST [1435627543] $ lvs vg -o name,time -S 'time since @1435519541' LV Time lvol0 2015-06-28 21:25:41 +0200 CEST [1435519541] lvol1 2015-06-30 03:25:43 +0200 CEST [1435627543] lvol3 2015-06-30 14:52:23 +0200 CEST [1435668743] This is basic time recognition support that is directly a part of libdevmapper. Recognition of more free-form expressions will be a part of subsequent patches.
* configure: set DEFAULT_FALLBACK_TO_LVM1 in configure and use it in ↵Peter Rajnoha2015-06-306-8/+22
| | | | | | | | | | config_settings.h Just like we have DEFAULT_USE_LVMETAD (or DEFUALT_USE_LVMPOLLD), use fallback_to_lvm1=1 lvm.conf setting if we configured lvm2 with --enable-lvm1-fallback and use fallback_to_lvm1=0 otherwise. Also, generate proper lvm.conf.in with unconfigured value.
* cleanup: report: use internal wrapper for various variables used for ↵Peter Rajnoha2015-06-301-36/+57
| | | | | | | handling reserved values Just a cleanup - wrap several variables we use to handle reserved values into a structure for easier manipulation in the code.
* select: add support for range reserved values and flagging named-only valuesPeter Rajnoha2015-06-305-139/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows for registration and recognition of reserved values which are ranges, so they're composed of two values actually to denote the lower and upper bound for the range (stored as an array with exactly two items to define the boundaries). Also, this patch allows for flagging reserved values as named-only which means that such values are not strictly reserved. The strictly reserved values are reserved values as used before this patch. Distinction between strictly-reserved and named-only values is clearly visible with comparisons. Normally, strictly reserved value is not accounted for if we do "greater than" or "lower than" comparisons, for example: 1 2 3 .... | abc - we have "abc" as reserved value for field with value "2" - the value reported for the field is "abc" (or "2", it doesn't matter here) - the selection we're processing is -S 'field < abc' - the result of the selection gives nothing as "abc" is strictly reserved value (bound to "2") and there's no order defined for it and it would only match if we directly compared the value (so -S 'field = abc' would match) With named-only values, the "abc" is named-only value for "2", so selection -S 'field < abc" is the same as using -S 'field < 2'. The "abc" is just an alias for some value so the value or its assigned name can be used equally in selection criteria.
* cleanup: time: error out on incorrect time_format and indentation in ↵Peter Rajnoha2015-06-293-10/+12
| | | | config_settings.h
* lv: time: increase buffer to 4k in lv_time_dupPeter Rajnoha2015-06-291-1/+1
|
* toolcontext: use proper set of chars to check time format againstPeter Rajnoha2015-06-291-2/+2
|
* conf: make time format configurablePeter Rajnoha2015-06-2911-8/+209
| | | | | | | | | | | | | | | | | | | | | | | | Make it possible to define format for time that is displayed. The way the format is defined is equal to the way that is used for strftime function, although not all formatting options as used in strftime are available for LVM2 - the set is restricted (e.g. we do not allow newline to be printed). The lvm.conf comments contain the whole list that LVM2 accepts for time format together with brief description (copied from strftime man page). For example: (defaults used - the format is the same as used before this patch) $ lvs -o+time vg/lvol0 vg/lvol1 LV VG Attr LSize Time lvol0 vg -wi-a----- 4.00m 2015-06-25 16:18:34 +0200 lvol1 vg -wi-a----- 4.00m 2015-06-29 09:17:11 +0200 (using 'time_format = "@%s"' in lvm.conf - number of seconds since the Epoch) $ lvs -o+time vg/lvol0 vg/lvol1 LV VG Attr LSize Time lvol0 vg -wi-a----- 4.00m @1435241914 lvol1 vg -wi-a----- 4.00m @1435562231
* config: regenerate lvm.conf.in and lvmlocal.conf.inPeter Rajnoha2015-06-292-20/+0
|
* refactor: rename _out_tags fn to _out_list and use it for string lists in ↵Peter Rajnoha2015-06-291-11/+12
| | | | general