To be in sync with Cuttlefish, have three virtio-console devices
(previously two) in Microdroid.
/dev/hvc0 is used as the kernel console where kmsg is redirected to
/dev/hvc1 is a new one and is used as the userspace console (set via
androidboot.console). This currently is not used; the backend is a sink.
/dev/hvc2 is used for logcat output
Bug: 200914564
Test: run MicrodroidDemoApp
Change-Id: Ib51be683cc2f8e19e09ae7a6b5707a196eb93ac5
When the debug level of a VM is not "none", logd logs from the VM is
sent to the host. This is done by running the VM with another virtual
console and running logcat as a daemon process whose output is set to
the new virtual console device. The launch of the daemon process is
controlled by microdroid. It starts the process only when the debug
level is set to above "none".
For now, the virtual console device is backed by the same file
descriptor as the kernel console logs. A follow-up change will introduce
a new dedicated file descriptor.
Bug: 200914564
Test: start microdroid using the `vm` tool. logcat logs are shown in
stdout.
Change-Id: I1748d30c5c997cda73f7b9f082ca84b0b3d25f1e
So far, Microdroid used ueventd.rc from Android. Although ueventd.rc for
Android has some device nodes that are not relevant to microdroid (e.g.
gpu, input, etc.) but that wasn't harmful. However, we will soon have
/dev/hvc* entries for the virtualized console which is exclusive for
Microdroid.
Forking the file in preparation for the change.
Bug: 200914564
Test: atest MicrodroidHostTestCases
Change-Id: I3d42203f4835b8058249ef0783d0509d693e81e0