Send logd logs from VM to host

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
diff --git a/microdroid/init.rc b/microdroid/init.rc
index 74da023..ad551cc 100644
--- a/microdroid/init.rc
+++ b/microdroid/init.rc
@@ -195,6 +195,11 @@
     seclabel u:r:shell:s0
     setenv HOSTNAME console
 
+service seriallogging /system/bin/logcat -b all -v threadtime -f /dev/hvc1 *:V
+    disabled
+    user logd
+    group root logd
+
 on fs
     write /dev/event-log-tags "# content owned by logd
 "