Skip to content

openwrt's vmm waits for cvdalloc.#1646

Merged
3405691582 merged 1 commit intogoogle:mainfrom
3405691582:420357899_21
Sep 19, 2025
Merged

openwrt's vmm waits for cvdalloc.#1646
3405691582 merged 1 commit intogoogle:mainfrom
3405691582:420357899_21

Conversation

@3405691582
Copy link
Collaborator

openwrt uses a vmm to run a Wi-Fi access point, using a 802.11 hardware simulator connected to a tap device. Without cvdalloc, it assumes this device was already created by cuttlefish-host-resources. With cvdalloc, openwrt's vmm will need to wait for cvdalloc to complete in order to use the tap device it creates.

The obvious way to do this is to use WaitForAvailability on cvdalloc's launcher. However, cvdalloc's launcher is already a VmmDependencyCommand for the instance's vmm, and if both openwrt's and cvdalloc's launcher are executing at the same time, we have two contending reads on cvdalloc's socketpair, which complicates matters.

We could Wait and Post twice on the socket for notification, but that is rather ugly since that means we couple the number of socket Wait'ers to the cvdalloc binary unnecessarily. Instead, we guard WaitForAvailability by a mutex, so that there is always only one Wait'er at a time, and make WaitForAvailability idempotent, so that the second Wait need not actually attempt to read on the underlying socket.

openwrt uses a vmm to run a Wi-Fi access point, using a 802.11
hardware simulator connected to a tap device. Without cvdalloc, it
assumes this device was already created by cuttlefish-host-resources.
With cvdalloc, openwrt's vmm will need to wait for cvdalloc to complete
in order to use the tap device it creates.

The obvious way to do this is to use WaitForAvailability on cvdalloc's
launcher. However, cvdalloc's launcher is already a VmmDependencyCommand
for the instance's vmm, and if both openwrt's and cvdalloc's launcher are
executing at the same time, we have two contending reads on cvdalloc's
socketpair, which complicates matters.

We could Wait and Post twice on the socket for notification, but that is
rather ugly since that means we couple the number of socket Wait'ers to
the cvdalloc binary unnecessarily. Instead, we guard WaitForAvailability
by a mutex, so that there is always only one Wait'er at a time, and make
WaitForAvailability idempotent, so that the second Wait need not
actually attempt to read on the underlying socket.
@3405691582 3405691582 added the kokoro:run Run e2e tests. label Sep 18, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Sep 18, 2025
@3405691582 3405691582 added this pull request to the merge queue Sep 19, 2025
Merged via the queue into google:main with commit e564913 Sep 19, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants