Allocate each VM an instance_id
Introduce a 64 bytes' long instance_id. When the VM is created, this is
requested from virtualization service, which randomly allocates it.
While it does that, it also logs the user & the package name.
The app persists this allocated instance_id in a file `instance_id` in
its directory for the vm instance (along with instance.img &
storage.img). When the VirtualMachine is run, this is an input into the
VM via DT.
This patch modifies Compos & vm binary to work with the instance_id.
flagging: instance_id allocation request is conditional to flag build
time flag llpvm_changes, no file `instance_id` is created if the flag is
off. `instanceId` is all 0s if the flag is off.
Bug: 291213394
Test: atest MicrodroidHostTest
Test: atest MicrodroidTests
Test: atest ComposHostTestCases
Test: Look for instance_id logged by VS
Change-Id: Ie8e25b9510e27362d4580c55c1bd557143ff7d0e
diff --git a/virtualizationservice/Android.bp b/virtualizationservice/Android.bp
index 843873b..2cbc805 100644
--- a/virtualizationservice/Android.bp
+++ b/virtualizationservice/Android.bp
@@ -31,12 +31,14 @@
"libanyhow",
"libavflog",
"libbinder_rs",
+ "libhex",
"libhypervisor_props",
"liblazy_static",
"liblibc",
"liblog_rust",
"libnix",
"libopenssl",
+ "librand",
"librkpd_client",
"librustutils",
"libstatslog_virtualization_rust",