Skip to content

Commit bc20284

Browse files
Merge remote-tracking branch 'origin/zl/mcast-implicit-lifecycle' into zl/drop-mvlan-from-group
2 parents 6322c39 + 9794876 commit bc20284

File tree

136 files changed

+5554
-3968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5554
-3968
lines changed

Cargo.lock

Lines changed: 18 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ members = [
6060
"gateway-cli",
6161
"gateway-test-utils",
6262
"gateway-types",
63+
"gateway-types/versions",
6364
"illumos-utils",
6465
"installinator-api",
6566
"installinator-common",
@@ -222,6 +223,7 @@ default-members = [
222223
"gateway-cli",
223224
"gateway-test-utils",
224225
"gateway-types",
226+
"gateway-types/versions",
225227
"illumos-utils",
226228
"installinator-api",
227229
"installinator-common",
@@ -472,6 +474,7 @@ gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-
472474
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "ea2f39ccdea124b5affcad0ca17bc5dacf65823a" }
473475
gateway-test-utils = { path = "gateway-test-utils" }
474476
gateway-types = { path = "gateway-types" }
477+
gateway-types-versions = { path = "gateway-types/versions" }
475478
gethostname = "0.5.0"
476479
gfss = { path = "trust-quorum/gfss" }
477480
trust-quorum = { path = "trust-quorum" }

common/src/api/external/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,16 @@ impl ByteCount {
578578

579579
impl Display for ByteCount {
580580
fn fmt(&self, f: &mut Formatter<'_>) -> FormatResult {
581-
if self.to_bytes() >= TiB && self.to_bytes() % TiB == 0 {
581+
if self.to_bytes() >= TiB && self.to_bytes().is_multiple_of(TiB) {
582582
write!(f, "{} TiB", self.to_whole_tebibytes())
583-
} else if self.to_bytes() >= GiB && self.to_bytes() % GiB == 0 {
583+
} else if self.to_bytes() >= GiB && self.to_bytes().is_multiple_of(GiB)
584+
{
584585
write!(f, "{} GiB", self.to_whole_gibibytes())
585-
} else if self.to_bytes() >= MiB && self.to_bytes() % MiB == 0 {
586+
} else if self.to_bytes() >= MiB && self.to_bytes().is_multiple_of(MiB)
587+
{
586588
write!(f, "{} MiB", self.to_whole_mebibytes())
587-
} else if self.to_bytes() >= KiB && self.to_bytes() % KiB == 0 {
589+
} else if self.to_bytes() >= KiB && self.to_bytes().is_multiple_of(KiB)
590+
{
588591
write!(f, "{} KiB", self.to_whole_kibibytes())
589592
} else {
590593
write!(f, "{} B", self.to_bytes())

common/src/api/internal/shared/external_ip/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<T: Ip> SourceNatConfig<T> {
195195
first_port: u16,
196196
last_port: u16,
197197
) -> Result<Self, SourceNatConfigError> {
198-
if first_port % NUM_SOURCE_NAT_PORTS == 0
198+
if first_port.is_multiple_of(NUM_SOURCE_NAT_PORTS)
199199
&& last_port
200200
.checked_sub(first_port)
201201
.and_then(|diff| diff.checked_add(1))

common/src/api/internal/shared/external_ip/v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl SourceNatConfig {
7777
first_port: u16,
7878
last_port: u16,
7979
) -> Result<Self, SourceNatConfigError> {
80-
if first_port % NUM_SOURCE_NAT_PORTS == 0
80+
if first_port.is_multiple_of(NUM_SOURCE_NAT_PORTS)
8181
&& last_port
8282
.checked_sub(first_port)
8383
.and_then(|diff| diff.checked_add(1))

dev-tools/omdb/src/bin/omdb/db/sitrep.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async fn cmd_db_sitrep_show(
238238
}
239239
};
240240

241-
let fm::Sitrep { metadata } = sitrep;
241+
let fm::Sitrep { metadata, cases } = sitrep;
242242
let fm::SitrepMetadata {
243243
id,
244244
creator_id,
@@ -345,5 +345,12 @@ async fn cmd_db_sitrep_show(
345345
}
346346
}
347347

348+
if !cases.is_empty() {
349+
println!("\n{:-<80}\n", "== CASES");
350+
for case in cases {
351+
println!("{}", case.display_indented(4, Some(id)));
352+
}
353+
}
354+
348355
Ok(())
349356
}

ereport/types/src/lib.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub struct Ereport {
3232
Serialize,
3333
Deserialize,
3434
JsonSchema,
35+
Hash,
3536
)]
3637
#[repr(transparent)]
3738
#[serde(from = "u64", into = "u64")]
@@ -102,7 +103,18 @@ impl TryFrom<i64> for Ena {
102103
}
103104

104105
/// Unique identifier for an ereport.
105-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
106+
#[derive(
107+
Debug,
108+
Clone,
109+
Copy,
110+
PartialEq,
111+
Eq,
112+
Serialize,
113+
Deserialize,
114+
PartialOrd,
115+
Ord,
116+
Hash,
117+
)]
106118
pub struct EreportId {
107119
pub restart_id: EreporterRestartUuid,
108120
pub ena: Ena,

gateway-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ workspace = true
1111
dropshot.workspace = true
1212
dropshot-api-manager-types.workspace = true
1313
ereport-types.workspace = true
14-
gateway-types.workspace = true
14+
gateway-types-versions.workspace = true
1515
omicron-common.workspace = true
1616
omicron-uuid-kinds.workspace = true
1717
omicron-workspace-hack.workspace = true

0 commit comments

Comments
 (0)