core2migration: try to set properties to "default" when possible
Core3 keep information whether property have default value for all the properties (not only few like netvm or kernel). Try to use this feature as much as possible.
This commit is contained in:
parent
64ac7f6e8d
commit
36bd834c01
@ -162,12 +162,23 @@ class Core2Qubes(qubes.Qubes):
|
|||||||
'template_qid'))]
|
'template_qid'))]
|
||||||
vm_class = AppVM
|
vm_class = AppVM
|
||||||
# simple attributes
|
# simple attributes
|
||||||
for attr in ['installed_by_rpm', 'include_in_backups',
|
for attr, default in {
|
||||||
'qrexec_timeout', 'internal', 'label', 'name',
|
'installed_by_rpm': 'False',
|
||||||
'vcpus', 'memory', 'maxmem', 'default_user',
|
'include_in_backups': 'True',
|
||||||
'debug', 'pci_strictreset', 'mac', 'autostart']:
|
'qrexec_timeout': '60',
|
||||||
|
'internal': 'False',
|
||||||
|
'label': None,
|
||||||
|
'name': None,
|
||||||
|
'vcpus': '2',
|
||||||
|
'memory': '400',
|
||||||
|
'maxmem': '4000',
|
||||||
|
'default_user': 'user',
|
||||||
|
'debug': 'False',
|
||||||
|
'pci_strictreset': 'True',
|
||||||
|
'mac': None,
|
||||||
|
'autostart': 'False'}.items():
|
||||||
value = element.get(attr)
|
value = element.get(attr)
|
||||||
if value:
|
if value and value != default:
|
||||||
kwargs[attr] = value
|
kwargs[attr] = value
|
||||||
# attributes with default value
|
# attributes with default value
|
||||||
for attr in ["kernel", "kernelopts"]:
|
for attr in ["kernel", "kernelopts"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user