vmm: refactor DeviceManager to use console_info

While adding console devices, DeviceManager will now use the FDs in
console_info instead of creating them.

To reduce the size of this commit, I marked some variables are unused
with '_' prefix. All those variables are cleaned up in next commit.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
This commit is contained in:
Praveen K Paladugu
2024-05-02 21:42:57 +00:00
committed by Rob Bradford
parent 380ba564f4
commit 52eebaf6b2
5 changed files with 114 additions and 144 deletions

View File

@@ -107,7 +107,7 @@ fn modify_mode<F: FnOnce(&mut termios)>(
Ok(())
}
pub fn set_raw_mode(
fn set_raw_mode(
f: &dyn AsRawFd,
original_termios_opt: Arc<Mutex<Option<termios>>>,
) -> ConsoleDeviceResult<()> {
@@ -120,7 +120,7 @@ pub fn set_raw_mode(
.map_err(ConsoleDeviceError::SetPtyRaw)
}
pub fn create_pty() -> io::Result<(File, File, PathBuf)> {
fn create_pty() -> io::Result<(File, File, PathBuf)> {
// Try to use /dev/pts/ptmx first then fall back to /dev/ptmx
// This is done to try and use the devpts filesystem that
// could be available for use in the process's namespace first.