Skip to content

Commit

Permalink
[qemu] Ignore suspend while stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Apr 15, 2024
1 parent 1e8d0e9 commit 6d6548e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/backends/qemu/qemu_virtual_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,10 @@ void mp::QemuVirtualMachine::suspend()
vm_process->wait_for_finished(timeout);
vm_process.reset(nullptr);
}
else if (state == State::off || state == State::suspended)
else if (state == State::off || state == State::stopped || state == State::suspended || state == State::stopping)

Check warning on line 408 in src/platform/backends/qemu/qemu_virtual_machine.cpp

View check run for this annotation

Codecov / codecov/patch

src/platform/backends/qemu/qemu_virtual_machine.cpp#L408

Added line #L408 was not covered by tests
{
mpl::log(mpl::Level::info, vm_name, fmt::format("Ignoring suspend issued while stopped/suspended"));
// TODO@no-merge use an util to get string from state enum (reuse where needed, e.g. CLI format utils)
mpl::log(mpl::Level::info, vm_name, fmt::format("Ignoring suspend issued while stopped/stopping/suspended"));

Check warning on line 411 in src/platform/backends/qemu/qemu_virtual_machine.cpp

View check run for this annotation

Codecov / codecov/patch

src/platform/backends/qemu/qemu_virtual_machine.cpp#L411

Added line #L411 was not covered by tests
monitor->on_suspend();
}
}
Expand Down

0 comments on commit 6d6548e

Please sign in to comment.