1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

vdo: lvm_import_vdo correct parsing output

Output from vdo manager may actually indent output with spaces,
so trim leading and ending space.

Also add support for verbosity flag for vdo conversion tool.
This commit is contained in:
Zdenek Kabelac 2023-06-29 13:06:18 +02:00
parent e48c9826e3
commit 8b75bbe47d

View File

@ -370,7 +370,7 @@ convert_non_lv_() {
fi fi
verbose "Moving VDO header." verbose "Moving VDO header."
output=$(dry "$VDO" convert $VDOCONF --force --name "$VDONAME") output=$(dry "$VDO" convert $VDOCONF $VERB --force --name "$VDONAME")
if [ "$ABORT_AFTER_VDO_CONVERT" != "0" ] ; then if [ "$ABORT_AFTER_VDO_CONVERT" != "0" ] ; then
verbose "Aborting VDO coversion after moving VDO, volume is useless!" verbose "Aborting VDO coversion after moving VDO, volume is useless!"
@ -384,7 +384,8 @@ convert_non_lv_() {
local vdo_offset=0 local vdo_offset=0
local vdo_non_converted=0 local vdo_non_converted=0
while IFS= read -r line ; do while IFS= read -r line ; do
case "$line" in # trim leading spaces
case "$(echo $line)" in
"Non converted"*) vdo_non_converted=1 ;; "Non converted"*) vdo_non_converted=1 ;;
"Length"*) vdo_length=${line##* = } ;; "Length"*) vdo_length=${line##* = } ;;
"Conversion completed"*) "Conversion completed"*)
@ -579,7 +580,7 @@ EOF
verbose "VDO conversion parameters: $VDO_ALLOCATION_PARAMS" verbose "VDO conversion parameters: $VDO_ALLOCATION_PARAMS"
verbose "Stopping VDO volume." verbose "Stopping VDO volume."
dry "$VDO" stop $VDOCONF --name "$VDONAME" dry "$VDO" stop $VDOCONF --name "$VDONAME" $VERB
# If user has not provided '--yes', prompt before conversion # If user has not provided '--yes', prompt before conversion
if [ -z "$YES" ] && [ "$USE_VDO_DM_SNAPSHOT" != "1" ]; then if [ -z "$YES" ] && [ "$USE_VDO_DM_SNAPSHOT" != "1" ]; then