dm: add checks of ioctl return value for ACRN userspace

The current code does not always check the return value of function
ioctl called in ACRN userspace, and lack of error message printing
to help debug.

This code fixes it by checking the return value of ioctl, and adding
function errormsg to return a string describing of the error code.

Tracked-On: #7029
Signed-off-by: Wen Qian <qian.wen@intel.com>
Signed-off-by: Li Fei <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Wen Qian
2022-02-09 14:09:53 +08:00
committed by acrnsi-robot
parent dc207b3fa3
commit a5a005f129
3 changed files with 170 additions and 48 deletions

View File

@@ -150,4 +150,10 @@ void vm_reset_watchdog(struct vmctx *ctx);
int vm_ioeventfd(struct vmctx *ctx, struct acrn_ioeventfd *args);
int vm_irqfd(struct vmctx *ctx, struct acrn_irqfd *args);
/*
* Return a string describing the meaning of the `error' code.
*/
char* errormsg(int error);
#endif /* _VMMAPI_H_ */