Merge branch 'master' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core

This commit is contained in:
Joanna Rutkowska 2011-09-13 19:22:16 +02:00
commit d5576ce77f
3 changed files with 21 additions and 12 deletions

View File

@ -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:

View File

@ -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

View File

@ -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