bin/vm run-microdroid supports --network-supported flag.
Bug: 340376951
Test: adb shell /apex/com.android.virt/bin/vm run-microdroid
--network-supported
Test: adb shell /apex/com.android.virt/bin/vm run-microdroid
--network-supported --protected
Change-Id: I1d88fe11d79b8ea46e12b6dfaab318aabdc0a2e0
diff --git a/virtualizationservice/vmnic/Android.bp b/virtualizationservice/vmnic/Android.bp
index 4313a82..784c648 100644
--- a/virtualizationservice/vmnic/Android.bp
+++ b/virtualizationservice/vmnic/Android.bp
@@ -17,5 +17,4 @@
"liblog_rust",
],
apex_available: ["com.android.virt"],
- init_rc: ["vmnic.rc"],
}
diff --git a/virtualizationservice/vmnic/src/aidl.rs b/virtualizationservice/vmnic/src/aidl.rs
index 26a0eff..6443258 100644
--- a/virtualizationservice/vmnic/src/aidl.rs
+++ b/virtualizationservice/vmnic/src/aidl.rs
@@ -17,6 +17,7 @@
use anyhow::anyhow;
use android_system_virtualizationservice_internal::aidl::android::system::virtualizationservice_internal::IVmnic::IVmnic;
use binder::{self, ExceptionCode, Interface, IntoBinderResult, ParcelFileDescriptor};
+use log::info;
#[derive(Debug, Default)]
pub struct Vmnic {}
@@ -30,7 +31,10 @@
impl Interface for Vmnic {}
impl IVmnic for Vmnic {
- fn createTapInterface(&self, _cid: i32) -> binder::Result<ParcelFileDescriptor> {
+ fn createTapInterface(&self, iface_name_suffix: &str) -> binder::Result<ParcelFileDescriptor> {
+ let ifname = format!("avf_tap_{iface_name_suffix}");
+ info!("Creating TAP interface {}", ifname);
+
Err(anyhow!("Creating TAP network interface is not supported yet"))
.or_binder_exception(ExceptionCode::UNSUPPORTED_OPERATION)
}
diff --git a/virtualizationservice/vmnic/vmnic.rc b/virtualizationservice/vmnic/vmnic.rc
deleted file mode 100644
index 486f387..0000000
--- a/virtualizationservice/vmnic/vmnic.rc
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2024 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-service vmnic /apex/com.android.virt/bin/vmnic
- user system
- group system
- interface aidl android.system.virtualizationservice_internal.IVmnic
- disabled
- oneshot