On 02/21/2014 03:25 AM, Vivek Goyal wrote:
On Thu, Feb 20, 2014 at 01:05:02PM +0530, Hari Bathini wrote:
> During service kdump start, if firmware assisted dump is not enabled then
> fallback to starting of existing kexec based kdump. If firmware assisted
> is enabled but not running, then start firmware assisted dump by echo'ing
> 1 to '/sys/kernel/fadump_registered' file.
>
> Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
> ---
> kdumpctl | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index e624b91..b66ce3b 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -584,6 +584,18 @@ function check_kdump_feasibility()
> fi
> }
>
> +function start_fadump()
> +{
> + echo 1 > $FADUMP_REGISTER_SYS_NODE
> + if ! check_current_fadump_status; then
> + echo "Starting firmware assisted dump: [FAILED]"
> + return 1
> + fi
> +
> + echo "Starting firmware assisted dump: [OK]"
Ok, we will have to be very consistent with naming here in console
messages. We can't use "firmware assisted dump" at some places and
kdump at others.
When kdump is used, we see "kexec: loaded kdump kernel" along with
"Starting kdump: [OK]" clearly indicating kexec/kdump is used. Intention is
to indicate fadump during start/stop. Hmmm, maybe with a different
print message...
Say, "fadump: started successfully" along with "Starting kdump: [OK]"
in success case & in failure case, "fadump: could not start!" along with
"Starting kdump: [FAILED]"
Thanks
Hari
I think if you display dump mode in determine_dump_mode() that
should
be sufficient to determine if message belongs to kdump or fadump. And
rest of the places we could continue to use kdump. This is just one
of the ideas.
So don't echo any messages here. Just return the right value and let
top level display "Starting kdump: [FAILED]". Dump mode will let user
know whether we are talking about kdump or fadump.
> + return 0
> +}
> +
> function start()
> {
> check_config
> @@ -627,7 +639,11 @@ function start()
> echo "Starting kdump: [FAILED]"
> return 1
> fi
> - load_kdump
> + if [ $dump_mode == "fadump" ]; then
> + start_fadump
> + else
> + load_kdump
Let us create another funcation say start_dump() can call that here.
start_dump()
if [ $? != 0 ]; then
echo "Starting kdump: [FAILED]"
return 1
fi
start_dump()
{
if (dump_mode == fa_dump)
start_fadump
else
load_kdump
}
> + fi
> if [ $? != 0 ]; then
> echo "Starting kdump: [FAILED]"
> return 1