diff --git a/qubes/backup.py b/qubes/backup.py index 1109aa41..aeda2dde 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -2100,11 +2100,10 @@ class BackupRestore(object): "updbl": {"func": "'Yes' if vm.updateable else ''"}, - "template": {"func": "'n/a' if not hasattr(vm, 'template') is None " + "template": {"func": "'n/a' if not hasattr(vm, 'template') " "else vm_info.template"}, - "netvm": {"func": "'n/a' if vm.provides_network else\ - ('*' if vm.property_is_default('netvm') else '') +\ + "netvm": {"func": "('*' if vm.property_is_default('netvm') else '') +\ vm_info.netvm if vm_info.netvm is not None " "else '-'"}, @@ -2409,8 +2408,9 @@ class BackupRestore(object): try: # first only minimal set, later clone_properties # will be called + cls = self.app.get_vm_class(vm.__class__.__name__) new_vm = self.app.add_new_vm( - vm.__class__, + cls, name=vm_name, label=vm.label, installed_by_rpm=False, diff --git a/qubes/core2migration.py b/qubes/core2migration.py index bea22ac7..8ddd943d 100644 --- a/qubes/core2migration.py +++ b/qubes/core2migration.py @@ -180,6 +180,10 @@ class Core2Qubes(qubes.Qubes): "true": kwargs[attr] = value kwargs['hvm'] = "HVm" in vm_class_name + kwargs['provides_network'] = \ + vm_class_name in ('QubesNetVm', 'QubesProxyVm') + if vm_class_name == 'QubesNetVm': + kwargs['netvm'] = None vm = self.add_new_vm(vm_class, qid=int(element.get('qid')), **kwargs) services = element.get('services')