Skip to content

Commit

Permalink
[qemu vm] added if empty check to pass unit tests and check the retur…
Browse files Browse the repository at this point in the history
…n boolean of wait_for_finished and log correspondingly.
  • Loading branch information
georgeliao committed Jun 26, 2024
1 parent 7fa6ef2 commit 60d1d97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/backends/qemu/qemu_virtual_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ void mp::QemuVirtualMachine::shutdown(const bool force)
mpl::log(mpl::Level::info, vm_name, "Killing process");
lock.unlock();
vm_process->kill();
vm_process->wait_for_finished(timeout);
if (vm_process != nullptr && !vm_process->wait_for_finished(timeout))
{
mpl::log(mpl::Level::error, vm_name, "Killing qemu process could not finish.");

Check warning on line 372 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#L372

Added line #L372 was not covered by tests
}
}
else
{
Expand Down

0 comments on commit 60d1d97

Please sign in to comment.