Use the unused /dev/hvc1 as the ramdump sink

pvmfw seems to have a hard limit on the number of PCI devices. Until
that is fixed, don't add a new PCI device, but use the existing (but
used) one.

Bug: N/A
Test: watch TH
Change-Id: I6ab7f3c2a3a072b28afa9601c617ec461fbeed93
diff --git a/microdroid/kdump/crashdump.c b/microdroid/kdump/crashdump.c
index a606d43..47d359a 100644
--- a/microdroid/kdump/crashdump.c
+++ b/microdroid/kdump/crashdump.c
@@ -28,7 +28,7 @@
 #include <unistd.h>
 
 #define DUMP_SOURCE "/proc/vmcore"
-#define DUMP_TARGET "/dev/hvc3" // See virtualizationserice/crosvm.rs
+#define DUMP_TARGET "/dev/hvc1" // See virtualizationserice/crosvm.rs
 #define BUF_SIZE 4096
 
 #define FAIL(format, ...)                                                \
diff --git a/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs
index af5029a..f925394 100644
--- a/virtualizationservice/src/aidl.rs
+++ b/virtualizationservice/src/aidl.rs
@@ -466,7 +466,7 @@
 
         // Creating this ramdump file unconditionally is not harmful as ramdump will be created
         // only when the VM is configured as such. `ramdump_write` is sent to crosvm and will
-        // be the backing store for the /dev/hvc3 where VM will emit ramdump to. `ramdump_read`
+        // be the backing store for the /dev/hvc1 where VM will emit ramdump to. `ramdump_read`
         // will be sent back to the client (i.e. the VM owner) for readout.
         let ramdump_path = temporary_directory.join("ramdump");
         let ramdump = prepare_ramdump_file(&ramdump_path).map_err(|e| {
diff --git a/virtualizationservice/src/crosvm.rs b/virtualizationservice/src/crosvm.rs
index 4c0b25e..46ad6b3 100644
--- a/virtualizationservice/src/crosvm.rs
+++ b/virtualizationservice/src/crosvm.rs
@@ -418,7 +418,7 @@
     // 1. uart device: used as the output device by bootloaders and as early console by linux
     // 2. uart device: used to report the reason for the VM failing.
     // 3. virtio-console device: used as the console device where kmsg is redirected to
-    // 4. virtio-console device: used as the androidboot.console device (not used currently)
+    // 4. virtio-console device: used as the ramdump output
     // 5. virtio-console device: used as the logcat output
     //
     // When [console|log]_fd is not specified, the devices are attached to sink, which means what's
@@ -438,12 +438,10 @@
     command.arg(format!("--serial=type=file,path={},hardware=serial,num=2", &failure_serial_path));
     // /dev/hvc0
     command.arg(format!("--serial={},hardware=virtio-console,num=1", &console_arg));
-    // /dev/hvc1 (not used currently)
-    command.arg("--serial=type=sink,hardware=virtio-console,num=2");
+    // /dev/hvc1
+    command.arg(format!("--serial={},hardware=virtio-console,num=2", &ramdump_arg));
     // /dev/hvc2
     command.arg(format!("--serial={},hardware=virtio-console,num=3", &log_arg));
-    // /dev/hvc3
-    command.arg(format!("--serial={},hardware=virtio-console,num=4", &ramdump_arg));
 
     if let Some(bootloader) = &config.bootloader {
         command.arg("--bios").arg(add_preserved_fd(&mut preserved_fds, bootloader));