Hi Philipp,
On Tue, Aug 16, 2022 at 6:24 PM Philipp Rudo <prudo(a)redhat.com> wrote:
Hi Tao,
one tiny nit below. With that fixed
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Sure, I will add the Reviewed-by sign, thank you!
On Tue, 16 Aug 2022 16:49:19 +0800
Tao Liu <ltao(a)redhat.com> wrote:
[...]
> diff --git a/kdump-lib.sh b/kdump-lib.sh
> index f7b659e..f5e3cd8 100755
> --- a/kdump-lib.sh
> +++ b/kdump-lib.sh
> @@ -81,35 +81,30 @@ to_dev_name()
>
> is_user_configured_dump_target()
> {
> - [[ $(kdump_get_conf_val
"ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh") ]] || is_mount_in_dracut_args
> -}
> -
> -get_user_configured_dump_disk()
> -{
> - local _target
> -
> - _target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
> - [[ -n $_target ]] && echo "$_target" && return
> -
> - _target=$(get_dracut_args_target "$(kdump_get_conf_val
"dracut_args")")
> - [[ -b $_target ]] && echo "$_target"
> + [[ $(kdump_get_conf_val
"ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh\|virtiofs") ]] ||
is_mount_in_dracut_args
> }
>
> get_block_dump_target()
> {
> - local _target _path
> + local _target
>
> if is_ssh_dump_target || is_nfs_dump_target; then
> return
> fi
>
> - _target=$(get_user_configured_dump_disk)
> + _target=$(kdump_get_conf_val
"ext[234]\|xfs\|btrfs\|minix\|raw\|virtiofs")
> [[ -n $_target ]] && to_dev_name "$_target" &&
return
>
> - # Get block device name from local save path
> - _path=$(get_save_path)
> - _target=$(get_target_from_path "$_path")
> - [[ -b $_target ]] && to_dev_name "$_target"
> + _target=$(get_dracut_args_target "$(kdump_get_conf_val
"dracut_args")")
> + [[ -b $_target ]] && to_dev_name "$_target" &&
return
> +
> + _fstype=$(get_dracut_args_fstype "$(kdump_get_conf_val
"dracut_args")")
> + is_fs_type_virtiofs "$_fstype" && echo "$_target"
&& return
please make _fstype local.
Agreed, sorry I missed that...
> +
> + _target=$(get_target_from_path "$(get_save_path)")
> + [[ -b $_target ]] && to_dev_name "$_target" &&
return
> +
> + is_fs_type_virtiofs "$(get_fs_type_from_target
"$_target")" && echo "$_target" && return
personally I would reuse _fstype here so that the code is more
consistent with the dracut_args case. But that's only a matter of taste.
OK, I will make it consistent.
Thanks,
Tao Liu
Thanks
Philipp
> }
>
> is_dump_to_rootfs()
> @@ -125,6 +120,7 @@ get_failure_action_target()
> # Get rootfs device name
> _target=$(get_root_fs_device)
> [[ -b $_target ]] && to_dev_name "$_target"
&& return
> + is_fs_type_virtiofs "$(get_fs_type_from_target
"$_target")" && echo "$_target" && return
> # Then, must be nfs root
> echo "nfs"
> fi
> diff --git a/kdump.conf b/kdump.conf
> index d4fc78b..e598a49 100644
> --- a/kdump.conf
> +++ b/kdump.conf
> @@ -43,6 +43,7 @@
> # It's recommended to use persistent device names
> # such as /dev/vg/<devname>.
> # Otherwise it's suggested to use label or uuid.
> +# Supported fs types: ext[234], xfs, btrfs, minix, virtiofs
> #
> # path <path>
> # - "path" represents the file system path in which vmcore
> @@ -171,6 +172,7 @@
> #ext4 /dev/vg/lv_kdump
> #ext4 LABEL=/boot
> #ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937
> +#virtiofs myfs
> #nfs my.server.com:/export/tmp
> #nfs [2001:db8::1:2:3:4]:/export/tmp
> #ssh user(a)my.server.com
> diff --git a/kdumpctl b/kdumpctl
> index 126ecb9..5b0e5fd 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -239,7 +239,7 @@ parse_config()
> _set_config _fstype "$config_opt" || return 1
> config_opt=_target
> ;;
> - ext[234] | minix | btrfs | xfs | nfs | ssh)
> + ext[234] | minix | btrfs | xfs | nfs | ssh | virtiofs)
> _set_config _fstype "$config_opt" || return 1
> config_opt=_target
> ;;
> @@ -478,8 +478,8 @@ check_fs_modified()
> fi
>
> # No need to check in case of raw target.
> - # Currently we do not check also if ssh/nfs target is specified
> - if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then
> + # Currently we do not check also if ssh/nfs/virtiofs target is specified
> + if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target ||
is_virtiofs_dump_target; then
> return 0
> fi
>
> diff --git a/mkdumprd b/mkdumprd
> index 3e250e0..958698e 100644
> --- a/mkdumprd
> +++ b/mkdumprd
> @@ -391,7 +391,7 @@ while read -r config_opt config_val; do
> extra_modules)
> extra_modules="$extra_modules $config_val"
> ;;
> - ext[234] | xfs | btrfs | minix | nfs)
> + ext[234] | xfs | btrfs | minix | nfs | virtiofs)
> check_user_configured_target "$config_val"
"$config_opt"
> add_mount "$config_val" "$config_opt"
> ;;