Commit 618799e9 authored by Lianbo Jiang's avatar Lianbo Jiang Committed by Simon Horman
Browse files

kexec: support parsing the string "Reserved" to get the correct e820 reserved region



When loading kernel and initramfs for kexec, kexec-tools could get the
e820 reserved region from "/proc/iomem" in order to rebuild the e820
ranges for kexec kernel, but there may be the string "Reserved" in the
"/proc/iomem", which caused the failure of parsing. For example:

 #cat /proc/iomem|grep -i reserved
00000000-00000fff : Reserved
7f338000-7f34dfff : Reserved
7f3cd000-8fffffff : Reserved
f17f0000-f17f1fff : Reserved
fe000000-ffffffff : Reserved

Currently, kexec-tools can not handle the above case because the memcmp()
is case sensitive when comparing the string.

So, let's fix this corner and make sure that the string "reserved" and
"Reserved" in the "/proc/iomem" are both parsed appropriately.

Signed-off-by: default avatarLianbo Jiang <lijiang@redhat.com>
Acked-by: default avatarBhupesh Sharma <bhsharma@redhat.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 9cf72127
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment