diff --git a/bin/propolis-cli/src/main.rs b/bin/propolis-cli/src/main.rs index ebf010858..e3224950b 100644 --- a/bin/propolis-cli/src/main.rs +++ b/bin/propolis-cli/src/main.rs @@ -595,7 +595,7 @@ async fn migrate_instance( .collect::, _>>()? // Then any errors from polling the source/destination .into_iter() - .collect::>()?; + .collect::>()?; Ok(()) } diff --git a/bin/propolis-utils/src/bin/cpuid-gen.rs b/bin/propolis-utils/src/bin/cpuid-gen.rs index c41a5917c..9e8a49642 100644 --- a/bin/propolis-utils/src/bin/cpuid-gen.rs +++ b/bin/propolis-utils/src/bin/cpuid-gen.rs @@ -16,17 +16,23 @@ fn create_vm() -> anyhow::Result { 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) } diff --git a/lib/propolis/src/firmware/smbios/bits.rs b/lib/propolis/src/firmware/smbios/bits.rs index 2a9918b95..09bcde2e2 100644 --- a/lib/propolis/src/firmware/smbios/bits.rs +++ b/lib/propolis/src/firmware/smbios/bits.rs @@ -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, @@ -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,