summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvresize: add new options and defaults for fs handlingdev-dct-lvresize-6David Teigland2022-08-1125-185/+3453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new option "--fs String" for lvresize/lvreduce/lvextend controls the handling of file systems before/after resizing the LV. --resizefs is the same as --fs resize. Possible --fs values: checksize Only used when reducing the size, does nothing when exending. Check the fs size, and reduce the LV if the fs is not using the affected space, i.e. the fs does not need to be shrunk. Fail the command without reducing the fs or LV if the fs is using the affected space. resize_remount | resize Resize the fs if needed. Mounts or unmounts the fs as required (avoids mounting/unmounting when possible.) Attempts to restore the original mount state when finished. resize_keepmount Resize the fs if needed, only if it can be done without changing the current mount state. Fail the command without resizing the fs or LV if an fs resize requires mounting or unmounting. resize_unmount Resize the fs if needed, only while unmounted. Unmount the fs if needed. Fail the command without resizing the fs or LV if an fs resize is needed that requires the the fs to be mounted. resize_fsadm Use the old method of calling fsadm to do handle the fs (deprecated). ignore Resize the LV without checking for or handling a file system. Notes on lvreduce: When no --fs or --resizefs option is specified: . lvextend default behavior is fs ignore. . lvreduce default behavior is fs checksize (includes activating the LV.) With the exception of --fs resize_fsadm|ignore, lvreduce requires the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE. FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV, which determines if reducing the fs is necessary.
* lvresize: restructure codeDavid Teigland2022-08-1115-557/+889
| | | | | Rewrite top level resize function to prepare for adding new fs resizing.
* WHATS_NEW: updatePeter Rajnoha2022-08-112-1/+3
|
* test: add report-format testPeter Rajnoha2022-08-111-0/+74
|
* report: fix pe_start column type from NUM to SIZPeter Rajnoha2022-08-111-1/+1
| | | | | | | | | | | | | | | | The 'pe_start' column was incorrectly marked as being of type NUM. This was not correct as pe_start is actually of type SIZ, which means it can have a size suffix and hence it's not a pure numeric value. Proper column type is important for selection to work correctly, so we can also do comparisons while using suffixes. This is also important for new "json_std" output format which does not put double quotes around pure numeric values. With pe_start incorrectly marked as NUM instead of SIZ, this produced invalid JSON output like '"pe_start" = 1.00m' because it contained the 'm' (or other) size suffix. If properly marked as SIZ, this is then put in double quotes like '"pe_start" = "1.00m"'.
* make: generatePeter Rajnoha2022-08-1134-112/+184
|
* man: update lvmreport man page about json_std formatPeter Rajnoha2022-08-111-8/+28
|
* args: recognize 'json_std' for --reportformat cmd line argPeter Rajnoha2022-08-113-3/+6
|
* config: recognize 'json_std' for report/output_format config settingPeter Rajnoha2022-08-112-3/+14
|
* libdm: report: use proper JSON array for string list output in JSON_STD formatPeter Rajnoha2022-08-112-8/+168
| | | | | | | | | | In JSON format, we print string list this way: "key" = "item1,item2,...,itemN" while in JSON_STD format, we print string list this way: "key" = ["item1","item2",...,"itemN"]
* libdm: report: separate basic and JSON+JSON_STD format in _output_fieldPeter Rajnoha2022-08-112-142/+188
| | | | | Use separate functions to handle basic and JSON+JSON_STD format. It's clearer this way than interleaving both in the same function.
* libdm: report: enhance the way string list is stored internallyPeter Rajnoha2022-08-112-232/+380
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we stored only the report string itself for a string list in field->report_string. The field->report_string has either sorted items or not, depending on what we need for a field - some report fields have sorted output, some don't... The field->sort_value.value then contains pointer to the exact field->report_string. The field->sort_value.items ALWAYS keeps sorted array of individual items, represented as '[position,length]' pairs pointing to the field->sort_value.value string. This approach was fine as far as we didn't need to apply further formatting to field->report_string. However, if we need to apply further formatting to field->report_string content, taking into account individual items, we also need to know where each item starts and what is its length. Before, we only knew this when items in report string were sorted, but not in the unsorted version. We can't rely on the delimiter (default ",") only to separate items back out of report string, because that delimiter can be contained in the item value itself. So this patch enhances the field->report_string for a string list so it also contains '[position,length]' pairs for each individual item inside field->report_string. We store this array right beyond the string itself and we encode it in the same manner we already did for field->sort_value.items before. If field->report_string has sorted items, the field->sort_value.items just points to the array of items we store beyond the report string. If field->report_string has unsorted items, we store separate array of items for both field->report_string and field->sort_value. This patch also cleans up the _report_field_string_list function a bit so it's easier and more straightforward to follow than the original version. Example. If we have "abc", "xy", "defgh" as list on input with "," as delimiter, then: - field->report_string will have: - if we need field->report_string unsorted: abc,xy,defgh\0{[3,12],[0,3],[4,2],[7,5]} |____________||________________________| string array of [pos,len] pairs |____||________________| #items items - if we need field->report_string sorted: repstr_extra | V abc,defgh,xy\0{[3,12],[0,3],[4,5],[10,2]} |____________||________________________| string array of [pos,len] pairs |____||________________| #items items - field->sort_value will have: - if field->report_string is unsorted: field->sort_value.value = field->report_string field->sort_value.items = {[0,3],[0,3],[7,5],[4,2]} (that is 'abc,defgh,xy') - if field->report_string is sorted already: field->sort_value.value = field->report_string field->sort_value.items = repstr_extra (that is also 'abc,defgh,xy')
* libdm: report: use 'null' for undefined numeric values in JSON_STD outputPeter Rajnoha2022-08-112-2/+14
| | | | | | | | | | | | | | | For JSON_STD format, use 'null' if a field has no value at all. In JSON format, we print undefined numeric values this way: "key" = "" while in JSON_STD format, we print undefined numeric values this way: "key" = null (Keep in mind that 'null' is different from 0 (zero value) which is a defined value.)
* libdm: report: remove double quotes around numeric values in JSON_STD outputPeter Rajnoha2022-08-112-14/+40
| | | | | | | | | | | | In JSON format, we print numeric values this way: "key" = "N" while in JSON_STD format, we print numeric value this way: "key" = N (Where N is a numeric value.)
* libdm: report: add DM_REPORT_GROUP_JSON_STD groupPeter Rajnoha2022-08-114-6/+26
| | | | | | | The original JSON formatting will be still available using the original DM_REPORT_GROUP_JSON identifier. Subsequent patches will add enhancements to JSON formatting code so that it adheres more to JSON standard - this will be identified by new DM_REPORT_GROUP_JSON_STD identifier.
* config: add correct unconfigured value for use_devicesfileMarian Csontos2022-08-092-2/+2
|
* spec: use --with-default-use-devices-file=1 for rhel9+Marian Csontos2022-08-091-0/+4
|
* configure: fix typoMarian Csontos2022-08-091-1/+1
|
* spec: Use libedit for newer distributionsMarian Csontos2022-08-092-0/+15
|
* shell: also output error message about max number of args hit with JSON formatPeter Rajnoha2022-08-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If using JSON format for lvm shell's output, the error message about exceeding the maximum number of arguments was not reported on output if this condition was ever hit. This is because the JSON format (as well as any other future format) requires extra formatting compared to "basic" format and so it also requires extra calls when it comes to reporting. The report needs to be added to a report group and then popped and put on output with specialized "dm_report_group_output_and_pop_all". This "output and pop" is normally executed after we execute the command in the lvm shell. When we didn't get to the command exection at all because some precondition was not met (like hitting the limit for the number of arguments for the command here), we skipped this important call and so there was no log report output. Right now, it's only this exact error message for which we need to call "output and pop" directly, all the other error messages are about initializing and setting the log report itself which we can't report obviously. Before this patch: lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 lvm> With this patch applied: lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 { "log": [ {"log_seq_num":"1", "log_type":"error", "log_context":"shell", "log_object_type":"cmd", "log_object_name":"", "log_object_id":"", "log_object_group":"", "log_object_group_id":"", "log_message":"Too many arguments, sorry.", "log_errno":"-1", "log_ret_code":"0"} ] } If there's any other error message in the future before we execute the command itself, we also need to call the "output and pop" directly.
* apply multipath_component_detection=0 to duplicate PV handlingDavid Teigland2022-07-252-3/+10
| | | | | | | multipath_component_detection=0 has always applied to the filter-based component detection. Also apply this setting to the duplicate-PV handling which also eliminates multipath components (based on duplicate PVs having the same wwid.)
* make: generateZdenek Kabelac2022-07-111-0/+12
|
* cov: restore disable_dm_devs also for error pathZdenek Kabelac2022-07-111-3/+4
| | | | | Keep the structure correct for failing error path, alhtough likely this particual var will not be used.
* cov: remove unused headersZdenek Kabelac2022-07-114-4/+0
|
* vdo: suffle code for better error path handlingZdenek Kabelac2022-07-111-14/+14
| | | | | For failing dm_ no need to report 2nd. error, but we missed to report error with 'updated==NULL'.
* vdo: enhance lvcreate validationZdenek Kabelac2022-07-113-8/+56
| | | | | | | | | | | When creating VDO pool based of % values, lvm2 is now more clever and avoids to create 'unsupportable' sizes of physical backend volumes as 16TiB is maximum size supported by VDO target (and also limited by maximum supportable slabs (8192) based on slab size. If the requested virtual size is approaching max supported size 4PiB, switch header size to 0.
* vdo: support v4 kernel target lineZdenek Kabelac2022-07-115-14/+37
| | | | Check and use new available table line v4, if kernel supports it.
* vdo: add reformating to extent size aligned virtual sizeZdenek Kabelac2022-07-111-3/+19
| | | | | | | | | Newer VDO kernel target require to have matching virtual size - this however cause incompatiblity when lvcreate is let to format VDO data device and read the usable size from vdoformat. Altough this is a kernel regression and will likely get fixed, lvm2 can actually reformat VDO device to use properly aligned VDO LV size to make this problem disappear.
* vdo: check vdo memory constrainsZdenek Kabelac2022-07-114-2/+156
| | | | | | | | | | | | | | | | | | | Add function to check for avaialble memory for particular VDO configuration - to avoid unnecessary machine swapping for configs that will not fit into memory (possibly in locked section). Formula tries to estimate RAM size machine can use also with swapping for kernel target - but still leaving some amount of usable RAM. Estimation is based on documented RAM usage of VDO target. If the /proc/meminfo would be theoretically unavailable, try to use 'sysinfo()' function, however this is giving only free RAM without the knowledge about how much RAM could be eventually swapped. TODO: move _get_memory_info() into generic lvm2 API function used by other targets with non-trivial memory requirements.
* vdo: report supported range in error pathZdenek Kabelac2022-07-111-18/+45
|
* vdo: use defines also for configuration definesZdenek Kabelac2022-07-114-47/+60
| | | | | | | | | | | | | Keep single source for most of values printed in lvm.conf (still needs some conversion) Correct max for logical threads to 60 (we may refuse some older configuration which might eventually user higher numbers - but so far let's assume no user have ever set this as it's been non-trivial and if would complicate code unnecessarily.) Accept maximum of 4PiB for virtual size of VDO LV (lvm2 will drop 'header borders to 0 for this case').
* vdo: update info about memoryZdenek Kabelac2022-07-111-3/+12
| | | | | Add more info about kernel target memory allocation associated with VDO pool usage.
* vdo: use single validatorZdenek Kabelac2022-07-112-36/+10
| | | | | Add era lenght validation into dm_vdo_validate_target_params() and reuse this validator also for _check_lv_segment().
* man: space after sizeZdenek Kabelac2022-07-1110-43/+44
| | | | | Put space between size and SI unit. Automatically make this 'space' as fixed size by Makefile sed script.
* vdo: fix conversion of vdo_slab_size_mb 2ndZdenek Kabelac2022-07-111-1/+1
| | | | | | | Patch 1b070f366ba57a6eb24df03241284732db5047e9 should have been already fixing this issue but since it the incorrect patch rebasing the change to vdo_slabSize got lost. So again now with explicit one-line patch.
* exit with error when --devicesfile name doesn't existDavid Teigland2022-07-0612-17/+46
|
* lvmdbustest: Add test for property "Get"Tony Asleson2022-06-302-1/+25
| | | | We typically use "GetAll", so add test for "Get" and check values.
* lvmdbusd: Remove try/except for mkfifoTony Asleson2022-06-301-5/+2
| | | | We should never run into this error condition when using tempfile.mkdtemp.
* lvmdusd: Remove non lvm JSON output supportTony Asleson2022-06-303-233/+20
|
* lvmdbustest: Increase number of LVsTony Asleson2022-06-301-1/+1
| | | | As storage is getting faster, we need to create more LVs to pass this test.
* lvmdbustest: Correct comment spelling/grammarTony Asleson2022-06-301-11/+11
|
* lvmdbustest: Test job remove path when job not completeTony Asleson2022-06-301-0/+11
|
* lvmdbusd: Correct grammar in lvm shell proxy commentsTony Asleson2022-06-301-2/+2
|
* lvmdbusd: Don't require "lvm> " prompt for shellTony Asleson2022-06-301-40/+43
| | | | | | | Depending on how lvm is compiled, it may not present the "lvm> " prompt when using the lvm shell. Don't require it to be present. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2090391
* lvmdbusd: Job prop. Get/GetAll exec. immediatelyTony Asleson2022-06-301-0/+18
| | | | | This allows API user the ability to check on the status of a long running job without blocking in the request queue.
* lvmdbusd: Remove the use of sub shell for lvm shellTony Asleson2022-06-301-13/+11
| | | | This reduces the number of processes and improves security.
* lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODETony Asleson2022-06-301-4/+8
| | | | Make it more logical.
* lvmdbusd: Change unit test vdo minimum sizeTony Asleson2022-06-301-5/+9
|
* lvmdbusd: Add debug output for which lvm binary is usedTony Asleson2022-06-301-0/+2
|
* lvmdbusd: re-work lvm shell mainTony Asleson2022-06-301-18/+28
| | | | | Add an optional single argument "bisect" to use with git bisect for automation. Normal case is no arguments when running stand-alone.