From 68d551861a5329001c59239ac92aa6c85ed37c58 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 11 Jan 2024 11:02:16 -0800 Subject: [PATCH] use the same naming as linux --- bin/propolis-server/src/lib/initializer.rs | 2 +- bin/propolis-server/src/lib/stats/pvpanic.rs | 1 + bin/propolis-standalone/src/main.rs | 6 +++--- .../src/instance_spec/components/devices.rs | 14 +++++++------- openapi/propolis-server.json | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/bin/propolis-server/src/lib/initializer.rs b/bin/propolis-server/src/lib/initializer.rs index 1f4c08081..2b0494805 100644 --- a/bin/propolis-server/src/lib/initializer.rs +++ b/bin/propolis-server/src/lib/initializer.rs @@ -282,7 +282,7 @@ impl<'a> MachineInitializer<'a> { uuid: uuid::Uuid, ) -> Result<(), anyhow::Error> { if let Some(ref spec) = self.spec.devices.qemu_pvpanic { - if spec.enable_isa { + if spec.enable_mmio { let pvpanic = QemuPvpanic::create( self.log.new(slog::o!("dev" => "qemu-pvpanic")), ); diff --git a/bin/propolis-server/src/lib/stats/pvpanic.rs b/bin/propolis-server/src/lib/stats/pvpanic.rs index 83df2aca5..53d24a717 100644 --- a/bin/propolis-server/src/lib/stats/pvpanic.rs +++ b/bin/propolis-server/src/lib/stats/pvpanic.rs @@ -62,6 +62,7 @@ impl Producer for PvpanicProducer { self.host_handled_panics.datum_mut().set(host_handled as i64); self.guest_handled_panics.datum_mut().set(guest_handled as i64); + let data = vec![ Sample::new(&self.stat_name, &self.guest_handled_panics)?, Sample::new(&self.stat_name, &self.host_handled_panics)?, diff --git a/bin/propolis-standalone/src/main.rs b/bin/propolis-standalone/src/main.rs index ec58fbfba..7efef8dcb 100644 --- a/bin/propolis-standalone/src/main.rs +++ b/bin/propolis-standalone/src/main.rs @@ -931,12 +931,12 @@ fn setup_instance( chipset.pci_attach(bdf, nvme); } qemu::pvpanic::DEVICE_NAME => { - let enable_isa = dev + let enable_mmio = dev .options - .get("enable_isa") + .get("enable_mmio") .and_then(|opt| opt.as_bool()) .unwrap_or(false); - if enable_isa { + if enable_mmio { let pvpanic = QemuPvpanic::create( log.new(slog::o!("dev" => "pvpanic")), ); diff --git a/crates/propolis-api-types/src/instance_spec/components/devices.rs b/crates/propolis-api-types/src/instance_spec/components/devices.rs index 7277de8aa..c91bc1e10 100644 --- a/crates/propolis-api-types/src/instance_spec/components/devices.rs +++ b/crates/propolis-api-types/src/instance_spec/components/devices.rs @@ -228,7 +228,7 @@ pub enum MigrationCompatibilityError { #[serde(deny_unknown_fields)] pub struct QemuPvpanic { /// Enable the QEMU PVPANIC ISA bus device (I/O port 0x505). - pub enable_isa: bool, + pub enable_mmio: bool, // TODO(eliza): add support for the PCI PVPANIC device... } @@ -428,20 +428,20 @@ mod test { #[test] fn incompatible_qemu_pvpanic() { - let d1 = Some(QemuPvpanic { enable_isa: true }); - let d2 = Some(QemuPvpanic { enable_isa: false }); + let d1 = Some(QemuPvpanic { enable_mmio: true }); + let d2 = Some(QemuPvpanic { enable_mmio: false }); assert!(d1.can_migrate_from_element(&d2).is_err()); assert!(d1.can_migrate_from_element(&None).is_err()); } #[test] fn compatible_qemu_pvpanic() { - let d1 = Some(QemuPvpanic { enable_isa: true }); - let d2 = Some(QemuPvpanic { enable_isa: true }); + let d1 = Some(QemuPvpanic { enable_mmio: true }); + let d2 = Some(QemuPvpanic { enable_mmio: true }); assert!(d1.can_migrate_from_element(&d2).is_ok()); - let d1 = Some(QemuPvpanic { enable_isa: false }); - let d2 = Some(QemuPvpanic { enable_isa: false }); + let d1 = Some(QemuPvpanic { enable_mmio: false }); + let d2 = Some(QemuPvpanic { enable_mmio: false }); assert!(d1.can_migrate_from_element(&d2).is_ok()); } } diff --git a/openapi/propolis-server.json b/openapi/propolis-server.json index 80b4fc61c..f99792744 100644 --- a/openapi/propolis-server.json +++ b/openapi/propolis-server.json @@ -1351,13 +1351,13 @@ "QemuPvpanic": { "type": "object", "properties": { - "enable_isa": { + "enable_mmio": { "description": "Enable the QEMU PVPANIC ISA bus device (I/O port 0x505).", "type": "boolean" } }, "required": [ - "enable_isa" + "enable_mmio" ], "additionalProperties": false },