Started on Virt Manager.
This is a new service to manage crosvm instances running VMs. It
provides an AIDL interface which other services can call to start a VM
with some given configuration.
Bug: 171278952
Test: mm
Change-Id: Ie5b10d5f48da430aaeb66af9f2ee082f143472ec
diff --git a/virtmanager/aidl/Android.bp b/virtmanager/aidl/Android.bp
new file mode 100644
index 0000000..e46bd27
--- /dev/null
+++ b/virtmanager/aidl/Android.bp
@@ -0,0 +1,17 @@
+aidl_interface {
+ name: "android.system.virtmanager",
+ srcs: ["**/*.aidl"],
+ // TODO(qwandor): Consider changing this to false, unless we have a Java wrapper.
+ unstable: true,
+ backend: {
+ java: {
+ sdk_version: "module_current",
+ },
+ cpp: {
+ enabled: true,
+ },
+ rust: {
+ enabled: true,
+ },
+ },
+}
diff --git a/virtmanager/aidl/android/system/virtmanager/IVirtManager.aidl b/virtmanager/aidl/android/system/virtmanager/IVirtManager.aidl
new file mode 100644
index 0000000..ade8717
--- /dev/null
+++ b/virtmanager/aidl/android/system/virtmanager/IVirtManager.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2021 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.
+ */
+package android.system.virtmanager;
+
+import android.system.virtmanager.IVirtualMachine;
+
+interface IVirtManager {
+ /** Start the VM with the given config file, and return a handle to it. */
+ IVirtualMachine startVm(String configPath);
+}
diff --git a/virtmanager/aidl/android/system/virtmanager/IVirtualMachine.aidl b/virtmanager/aidl/android/system/virtmanager/IVirtualMachine.aidl
new file mode 100644
index 0000000..5f408f8
--- /dev/null
+++ b/virtmanager/aidl/android/system/virtmanager/IVirtualMachine.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2021 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.
+ */
+package android.system.virtmanager;
+
+interface IVirtualMachine {
+ /** Get the CID allocated to the VM. */
+ int getCid();
+}