create: skip continue-install restart if user destroys VM

Commit 159e4af1 fixed a case where VM was started if user destroyed VM
while installing it.  This moves the code before we check whether we
need to restart the VM in order to continue in installation (windows
requires that).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1235238

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-05-13 17:28:03 +02:00
parent 3bbf0aad85
commit f628c3e266

View File

@ -2326,6 +2326,11 @@ class vmmCreate(vmmGObjectUI):
if not vm.is_shutoff():
return
if vm.get_install_abort():
logging.debug("User manually shutdown VM, not restarting "
"guest after install.")
return True
try:
if virtinst_guest:
continue_inst = virtinst_guest.get_continue_inst()
@ -2341,11 +2346,6 @@ class vmmCreate(vmmGObjectUI):
self._check_install_status, None)
return True
if vm.get_install_abort():
logging.debug("User manually shutdown VM, not restarting "
"guest after install.")
return True
logging.debug("Install should be completed, starting VM.")
vm.startup()
except Exception, e: