commit | a442e67e3de76bd2d1b850202ae8154d38e161e8 | [log] [tgz] |
---|---|---|
author | Seungjae Yoo <seungjaeyoo@google.com> | Wed Jun 19 16:18:07 2024 +0900 |
committer | Seungjae Yoo <seungjaeyoo@google.com> | Wed Jun 19 16:18:07 2024 +0900 |
tree | 9051c0937cbffaf988c80a31dbd787cb1465edbb | |
parent | 835abfe2b75358b4eca742b0ec6a7b5e9a237c2f [diff] |
Implement disableVmTethering Bug: 340376953 Test: atest MicrodroidTests Test: adb shell /apex/com.android.virt/bin/vm run-microdroid --network-supported Change-Id: I575b025bc83ec4028ea9b10c3017319c9ecf842d
diff --git a/virtualizationservice/aidl/android/system/vmtethering/IVmTethering.aidl b/virtualizationservice/aidl/android/system/vmtethering/IVmTethering.aidl index 732a515..0743ffa 100644 --- a/virtualizationservice/aidl/android/system/vmtethering/IVmTethering.aidl +++ b/virtualizationservice/aidl/android/system/vmtethering/IVmTethering.aidl
@@ -21,4 +21,9 @@ * Start VM tethering to provide external network to VM. */ void enableVmTethering(); + + /** + * Terminate VM tethering that providing external network to VM. + */ + void disableVmTethering(); }
diff --git a/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs index aae97fd..af80998 100644 --- a/virtualizationservice/src/aidl.rs +++ b/virtualizationservice/src/aidl.rs
@@ -550,6 +550,10 @@ )) .with_log(); } + + // TODO(340377643): Disabling tethering should be for bridge interface, not TAP interface. + TETHERING_SERVICE.disableVmTethering()?; + NETWORK_SERVICE.deleteTapInterface(tap_fd) } }