Skip to content
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
488 changes: 281 additions & 207 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ clap = "4.2"
const_format = "0.2"
crossbeam-channel = "0.5"
ctrlc = "3.2"
dropshot = "0.16.2"
dropshot = "0.16.4"
erased-serde = "0.4"
errno = "0.2.8"
escargot = "0.5.8"
Expand All @@ -121,10 +121,11 @@ fatfs = "0.3.6"
futures = "0.3"
futures-util = "0.3.21"
flate2 = "1.0.28"
heck = "0.5.0"
hex = "0.4.3"
http = "1.1.0"
hyper = "1.0"
inventory = "0.3.0"
linkme = "0.3.33"
itertools = "0.13.0"
kstat-rs = "0.2.4"
lazy_static = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion bin/propolis-server/src/lib/migrate/memx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::migrate::codec;

// Validates the parameters from a fetch, offer, or xfer.
pub(crate) fn validate_bitmap(start: u64, end: u64, bits: &[u8]) -> bool {
if start % 4096 != 0 || end % 4096 != 0 {
if !start.is_multiple_of(4096) || !end.is_multiple_of(4096) {
return false;
}
if end <= start {
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/hw/nvme/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ impl Iterator for PrpIter<'_> {
match self.get_next() {
Ok(res) => Some(res),
Err(e) => {
probes::nvme_prp_error!(|| (e));
probes::nvme_prp_error!(|| e);
self.error = Some(e);
None
}
Expand Down
4 changes: 2 additions & 2 deletions lib/propolis/src/hw/nvme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ impl PciNvme {
CtrlrReg::DoorBellAdminSQ => {
// 32-bit register but ignore reserved top 16-bits
let val = wo.read_u32() as u16;
probes::nvme_doorbell_admin_sq!(|| (val));
probes::nvme_doorbell_admin_sq!(|| val);
let state = self.state.lock().unwrap();

if !state.ctrl.cc.enabled() {
Expand All @@ -788,7 +788,7 @@ impl PciNvme {
CtrlrReg::DoorBellAdminCQ => {
// 32-bit register but ignore reserved top 16-bits
let val = wo.read_u32() as u16;
probes::nvme_doorbell_admin_cq!(|| (val));
probes::nvme_doorbell_admin_cq!(|| val);
let state = self.state.lock().unwrap();

if !state.ctrl.cc.enabled() {
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/hw/virtio/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl PciVirtioBlock {
}
}
VIRTIO_BLK_T_FLUSH => {
probes::vioblk_flush_enqueue!(|| (rid));
probes::vioblk_flush_enqueue!(|| rid);
Ok(self.block_tracking.track(
block::Request::new_flush(),
CompletionPayload { rid, chain },
Expand Down
2 changes: 1 addition & 1 deletion lib/propolis/src/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ impl Vcpu {
// that can be done.
}
}
probes::vm_entry!(|| (self.id as u32));
probes::vm_entry!(|| self.id as u32);
let _res = unsafe { self.hdl.ioctl(bhyve_api::VM_RUN, &mut entry)? };
probes::vm_exit!(|| (self.id as u32, exit.rip, exit.exitcode as u32));

Expand Down
2 changes: 1 addition & 1 deletion phd-tests/framework/src/disk/crucible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Inner {
const GIBIBYTE: u64 = 1 << 30;

assert!(EXTENT_SIZE > block_size.bytes());
assert!(EXTENT_SIZE % block_size.bytes() == 0);
assert!(EXTENT_SIZE.is_multiple_of(block_size.bytes()));

let disk_size_gib = match read_only_parent {
// If there's a read-only parent, ensure the disk is large enough to
Expand Down
2 changes: 1 addition & 1 deletion phd-tests/testcase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doctest = false

[dependencies]
futures.workspace = true
inventory.workspace = true
linkme.workspace = true
thiserror.workspace = true
phd-framework.workspace = true
phd-testcase-macros.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions phd-tests/testcase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

pub use anyhow::{Context, Result};
pub use inventory::submit as inventory_submit;
pub use phd_framework;
pub use phd_testcase_macros::*;
use thiserror::Error;
Expand Down Expand Up @@ -80,10 +79,11 @@ impl TestCase {
}
}

inventory::collect!(TestCase);
#[linkme::distributed_slice]
pub static TEST_CASES: [TestCase];

pub fn all_test_cases() -> impl Iterator<Item = &'static TestCase> {
inventory::iter::<TestCase>.into_iter()
TEST_CASES.into_iter()
}

/// Returns an iterator over the subset of tests for which (a) the fully
Expand All @@ -93,7 +93,7 @@ pub fn filtered_test_cases<'rule>(
must_include: &'rule [String],
must_exclude: &'rule [String],
) -> impl Iterator<Item = &'static TestCase> + 'rule {
inventory::iter::<TestCase>.into_iter().filter(|tc| {
TEST_CASES.into_iter().filter(|tc| {
must_include.iter().all(|inc| tc.fully_qualified_name().contains(inc))
&& must_exclude
.iter()
Expand Down
1 change: 1 addition & 0 deletions phd-tests/testcase_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test = false
doctest = false

[dependencies]
heck.workspace = true
proc-macro2.workspace = true
proc-macro-error.workspace = true
quote.workspace = true
Expand Down
17 changes: 9 additions & 8 deletions phd-tests/testcase_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use heck::ToShoutySnakeCase;
use proc_macro::TokenStream;
use proc_macro_error::{abort, proc_macro_error};
use quote::quote;
use quote::{format_ident, quote};
use syn::{parse_macro_input, spanned::Spanned, ItemFn};

/// The macro for labeling PHD testcases.
Expand All @@ -24,14 +25,14 @@ pub fn phd_testcase(_attrib: TokenStream, input: TokenStream) -> TokenStream {
// itself regardless of where it's located.
let fn_ident = item_fn.sig.ident.clone();
let fn_name = fn_ident.to_string();
let static_ident = format_ident!("{}", fn_name.to_shouty_snake_case());
let submit: proc_macro2::TokenStream = quote! {
phd_testcase::inventory_submit! {
phd_testcase::TestCase::new(
module_path!(),
#fn_name,
phd_testcase::TestFunction { f: |ctx| Box::pin(#fn_ident(ctx)) }
)
}
#[linkme::distributed_slice(phd_testcase::TEST_CASES)]
static #static_ident: phd_testcase::TestCase = phd_testcase::TestCase::new(
module_path!(),
#fn_name,
phd_testcase::TestFunction { f: |ctx| Box::pin(#fn_ident(ctx)) }
);
};

if item_fn.sig.asyncness.is_none() {
Expand Down
1 change: 1 addition & 0 deletions phd-tests/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dropshot.workspace = true
futures.workspace = true
http.workspace = true
itertools.workspace = true
linkme.workspace = true
omicron-common.workspace = true
oximeter-producer.workspace = true
oximeter.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# We choose a specific toolchain (rather than "stable") for repeatability. The
# intent is to keep this up-to-date with recently-released stable Rust.

channel = "1.88.0"
channel = "1.90.0"
profile = "default"
Loading