Followup corrections to kexec STATUS patch v3
This contains the two corrections pointed out by Jan Beulich for the kexec STATUS call just introduced.
Note: In kexec_status(), the use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public header description.
Note: My handling of the test_bit() scenario is to explicitly check for return value of 1, so any value other than 1 causes kexec_status to return 0.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/1 Put back blank line for readability purposes.
This blank line was accidentally removed during
the insertion of the kexec_status() declarations.
--- xen/include/public/kexec.h | 1 + 1 file changed, 1 insertion(+)
xen/include/public/kexec.h +1 -0
@@ -240,6 +240,7 @@ typedef struct xen_kexec_status { uint8_t type; } xen_kexec_status_t;DEFINE_XEN_GUEST_HANDLE (xen_kexec_status_t); +#else /* __XEN_INTERFACE_VERSION__ < 0x00040400 */ #define KEXEC_CMD_kexec_load KEXEC_CMD_kexec_load_v1
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 1/1 kexec: ensure kexec_status() always returns 0 or 1
In reply to Eric DeVolderThe use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public header description.
--- xen/common/kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/kexec.c +1 -1
@@ -1182,7 +1182,7 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)if (kexec_load_get_bits (status.type, &base, &bit) )return -EINVAL ; -return test_bit (bit, &kexec_flags); +return (test_bit (bit, &kexec_flags) ==1 ); } static int do_kexec_op_internal(unsigned long op,
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 11 lines · Eric DeVolder
This contains the two corrections pointed out by Jan Beulich for the kexec STATUS call just introduced.
Note: In
kexec_status(), the use oftest_bit()can also return EPERM, so the return value fromtest_bit()must be checked to ensure thatkexec_status()always returns 0, 1 or -1, per the public header description.Note: My handling of the
test_bit()scenario is to explicitly check for return value of 1, so any value other than 1 causeskexec_statusto return 0.
Great, however:
- please use "git format-patch -n ..." to create patches,
- first patch in the series should have [PATCH 0/3] in the subject,
- both patches lack of your SOB.
Daniel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel