Implement enableVmTethering
Bug: 340376953
Test: atest MicrodroidTests
Change-Id: I47606e0826fe5db47f0baeea5e44f69865a00b30
diff --git a/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs
index c0e1cc7..aae97fd 100644
--- a/virtualizationservice/src/aidl.rs
+++ b/virtualizationservice/src/aidl.rs
@@ -518,7 +518,7 @@
Ok(())
}
- fn createTapInterface(&self, iface_name_suffix: &str) -> binder::Result<ParcelFileDescriptor> {
+ fn createTapInterface(&self, _iface_name_suffix: &str) -> binder::Result<ParcelFileDescriptor> {
check_internet_permission()?;
check_use_custom_virtual_machine()?;
if !cfg!(network) {
@@ -528,18 +528,14 @@
))
.with_log();
}
- let tap_fd = NETWORK_SERVICE.createTapInterface(iface_name_suffix)?;
+ // TODO(340377643): Use iface_name_suffix after introducing bridge interface, not fixed
+ // value.
+ let tap_fd = NETWORK_SERVICE.createTapInterface("fixed")?;
// TODO(340377643): Due to lack of implementation of creating bridge interface, tethering is
// enabled for TAP interface instead of bridge interface. After introducing creation of
// bridge interface in AVF, we should modify it.
- if let Err(e) = TETHERING_SERVICE.enableVmTethering() {
- if e.exception_code() == ExceptionCode::UNSUPPORTED_OPERATION {
- warn!("{}", e.get_description());
- } else {
- return Err(e);
- }
- }
+ TETHERING_SERVICE.enableVmTethering()?;
Ok(tap_fd)
}