[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QEMU does not read from TAP device on macOS

From: Phillip Tennen
Subject: QEMU does not read from TAP device on macOS
Date: Tue, 26 Jan 2021 13:06:11 +0100


I apologize in advance for any lacking info, or if this is the wrong place entirely -- I am new to QEMU's source, having dug into it solely for this issue. 

I am a hobby-OS developer wanting to configure QEMU with a TAP device to communicate packets to/from my host's network. However, even when data is available on the TAP device, QEMU does not read from its file descriptor.

To dig into this further, I wrote a few test programs that open() a tap device, and select() until data is available. My test programs unblock as expected when packets are received on the TAP interface.

QEMU, however, never appears to read from the file descriptor. I've hacked up a local copy of QEMU with gratuitous logs around `aio-posix.c:aio-dispatch`, `main-loop.c:os_host_main_loop_wait`, `async.c:aio_notify`, etc. 

I can see that QEMU uses glib for its event loop, and can see that the TAP's file descriptor is certainly being provided to glib to poll on, but QEMU does not seem to react when new data appears on the tap. There are lots of internal systems even just in the small bit I'm touching, and I've yet to isolate exactly where the read happens after being awoken by glib.

My environment is as follows:
macOS Big Sur 11.0.1 and 11.1
QEMU 5.2.0
TAP kernel extension from https://github.com/Tunnelblick/Tunnelblick/tree/master/third_party

I will continue hacking up my local QEMU, but am hopeful that someone may have some insight into what might be going on. Thanks very much for your time!

Phillip Tennen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]