Skip to content

Commit

Permalink
[qemu] localized force_shutdown true value setting so it can pair up …
Browse files Browse the repository at this point in the history
…with the false value resetting.
  • Loading branch information
georgeliao committed Sep 17, 2024
1 parent 91bad1e commit 21b00b8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/platform/backends/qemu/qemu_virtual_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ void mp::QemuVirtualMachine::shutdown(ShutdownPolicy shutdown_policy)
{
std::unique_lock<std::mutex> lock{state_mutex};

force_shutdown = (shutdown_policy == ShutdownPolicy::Poweroff);

try
{
check_state_for_shutdown(shutdown_policy);
Expand All @@ -368,6 +366,7 @@ void mp::QemuVirtualMachine::shutdown(ShutdownPolicy shutdown_policy)
if (vm_process)
{
mpl::log(mpl::Level::info, vm_name, "Killing process");
force_shutdown = (shutdown_policy == ShutdownPolicy::Poweroff);
lock.unlock();
vm_process->kill();
if (vm_process != nullptr && !vm_process->wait_for_finished(kill_process_timeout))
Expand Down

0 comments on commit 21b00b8

Please sign in to comment.