Skip to content

Commit

Permalink
main, block: Remove device.reset()
Browse files Browse the repository at this point in the history
There is no need to reset the device as Cloud Hypervisor supports device
reset itself (so the booted kernel will correctly reset the device on
boot.)

In particular resetting the block device prior to booting via EFI breaks
the EFI boot.

Fixes: cloud-hypervisor#35

Signed-off-by: Rob Bradford <[email protected]>
  • Loading branch information
rbradford committed Apr 1, 2020
1 parent 7bb1d31 commit 5824d97
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ impl<'a> VirtioBlockDevice<'a> {
}
}

pub fn reset(&self) {
self.transport.reset()
}

pub fn init(&mut self) -> Result<(), VirtioError> {
const VIRTIO_SUBSYSTEM_BLOCK: u32 = 0x2;
const VIRTIO_F_VERSION_1: u64 = 1 << 32;
Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ fn boot_from_device(device: &mut block::VirtioBlockDevice, info: &dyn boot::Info

match loader::load_default_entry(&f, info) {
Ok(mut kernel) => {
device.reset();
log!("Jumping to kernel");
kernel.boot();
return true;
Expand Down Expand Up @@ -133,7 +132,6 @@ fn boot_from_device(device: &mut block::VirtioBlockDevice, info: &dyn boot::Info
}
};

device.reset();
log!("Executable loaded");
efi::efi_exec(entry_addr, 0x20_0000, size, info, &f, device);
true
Expand Down

0 comments on commit 5824d97

Please sign in to comment.