Hi Philippe,
Thanks for your feedback!

Thanks & Best Regards!

---
Houqi (Nick) Zuo | 左厚祺
ADDR: 9/F, North Tower C, Raycom Infotech Park, No.2 Ke Xueyuan Nanlu,
Haidian District, Beijing 100190
EMAIL: [email protected]
Google Chat: Houqi Zuo          Slack: Houqi Zuo

Red Hat respects your work life balance. Therefore, there is no need
to reply to this email out of your office hours.
<https://mojo.redhat.com/docs/DOC-1199578>


<https://red.ht/sig>


On Thu, Oct 16, 2025 at 4:09 PM Philippe Mathieu-Daudé <[email protected]>
wrote:

> Hi Nick,
>
> On 25/9/25 04:32, Houqi (Nick) Zuo wrote:
> > When QEMU creates a tap device automatically and the tap device is
> > manually removed from the host while the guest is running, the tap
> > device file descriptor becomes invalid. Later, when the guest executes
> > shutdown, the tap_fd_set_vnet_hdr_len() function may be called and
> > abort QEMU with a core dump when attempting to use the invalid fd.
> >
> > This patch removes many abort() calls in this file. If the fd is found
> > to be in a bad state (e.g., EBADFD or ENODEV), the related function
> > will print an error message.
> >
> > The expected behavior for this negative test case is that QEMU should
> > report an error but continue running rather than aborting.
>
>
> > Fixes: 0caed25cd171c611781589b5402161d27d57229c ("virtio: Call
> set_features during reset")
> >
> > Signed-off-by: Houqi (Nick) Zuo <[email protected]>
> > ---
> >   net/tap-linux.c | 13 ++++++++-----
> >   1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/tap-linux.c b/net/tap-linux.c
> > index e832810665..24e63a0b54 100644
> > --- a/net/tap-linux.c
> > +++ b/net/tap-linux.c
> > @@ -206,15 +206,16 @@ void tap_fd_set_vnet_hdr_len(int fd, int len)
> >       if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
> >           fprintf(stderr, "TUNSETVNETHDRSZ ioctl() failed: %s.
> Exiting.\n",
> >                   strerror(errno));
>
> Remove "Exiting".
>
> While here, can you replace fprintf() -> error_report()?
>
> > -        abort();
>
> If we don't exit anymore, this function should return some value
> indicating the failure, and the callers should check it.
>
> >       }
> >   }
>
> Regards,
>
> Phil.
>
>

Reply via email to