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

LibVirt machinery should create the KVM domain #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions lib/cuckoo/common/abstracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ def start(self, label):
self._disconnect(conn)
raise CuckooMachineError("No snapshot found for virtual machine "
"{0}".format(label))
# Attempt to boot the VM (create domain) if it's powered off
# This should address use of offline snapshots for fast clones/other uses.
if self._status(label) == self.POWEROFF:
try:
self.vms[label].create()
except libvirt.libvirtError:
raise CuckooMachineError("Unable to create domain for "
"virtual machine {0}".format(label))

# Check state.
self._wait_status(label, self.RUNNING)
Expand Down