Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix new 1.81.0 warning and clippy error #760

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/propolis-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ async fn migrate_instance(
.collect::<Result<Vec<_>, _>>()?
// Then any errors from polling the source/destination
.into_iter()
.collect::<anyhow::Result<_>>()?;
.collect::<anyhow::Result<()>>()?;

Ok(())
}
Expand Down
28 changes: 17 additions & 11 deletions bin/propolis-utils/src/bin/cpuid-gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ fn create_vm() -> anyhow::Result<VmmFd> {
let ctl = VmmCtlFd::open()?;
let _ = unsafe { ctl.ioctl(bhyve_api::VMM_CREATE_VM, &mut req) }?;

let vm = VmmFd::open(&name).map_err(|e| {
// Attempt to manually destroy the VM if we cannot open it
let _ = ctl.vm_destroy(name.as_bytes());
e
})?;

vm.ioctl_usize(bhyve_api::ioctls::VM_SET_AUTODESTRUCT, 1).map_err(|e| {
// Destroy instance if auto-destruct cannot be set
let _ = vm.ioctl_usize(bhyve_api::VM_DESTROY_SELF, 0);
e
})?;
let vm = match VmmFd::open(&name) {
Ok(vm) => vm,
Err(e) => {
// Attempt to manually destroy the VM if we cannot open it
let _ = ctl.vm_destroy(name.as_bytes());
return Err(e.into());
}
};

match vm.ioctl_usize(bhyve_api::ioctls::VM_SET_AUTODESTRUCT, 1) {
Ok(_res) => {}
Err(e) => {
// Destroy instance if auto-destruct cannot be set
let _ = vm.ioctl_usize(bhyve_api::VM_DESTROY_SELF, 0);
return Err(e.into());
}
};

Ok(vm)
}
Expand Down
4 changes: 4 additions & 0 deletions lib/propolis/src/firmware/smbios/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ pub(crate) struct Type1 {
}
raw_table_impl!(Type1, 1);

// We don't create type 2 tables yet, but it's nice to have the definition on hand.
/// Type 2 (Baseboard Information)
#[derive(Copy, Clone)]
#[repr(C, packed)]
#[allow(dead_code)]
pub(crate) struct Type2 {
pub header: StructureHeader,
pub manufacturer: u8,
Expand All @@ -159,9 +161,11 @@ pub(crate) struct Type2 {
}
raw_table_impl!(Type2, 2);

// We don't create type 3 tables yet, but it's nice to have the definition on hand.
/// Type 3 (System Enclosure) - Version 2.7
#[derive(Copy, Clone)]
#[repr(C, packed)]
#[allow(dead_code)]
pub(crate) struct Type3 {
pub header: StructureHeader,
pub manufacturer: u8,
Expand Down
Loading