Delete AppVM after failed create only if it was (partially) created.

This commit is contained in:
Marek Marczykowski 2011-03-09 15:26:27 +01:00
parent c4cb54ab59
commit 161675cf6a

View File

@ -570,6 +570,7 @@ class VmManagerWindow(QMainWindow):
def do_create_appvm (self, vmname, label, template_vm, thread_monitor):
vm = None
try:
self.qvm_collection.lock_db_for_writing()
self.qvm_collection.load()
@ -580,6 +581,7 @@ class VmManagerWindow(QMainWindow):
self.qvm_collection.save()
except Exception as ex:
thread_monitor.set_error_msg (str(ex))
if vm:
vm.remove_from_disk()
finally:
self.qvm_collection.unlock_db()