Skip to content

Commit ff48052

Browse files
test-runner: Update reconnect_serial_to_console
Use boot::connect_controller. The BootServices param is no longer needed.
1 parent 6138bbe commit ff48052

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

uefi-test-runner/src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn send_request_helper(serial: &mut Serial, request: HostRequest) -> Result {
143143
/// This must be called after opening the serial protocol in exclusive mode, as
144144
/// that breaks the connection to the console, which in turn prevents logs from
145145
/// getting to the host.
146-
fn reconnect_serial_to_console(boot_services: &BootServices, serial_handle: Handle) {
146+
fn reconnect_serial_to_console(serial_handle: Handle) {
147147
let mut storage = Vec::new();
148148
// Create a device path that specifies the terminal type.
149149
let terminal_guid = if cfg!(target_arch = "aarch64") {
@@ -160,8 +160,7 @@ fn reconnect_serial_to_console(boot_services: &BootServices, serial_handle: Hand
160160
.finalize()
161161
.unwrap();
162162

163-
boot_services
164-
.connect_controller(serial_handle, None, Some(terminal_device_path), true)
163+
uefi::boot::connect_controller(serial_handle, None, Some(terminal_device_path), true)
165164
.expect("failed to reconnect serial to console");
166165
}
167166

@@ -198,7 +197,7 @@ fn send_request_to_host(bt: &BootServices, request: HostRequest) {
198197
// device, which was broken when we opened the protocol in exclusive
199198
// mode above.
200199
drop(serial);
201-
reconnect_serial_to_console(bt, serial_handle);
200+
reconnect_serial_to_console(serial_handle);
202201

203202
if let Err(err) = res {
204203
panic!("request failed: \"{request:?}\": {:?}", err.status());

uefi-test-runner/src/proto/console/serial.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub unsafe fn test(bt: &BootServices) {
6767
// device, which was broken when we opened the protocol in exclusive
6868
// mode above.
6969
drop(serial);
70-
reconnect_serial_to_console(bt, handle);
70+
reconnect_serial_to_console(handle);
7171

7272
if let Err(err) = res {
7373
panic!("serial test failed: {:?}", err.status());

0 commit comments

Comments
 (0)