On Thu, Apr 09, 2026 at 11:53:07AM +0000, Aastha Rawat wrote:
> Returning the raw ioctl return value results in misleading error
> message. Ensure that actual failure reason is propagated by returning
> -errno for ioeventfd failure.
>
> Signed-off-by: Aastha Rawat <aastharawat@linux.microsoft.com>
> ---
> accel/mshv/mshv-all.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c
> index e1a8d62f8d..58af674bd9 100644
> --- a/accel/mshv/mshv-all.c
> +++ b/accel/mshv/mshv-all.c
> @@ -275,7 +275,12 @@ static int ioeventfd(int vm_fd, int event_fd, uint64_t addr, Datamatch dm,
> }
> }
>
> - return ioctl(vm_fd, MSHV_IOEVENTFD, &args);
> + int ret = ioctl(vm_fd, MSHV_IOEVENTFD, &args);
> + if (ret < 0) {
> + return -errno;
> + }
> +
> + return ret;
> }
>
> static int unregister_ioevent(int vm_fd, int event_fd, uint64_t mmio_addr,
>
Reviewed-by: Magnus Kulke <magnuskulke@linux.microsoft.com>