From 6d6548e99298744dba3780260d88af14383c689c Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Fri, 12 Apr 2024 19:31:02 +0100 Subject: [PATCH] [qemu] Ignore suspend while stopping --- src/platform/backends/qemu/qemu_virtual_machine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/backends/qemu/qemu_virtual_machine.cpp b/src/platform/backends/qemu/qemu_virtual_machine.cpp index 7d11abe658f..084a4d352ca 100644 --- a/src/platform/backends/qemu/qemu_virtual_machine.cpp +++ b/src/platform/backends/qemu/qemu_virtual_machine.cpp @@ -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) { - 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")); monitor->on_suspend(); } }