Skip to content
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

Use block_in_place for device pause/halt #725

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 10 additions & 6 deletions bin/propolis-server/src/lib/vm/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,11 @@ impl VmObjectsLocked {

/// Pauses all of a VM's devices.
async fn pause_devices(&self) {
self.for_each_device(|name, dev| {
info!(self.log, "sending pause request to {}", name);
dev.pause();
tokio::task::block_in_place(|| {
pfmooney marked this conversation as resolved.
Show resolved Hide resolved
self.for_each_device(|name, dev| {
info!(self.log, "sending pause request to {}", name);
dev.pause();
});
});

struct NamedFuture {
Expand Down Expand Up @@ -396,9 +398,11 @@ impl VmObjectsLocked {
/// Stops all of a VM's devices and detaches its block backends from their
/// devices.
async fn halt_devices(&self) {
self.for_each_device(|name, dev| {
info!(self.log, "sending halt request to {}", name);
dev.halt();
tokio::task::block_in_place(|| {
self.for_each_device(|name, dev| {
info!(self.log, "sending halt request to {}", name);
dev.halt();
});
});

for (name, backend) in self.block_backends.iter() {
Expand Down
Loading