Redirect crosvm stdin to /dev/null

If this is not done crosvm inherits stdin from the launcher, which, if
run in foreground could lead to accidentally inserting unwanted
commands in the console. Additionally, crosvm attempts to control the
terminal it's running in, which causes it to hang when run in
background.

Bug: 128457282
Test: run locally
Change-Id: I2c7d4b24f7c614af5bea32964c7f609b6c140092
diff --git a/host/libs/vm_manager/crosvm_manager.cpp b/host/libs/vm_manager/crosvm_manager.cpp
index 785634a..e88ca07 100644
--- a/host/libs/vm_manager/crosvm_manager.cpp
+++ b/host/libs/vm_manager/crosvm_manager.cpp
@@ -105,6 +105,13 @@
                           kernel_log_connection);
   }
 
+  auto dev_null = cvd::SharedFD::Open("/dev/null", O_RDONLY);
+  if (dev_null->IsOpen()) {
+    command.RedirectStdIO(cvd::Subprocess::StdIOChannel::kStdIn, dev_null);
+  } else {
+    LOG(ERROR) << "Unable to open /dev/null for stdin redirection";
+  }
+
   // This needs to be the last parameter
   command.AddParameter(config_->GetKernelImageToUse());