-
Notifications
You must be signed in to change notification settings - Fork 133
nvme: Print controller GUID in shutdown_nvme_driver span #1619
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ pub struct NvmeDriver<T: DeviceBacking> { | |
#[inspect(flatten)] | ||
task: Option<TaskControl<DriverWorkerTask<T>, WorkerState>>, | ||
device_id: String, | ||
controller_instance_id: Option<String>, | ||
identify: Option<Arc<spec::IdentifyController>>, | ||
#[inspect(skip)] | ||
driver: VmTaskDriver, | ||
|
@@ -248,6 +249,7 @@ impl<T: DeviceBacking> NvmeDriver<T> { | |
|
||
Ok(Self { | ||
device_id: device.id().to_owned(), | ||
controller_instance_id: None, | ||
task: Some(TaskControl::new(DriverWorkerTask { | ||
device, | ||
driver: driver.clone(), | ||
|
@@ -555,6 +557,7 @@ impl<T: DeviceBacking> NvmeDriver<T> { | |
// TODO: See the description above, save the vector once resolved. | ||
namespaces: vec![], | ||
worker_data: s, | ||
controller_instance_id: self.controller_instance_id.clone(), | ||
}) | ||
} | ||
Err(e) => Err(e), | ||
|
@@ -594,6 +597,7 @@ impl<T: DeviceBacking> NvmeDriver<T> { | |
|
||
let mut this = Self { | ||
device_id: device.id().to_owned(), | ||
controller_instance_id: saved_state.controller_instance_id.clone(), | ||
task: Some(TaskControl::new(DriverWorkerTask { | ||
device, | ||
driver: driver.clone(), | ||
|
@@ -739,6 +743,16 @@ impl<T: DeviceBacking> NvmeDriver<T> { | |
pub fn update_servicing_flags(&mut self, nvme_keepalive: bool) { | ||
self.nvme_keepalive = nvme_keepalive; | ||
} | ||
|
||
/// Get the controller instance ID, if set. | ||
pub fn controller_instance_id(&self) -> Option<String> { | ||
self.controller_instance_id.clone() | ||
} | ||
|
||
/// Set the controller instance ID. | ||
pub fn set_controller_instance_id(&mut self, controller_instance_id: String) { | ||
self.controller_instance_id = Some(controller_instance_id); | ||
} | ||
} | ||
|
||
async fn handle_asynchronous_events( | ||
|
@@ -1051,6 +1065,9 @@ pub mod save_restore { | |
/// NVMe driver worker task data. | ||
#[mesh(4)] | ||
pub worker_data: NvmeDriverWorkerSavedState, | ||
/// Controller instance ID. | ||
#[mesh(5)] | ||
pub controller_instance_id: Option<String>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we need to save this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't have this, where does it get set back to its value when we do a restore, since we do not call |
||
} | ||
|
||
/// Save/restore state for NVMe driver worker task. | ||
|
Uh oh!
There was an error while loading. Please reload this page.