diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 402724b8..fbb0ec1f 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -502,10 +502,10 @@ class QubesVm(object): if dominfo: if dominfo['paused']: return "Paused" - elif dominfo['shutdown']: - return "Halted" elif dominfo['crashed']: return "Crashed" + elif dominfo['shutdown']: + return "Halting" elif dominfo['dying']: return "Dying" else: @@ -988,7 +988,8 @@ class QubesVm(object): if dry_run: return - if self.is_running(): + # Intentionally not used is_running(): eliminate also "Paused", "Crashed", "Halting" + if self.get_power_state() != "Halted": raise QubesException ("VM is already running!") if self.netvm_vm is not None: diff --git a/dom0/qvm-tools/qvm-backup b/dom0/qvm-tools/qvm-backup index 97b81555..cbf044ea 100755 --- a/dom0/qvm-tools/qvm-backup +++ b/dom0/qvm-tools/qvm-backup @@ -87,7 +87,7 @@ def main(): files_to_backup = file_to_backup (qubes_store_filename) - appvms_to_backup = [vm for vm in vms_list if vm.is_appvm() and not vm.name.endswith('-dvm')] + appvms_to_backup = [vm for vm in vms_list if vm.is_appvm() and not vm.internal] netvms_to_backup = [vm for vm in vms_list if vm.is_netvm() and not vm.qid == 0] there_are_running_vms = False diff --git a/dom0/qvm-tools/qvm-backup-restore b/dom0/qvm-tools/qvm-backup-restore index 3a81aeb7..9607070e 100755 --- a/dom0/qvm-tools/qvm-backup-restore +++ b/dom0/qvm-tools/qvm-backup-restore @@ -57,7 +57,8 @@ fields = { + ('}' if vm.is_netvm() else '')"}, "type": {"func": "'Tpl' if vm.is_template() else \ - (' Net' if vm.is_netvm() else 'App')"}, + ('Proxy' if vm.is_proxyvm() else \ + (' Net' if vm.is_netvm() else 'App'))"}, "updbl" : {"func": "'Yes' if vm.is_updateable() else ''"}, @@ -331,7 +332,7 @@ def main(): # ... then NetVMs... for vm in [ vm for vm in vms_to_restore if vm.is_netvm()]: - print "-> Restoring NetVM {0}...".format(vm.name) + print "-> Restoring {0} {1}...".format(vm.type, vm.name) retcode = subprocess.call (["mkdir", "-p", vm.dir_path]) if retcode != 0: print ("*** Cannot create directory: {0}?!".format(dest_dir)) @@ -354,11 +355,18 @@ def main(): updateable = vm.updateable try: - vm = host_collection.add_new_netvm(vm.name, template_vm, - conf_file=vm.conf_file, - dir_path=vm.dir_path, - updateable=updateable, - label=vm.label) + if vm.type == "NetVM": + vm = host_collection.add_new_netvm(vm.name, template_vm, + conf_file=vm.conf_file, + dir_path=vm.dir_path, + updateable=updateable, + label=vm.label) + elif vm.type == "ProxyVM": + vm = host_collection.add_new_proxyvm(vm.name, template_vm, + conf_file=vm.conf_file, + dir_path=vm.dir_path, + updateable=updateable, + label=vm.label) except Exception as err: print "ERROR: {0}".format(err) print "*** Skiping VM: {0}".format(vm.name) @@ -366,7 +374,7 @@ def main(): host_collection.pop(vm.qid) continue - if not uses_default_netvm: + if vm.is_proxyvm() and not uses_default_netvm: vm.uses_default_netvm = False vm.netvm_vm = netvm_vm