backup: fix hadling netvm property
This commit is contained in:
parent
d72d8f8445
commit
412bcfa88b
@ -1851,8 +1851,11 @@ class BackupRestore(object):
|
|||||||
if not (netvm_name in restore_info.keys() and
|
if not (netvm_name in restore_info.keys() and
|
||||||
restore_info[netvm_name]['vm'].is_netvm()):
|
restore_info[netvm_name]['vm'].is_netvm()):
|
||||||
if self.options.use_default_netvm:
|
if self.options.use_default_netvm:
|
||||||
vm_info['netvm'] = self.app.default_netvm.name
|
if self.app.default_netvm:
|
||||||
vm_info['vm'].uses_default_netvm = True
|
vm_info['netvm'] = self.app.default_netvm.name
|
||||||
|
else:
|
||||||
|
vm_info['netvm'] = None
|
||||||
|
vm_info['vm'].netvm = qubes.property.DEFAULT
|
||||||
elif self.options.use_none_netvm:
|
elif self.options.use_none_netvm:
|
||||||
vm_info['netvm'] = None
|
vm_info['netvm'] = None
|
||||||
else:
|
else:
|
||||||
@ -2236,13 +2239,19 @@ class BackupRestore(object):
|
|||||||
# TODO: add a setting for this?
|
# TODO: add a setting for this?
|
||||||
if not vm.property_is_default('kernel') and \
|
if not vm.property_is_default('kernel') and \
|
||||||
vm.kernel not in \
|
vm.kernel not in \
|
||||||
os.listdir(qubes.config.system_path[
|
os.listdir(os.path.join(qubes.config.qubes_base_dir,
|
||||||
'qubes_kernels_base_dir']):
|
qubes.config.system_path[
|
||||||
self.log.warning("WARNING: Kernel %s not installed, "
|
'qubes_kernels_base_dir'])):
|
||||||
|
self.log.warning("Kernel %s not installed, "
|
||||||
"using default one" % vm.kernel)
|
"using default one" % vm.kernel)
|
||||||
vm.kernel = qubes.property.DEFAULT
|
vm.kernel = qubes.property.DEFAULT
|
||||||
try:
|
try:
|
||||||
new_vm.clone_properties(vm)
|
# exclude VM references - handled manually according to
|
||||||
|
# restore options
|
||||||
|
proplist = [prop for prop in new_vm.property_list()
|
||||||
|
if prop.clone and prop.__name__ not in
|
||||||
|
['template', 'netvm', 'dispvm_netvm']]
|
||||||
|
new_vm.clone_properties(vm, proplist=proplist)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.log.error("ERROR: {0}".format(err))
|
self.log.error("ERROR: {0}".format(err))
|
||||||
self.log.warning("*** Some VM property will not be "
|
self.log.warning("*** Some VM property will not be "
|
||||||
|
Loading…
Reference in New Issue
Block a user