Return value of `kexec -S` under Xen
Hongyan Xia
hx242 at xen.org
Tue Jul 14 12:46:34 EDT 2020
Hi,
I am working on kexec on top of Xen and just found something weird. The
man page says `kexec -S` returns 0 if the kernel is loaded, but on the
Xen side it returns 1 for a loaded kernel.
in xen/common/kexec.c, kexec_status():
1207 if ( kexec_load_get_bits(status.type, &base, &bit) )
1208 return -EINVAL;
1209
1210 return !!test_bit(bit, &kexec_flags); // returns 1 when loaded
This caused quite a bit of confusion in my work before I figured out
what was going on. May I know why the code in Xen is like this? Thanks.
Hongyan
More information about the kexec
mailing list