run_cvd: Improve tap device validation error messages#2601
Open
bridadan wants to merge 1 commit into
Open
Conversation
04dd053 to
01cdfbb
Compare
ser-io
approved these changes
May 22, 2026
| #ifdef __linux__ | ||
| Result<void> ValidateTapInterfaceIsUsable(const std::string& interface_name) { | ||
| CF_EXPECTF(NetworkInterfaceExists(interface_name), | ||
| "Tap interface {} does not exist", interface_name); |
Member
There was a problem hiding this comment.
nit: wondering whether we should reference "cuttlefish-host-resources.service" in this error message for a more actionable message.
For example: "Tap interface {} does not exist. Cuttlefish tap devices should have been created when running cuttlefish-host-resources.service"
I'll leave it up to you for the final message.
Collaborator
Author
There was a problem hiding this comment.
Yeah agreed! I updated the message, let me know what you think
Refactor ValidateTapInterfaceUnused to check if the interface exists
first, avoiding misleading "Operation not permitted" errors when the
device simply does not exist.
Update ValidateTapDevices to remove the assumption that another device
is running, while keeping the actionable suggestions (cvd reset, pkill).
Also remove redundant "Device in use" messages in TestTapDevices to
keep logs terse.
Bug: 512536991
Test: Built it with a intentionally incorrect interface name, ensured
output stated interface did not exist instead of a misleading error
Flag: EXEMPT BUGFIX
01cdfbb to
aad626e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor ValidateTapInterfaceUnused to check if the interface exists first, avoiding misleading "Operation not permitted" errors when the device simply does not exist.
Update ValidateTapDevices to remove the assumption that another device is running, while keeping the actionable suggestions (cvd reset, pkill).
Also remove redundant "Device in use" messages in TestTapDevices to keep logs terse.
Bug: 512536991
Test: Built it with a intentionally incorrect interface name, ensured
output stated interface did not exist instead of a misleading error