Create new virtmgr binary from virtualizationservice

To bootstrap separation of virtualizationservice into two binaries
(global service and user instance), start by compiling a second binary
out of the same source code, just using a diffrent main source file.

The new binary has a command line interface that takes two file
descriptors - a socketpair() fd to start RpcBinder server on, and
a pipe() fd to use for signalling when the server has been started.

The process registers a death notification to kill itself when the
parent process has died.

Bug: 245727626
Test: builds, not used in tests yet
Change-Id: I0c4c7892af91b6deb5ece60e0d1b49a2b4356d35
diff --git a/virtualizationservice/Android.bp b/virtualizationservice/Android.bp
index da56f76..d0dde42 100644
--- a/virtualizationservice/Android.bp
+++ b/virtualizationservice/Android.bp
@@ -5,7 +5,6 @@
 rust_defaults {
     name: "virtualizationservice_defaults",
     crate_name: "virtualizationservice",
-    srcs: ["src/main.rs"],
     edition: "2021",
     // Only build on targets which crosvm builds on.
     enabled: false,
@@ -67,11 +66,23 @@
 rust_binary {
     name: "virtualizationservice",
     defaults: ["virtualizationservice_defaults"],
+    srcs: ["src/main.rs"],
+    apex_available: ["com.android.virt"],
+}
+
+rust_binary {
+    name: "virtmgr",
+    defaults: ["virtualizationservice_defaults"],
+    srcs: ["src/virtmgr.rs"],
+    rustlibs: [
+        "libclap",
+    ],
     apex_available: ["com.android.virt"],
 }
 
 rust_test {
     name: "virtualizationservice_device_test",
+    srcs: ["src/main.rs"],
     defaults: ["virtualizationservice_defaults"],
     rustlibs: [
         "libtempfile",