Revert "Send logcat ouput over serial ports instead of vsocket"

This reverts commit f56f6b404e21463b3b68141de46a468ce222e6ba.

Reason for revert: test failures

Change-Id: I9b4c7d17f00e984ca04df7ca3d4b1e4b2dfcfe7d
diff --git a/host/libs/vm_manager/cf_qemu.sh b/host/libs/vm_manager/cf_qemu.sh
index 835c1ed..157f941 100755
--- a/host/libs/vm_manager/cf_qemu.sh
+++ b/host/libs/vm_manager/cf_qemu.sh
@@ -144,10 +144,12 @@
     -device "ivshmem-doorbell,chardev=ivsocket,vectors=${ivshmem_vector_count}"
 )
 
-args+=(
-    -chardev "file,id=charchannel0,path=${logcat_path:-${default_dir}/logcat},append=on"
-    -device "virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=cf-logcat"
-)
+if [[ "${logcat_mode}" == "serial" ]]; then
+    args+=(
+        -chardev "file,id=charchannel0,path=${logcat_path:-${default_dir}/logcat},append=on"
+        -device "virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=cf-logcat"
+    )
+fi
 
 if [[ -n "${gdb_flag}" ]]; then
   args+=(-gdb "${gdb_flag}")
diff --git a/host/libs/vm_manager/crosvm_manager.cpp b/host/libs/vm_manager/crosvm_manager.cpp
index e7b150b..33cedc7 100644
--- a/host/libs/vm_manager/crosvm_manager.cpp
+++ b/host/libs/vm_manager/crosvm_manager.cpp
@@ -128,9 +128,6 @@
                        config_->kernel_log_pipe_name(),",console=true");
   // Use stdio for the second serial port, it contains the serial console.
   crosvm_cmd.AddParameter("--serial=num=2,type=stdout,stdin=true");
-  // Third serial port has logcat output, send it to the appropriate file.
-  crosvm_cmd.AddParameter("--serial=num=3,type=file,path=",
-                          config_->logcat_path());
 
   // Redirect standard input and output to a couple of pipes for the console
   // forwarder host process to handle.
diff --git a/host/libs/vm_manager/qemu_manager.cpp b/host/libs/vm_manager/qemu_manager.cpp
index abb7c0a..831a156 100644
--- a/host/libs/vm_manager/qemu_manager.cpp
+++ b/host/libs/vm_manager/qemu_manager.cpp
@@ -122,6 +122,7 @@
                std::to_string(config_->ivshmem_vector_count()));
   LogAndSetEnv("usb_v1_socket_name", config_->usb_v1_socket_name());
   LogAndSetEnv("vsock_guest_cid", std::to_string(config_->vsock_guest_cid()));
+  LogAndSetEnv("logcat_mode", config_->logcat_mode());
 
   cvd::Command qemu_cmd(vsoc::DefaultHostArtifactsPath("bin/cf_qemu.sh"));
   std::vector<cvd::Command> ret;