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

Lock stopvm #246

Merged
merged 2 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vm-manager (1.0.2) stable; urgency=medium

* Bump version to 1.0.2

-- Qi, Yadong <yadong.qi@intel.com> Thu, 20 Oct 2022 15:36:28 +0800

vm-manager (1.0.1) stable; urgency=medium

* Bump version to 1.0.1
Expand Down
3 changes: 3 additions & 0 deletions src/guest/vm_builder_qemu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -879,12 +879,15 @@ void VmBuilderQemu::WaitVmExit() {
}

void VmBuilderQemu::StopVm() {
std::scoped_lock lock(stopvm_mutex_);

if (main_proc_)
main_proc_->Stop();

for (size_t i = 0; i < co_procs_.size(); ++i) {
co_procs_[i]->Stop();
}
co_procs_.clear();

VsockCidPool::Pool().ReleaseCid(vsock_cid_);

Expand Down
1 change: 1 addition & 0 deletions src/guest/vm_builder_qemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class VmBuilderQemu : public VmBuilder {
std::set<std::string> pci_pt_dev_set_;
boost::latch vm_ready_latch_;
std::queue<std::function<void(void)>> end_call_;
std::mutex stopvm_mutex_;
};

} // namespace vm_manager
Expand Down
2 changes: 1 addition & 1 deletion src/vm_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_MICRO 1
#define VERSION_MICRO 2

namespace vm_manager {

Expand Down