backup: improve restoring HVMs from Qubes 3.2

Set kernel to '' - boot from VM's own bootloader.
Keep it on MiniOS-based stubdomain - otherwise Windows would not boot.
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-16 03:24:17 +02:00
parent d1eab2d4f5
commit 7a6e8d04b8
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 18 additions and 4 deletions

View File

@ -289,7 +289,15 @@ class Core2Qubes(qubesadmin.backup.BackupApp):
if value_is_default and value_is_default.lower() != \
"true":
vm.properties[attr] = value
vm.properties['virt_mode'] = 'hvm' if "HVm" in vm_class_name else 'pv'
if "HVm" in vm_class_name:
vm.properties['virt_mode'] = 'hvm'
vm.properties['kernel'] = ''
# Qubes 3.2 used MiniOS stubdomain (with qemu-traditional); keep
# it this way, otherwise some OSes (Windows) will crash because
# of substantial hardware change
vm.features['linux-stubdom'] = False
else:
vm.properties['virt_mode'] = 'pv'
if vm_class_name in ('QubesNetVm', 'QubesProxyVm'):
vm.properties['provides_network'] = True
if vm_class_name == 'QubesNetVm':

View File

@ -292,10 +292,12 @@ parsed_qubes_xml_r2 = {
'test-testhvm': {
'klass': 'StandaloneVM',
'label': 'purple',
'properties': {'virt_mode': 'hvm', 'memory': '512'},
'properties': {'kernel': '', 'virt_mode': 'hvm', 'memory': '512'},
'devices': {},
'tags': set(),
'features': {'service.meminfo-writer': False},
'features': {
'service.meminfo-writer': False,
'linux-stubdom': False},
'template': None,
'backup_path': 'appvms/test-testhvm',
'included_in_backup': True,
@ -620,7 +622,10 @@ parsed_qubes_xml_v4 = {
'test-hvm': {
'klass': 'StandaloneVM',
'label': 'purple',
'properties': {'virt_mode': 'hvm', 'maxmem': '4000'},
'properties': {
'kernel': None,
'virt_mode': 'hvm',
'maxmem': '4000'},
'devices': {},
'tags': set(),
'features': {'service.meminfo-writer': False},

View File

@ -262,6 +262,7 @@
<property name="maxmem">4000</property>
<property name="name">test-hvm</property>
<property name="qid">9</property>
<property name="kernel"></property>
<property name="uuid">9909066b-0f03-4725-ad9e-fa3561d5566e</property>
</properties>
<features>