diff --git a/dom0/qvm-tools/qvm-create b/dom0/qvm-tools/qvm-create index 1f8c47b1..d1c4b5ee 100755 --- a/dom0/qvm-tools/qvm-create +++ b/dom0/qvm-tools/qvm-create @@ -22,6 +22,7 @@ from qubes.qubes import QubesVmCollection from qubes.qubes import QubesVmLabels +from qubes.qubes import QubesException from optparse import OptionParser; import subprocess import re @@ -133,14 +134,18 @@ def main(): new_vm_template = template vm = None - if options.netvm: - vm = qvm_collection.add_new_netvm(vmname, new_vm_template, label = label) - elif options.proxyvm: - vm = qvm_collection.add_new_proxyvm(vmname, new_vm_template, label = label) - elif options.hvm: - vm = qvm_collection.add_new_hvm(vmname, label = label) - else: - vm = qvm_collection.add_new_appvm(vmname, new_vm_template, label = label) + try: + if options.netvm: + vm = qvm_collection.add_new_netvm(vmname, new_vm_template, label = label) + elif options.proxyvm: + vm = qvm_collection.add_new_proxyvm(vmname, new_vm_template, label = label) + elif options.hvm: + vm = qvm_collection.add_new_hvm(vmname, label = label) + else: + vm = qvm_collection.add_new_appvm(vmname, new_vm_template, label = label) + except QubesException as err: + print >> sys.stderr, "ERROR: {0}".format(err) + exit (1) if options.internal: vm.internal = True diff --git a/dom0/qvm-tools/qvm-prefs b/dom0/qvm-tools/qvm-prefs index d192f73f..2d690d30 100755 --- a/dom0/qvm-tools/qvm-prefs +++ b/dom0/qvm-tools/qvm-prefs @@ -375,7 +375,11 @@ def do_set(vms, vm, property, args): print >> sys.stderr, "ERROR: Property '{0}' not available for this VM".format(property) return False - return properties[property](vms, vm, args) + try: + return properties[property](vms, vm, args) + except Exception as err: + print >> sys.stderr, "ERROR: %s" % str(err) + return False def main():