diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 96af11d5..78a97d45 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1628,6 +1628,9 @@ class QubesVm(object): if dry_run: return + if not self.is_running(): + raise QubesException ("VM already stopped!") + subprocess.call (['/usr/sbin/xl', 'shutdown', str(xid) if xid is not None else self.name]) #xc.domain_destroy(self.get_xid()) @@ -1635,6 +1638,9 @@ class QubesVm(object): if dry_run: return + if not self.is_running() and not self.is_paused(): + raise QubesException ("VM already stopped!") + subprocess.call (['/usr/sbin/xl', 'destroy', str(xid) if xid is not None else self.name]) def pause(self):