Hi Bhupesh,
On 04/19/2018 03:06 PM, Bhupesh Sharma wrote:
Hello Pingfan,
Overall the patch looks good to me. I have a couple of nitpicks,
please see them inline:
On Thu, Apr 19, 2018 at 11:55 AM, Pingfan Liu <piliu(a)redhat.com> wrote:
May be we can add a simple git log summary to this patch to explain
what we are addressing here - i.e. show crash kernel reserved memory
size.
OK.
> Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
> ---
> kdumpctl | 13 ++++++++++++-
> kdumpctl.8 | 3 +++
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index 4280e7e..0f1e3ac 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -828,6 +828,14 @@ propagate_ssh_key()
> fi
> }
>
> +show_reserved_mem()
> +{
> + local mem=$(cat /sys/kernel/kexec_crash_size)
> + local mem_mb=$(expr $mem / 1024 / 1024)
> +
> + echo "Reserved "$mem_mb"MB memory for crash kernel"
Hmm.. Can we modify the echo message to handle the case where
'$mem_mb=0' (i.e. we have no memory reserved for crash kernel) better.
Something like:
local mem_mb=$(expr $mem / 1024 / 1024)
if [ -z "$mem_mb" ]; then
echo "No memory reserved for crash kernel"
else
echo "Reserved "$mem_mb"MB memory for crash kernel"
fi
I think it is not necessary. since 0MB is self explained.
Thank you for kindly review.
Regards,
Pingfan
> Thanks,
> Bhupesh
>
>> +}
>> +
>> handle_mode_switch()
>> {
>> if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
>> @@ -1244,8 +1252,11 @@ main ()
>> propagate)
>> propagate_ssh_key
>> ;;
>> + showmem)
>> + show_reserved_mem
>> + ;;
>> *)
>> - echo $"Usage: $0
{start|stop|status|restart|propagate}"
>> + echo $"Usage: $0
{start|stop|status|restart|propagate|showmem}"
>> exit 1
>> esac
>> }
>> diff --git a/kdumpctl.8 b/kdumpctl.8
>> index b446b81..023562b 100644
>> --- a/kdumpctl.8
>> +++ b/kdumpctl.8
>> @@ -35,6 +35,9 @@ Is equal to
>> .I propagate
>> Helps to setup key authentication for ssh storage since it's
>> impossible to use password authentication during kdump.
>> +.TP
>> +.I showmem
>> +Prints the size of reserved memory for crash kernel in megabytes.
>>
>> .SH "SEE ALSO"
>> .BR kdump.conf (5),
>> --
>> 2.7.4
>> _______________________________________________
>> kexec mailing list -- kexec(a)lists.fedoraproject.org
>> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
>