Conversation
Databean
left a comment
There was a problem hiding this comment.
Added @jemoreira for the wmediumd changes for vhost-user experience
| From 4d439a3686758dde1a6707781988f2a4efdd57f3 Mon Sep 17 00:00:00 2001 | ||
| From: Elie Kheirallah <khei@google.com> | ||
| Date: Fri, 4 Sep 2026 17:40:12 +0000 | ||
| Subject: [PATCH] wmediumd: Implement device state save and restore for | ||
| snapshot |
There was a problem hiding this comment.
Is there a plan to send this wmediumd upstream as well? Honestly I'm not sure what the upstream is at this point, https://github.com/ramonfontes/wmediumd looks like it has the most recent changes, but the code imported to Android is based on this version: https://github.com/bcopeland/wmediumd , and that's also what this build_external code references.
There was a problem hiding this comment.
It's probably worth investigating deltas. If we aren't too divergent from https://github.com/ramonfontes/wmediumd, it might be worthwhile consolidating.
| } | ||
| } | ||
| if (openwrt_restored) { | ||
| const auto openwrt_sock = instance_.OpenwrtCrosvmSocketPath(); |
There was a problem hiding this comment.
We have WaitForUnixSocket with a ListeningWithoutConnect variation. The difference is one will periodically try to connect, and the other will not.
| SubprocessOptions(), WEXITED); | ||
| CHECK(infop.has_value()) | ||
| << "Failed to execute crosvm resume for OpenWRT: " | ||
| << infop.error(); | ||
| CHECK_EQ(infop->si_code, CLD_EXITED); | ||
| CHECK_EQ(infop->si_status, 0) | ||
| << "crosvm resume for OpenWRT returned non-zero code " | ||
| << infop->si_status; |
There was a problem hiding this comment.
This can use the fewer-arguments version of Execute which has comparable behavior and a simpler return type:
android-cuttlefish/base/cvd/cuttlefish/process/execute.cc
Lines 33 to 42 in 01a5427
ef38f2d to
2ce0b5d
Compare
Enable proper snapshot save and restore for OpenWRT AP instances and their vhost-user mac80211_hwsim connections in wmediumd: - Patch external wmediumd to implement vhost-user device state save (SLEEP + GET_VRING_BASE + DEVICE_STATE) and restore (DEVICE_STATE + SET_VRING_ADDR + SET_VRING_BASE + SET_VRING_KICK + SET_VRING_CALL + WAKE) callbacks so existing vhost-user clients can reconnect and resume without losing station/queue state or spinning on stale EPOLLHUP events. - Update CvdBootStateMachine to explicitly resume the OpenWRT crosvm instance (`crosvm resume <sock> --full`) upon guest restore completion, replacing the previous `service network restart` LuciRPC workaround. - Check that the OpenWRT snapshot directory exists before passing `--restore` to crosvm when launching OpenWrt, falling back to a cold boot with a warning if absent. - Cache the discovered OpenWRT IP address in OpenwrtControlServiceImpl so IP lookups continue to succeed after restoring from a snapshot when launcher.log no longer emits fresh boot logs. Bug: 335361533 Test: Verified snapshot take and restore with OpenWRT Wi-Fi enabled TAG=agy CONV=5df97b60-361a-4803-9dc9-6c486b536214
2ce0b5d to
095d508
Compare
| Subject: [PATCH] wmediumd: Implement device state save and restore for | ||
| snapshot |
There was a problem hiding this comment.
It occurs to me also that because we don't have an internal build of wmediumd, this PR might cause problems for Google employees trying to use the internal Cuttlefish host tools build to launch non-git_main devices like AOSP builds because they'll be using the latest run_cvd but an older build of wmediumd.
There was a problem hiding this comment.
Good point.. Have we had a precedence of this?
There was a problem hiding this comment.
Two similar cases I can think of, neither with a satisfying / relevant conclusion:
secure_envhas had additional feature work on git_main, and I'm pushing to get that ported to the github project.netsimhas had additional feature work on git_main. We're trying to temporarily roll back shipping netsim in our debian package until netsim finalizes their own github release that we can rely on.
Enable proper snapshot save and restore for OpenWRT AP instances and their vhost-user mac80211_hwsim connections in wmediumd:
crosvm resume <sock> --full) upon guest restore completion, replacing the previousservice network restartLuciRPC workaround.--restoreto crosvm when launching OpenWrt, falling back to a cold boot with a warning if absent.Bug: 335361533
Test: Verified snapshot take and restore with OpenWRT Wi-Fi enabled
TAG=agy
CONV=5df97b60-361a-4803-9dc9-6c486b536214