diff --git a/qubesadmin/tests/app.py b/qubesadmin/tests/app.py index 74f9226..21c5bd7 100644 --- a/qubesadmin/tests/app.py +++ b/qubesadmin/tests/app.py @@ -179,7 +179,7 @@ class TC_10_QubesBase(qubesadmin.tests.QubesTestCase): 'memory': 'default=False type=int 400', 'kernel': 'default=False type=str 4.9.31', 'netvm': 'default=False type=vm test-net', - 'hvm': 'default=False type=bool True', + 'virt_mode': 'default=False type=str hvm', 'default_user': 'default=True type=str user', } self.app.expected_calls[ diff --git a/qubesadmin/tests/backup/__init__.py b/qubesadmin/tests/backup/__init__.py index 34a8a25..bdeb1f3 100644 --- a/qubesadmin/tests/backup/__init__.py +++ b/qubesadmin/tests/backup/__init__.py @@ -119,7 +119,7 @@ class BackupTestCase(qubesadmin.tests.QubesTestCase): testvm2 = self.app.add_new_vm('StandaloneVM', name=vmname, label='red') - testvm2.hvm = True + testvm2.virt_mode = 'hvm' testvm2.create_on_disk(pool=pool) self.fill_image(testvm2.storage.export('root'), 1024 * 1024 * 1024, \ True) diff --git a/qubesadmin/tests/backup/backupcompatibility.py b/qubesadmin/tests/backup/backupcompatibility.py index 7759108..b6e0d02 100644 --- a/qubesadmin/tests/backup/backupcompatibility.py +++ b/qubesadmin/tests/backup/backupcompatibility.py @@ -467,7 +467,7 @@ parsed_qubes_xml_v4 = { 'klass': 'AppVM', 'label': 'red', 'properties': { - 'hvm': 'False', + 'virt_mode': 'hvm', 'kernelopts': 'nopat i8042.nokbd i8042.noaux', 'maxmem': '300', 'memory': '300', @@ -547,7 +547,7 @@ parsed_qubes_xml_v4 = { 'vault': { 'klass': 'AppVM', 'label': 'black', - 'properties': {'hvm': 'False', 'maxmem': '1536', 'netvm': None}, + 'properties': {'virt_mode': 'pv', 'maxmem': '1536', 'netvm': None}, 'devices': {}, 'tags': set(), 'features': {}, @@ -591,7 +591,7 @@ parsed_qubes_xml_v4 = { 'klass': 'AppVM', 'label': 'red', 'properties': { - 'hvm': 'False', + 'virt_mode': 'pv', 'autostart': 'True', 'maxmem': '400', 'provides_network': 'True', @@ -620,7 +620,7 @@ parsed_qubes_xml_v4 = { 'test-hvm': { 'klass': 'StandaloneVM', 'label': 'purple', - 'properties': {'hvm': 'True', 'maxmem': '4000'}, + 'properties': {'virt_mode': 'hvm', 'maxmem': '4000'}, 'devices': {}, 'tags': set(), 'features': {'service.meminfo-writer': False}, diff --git a/qubesadmin/tests/backup/v4-qubes.xml b/qubesadmin/tests/backup/v4-qubes.xml index f02c4ac..c273063 100644 --- a/qubesadmin/tests/backup/v4-qubes.xml +++ b/qubesadmin/tests/backup/v4-qubes.xml @@ -257,7 +257,7 @@ - True + hvm label-7 4000 test-hvm @@ -356,7 +356,7 @@ user - False + hvm label-1 300 300 @@ -420,7 +420,7 @@ True label-1 - False + pv 400 sys-usb 5 @@ -457,7 +457,7 @@ 13 d5284828-988d-46e2-8388-a09c495475e3 fedora-25 - False + pv 1536 diff --git a/qubesadmin/tests/tools/qvm_ls.py b/qubesadmin/tests/tools/qvm_ls.py index cd9bddb..b2bc27c 100644 --- a/qubesadmin/tests/tools/qvm_ls.py +++ b/qubesadmin/tests/tools/qvm_ls.py @@ -110,7 +110,7 @@ class TC_90_List_with_qubesd_calls(qubesadmin.tests.QubesTestCase): 'label': b'type=label green', 'template': b'type=vm template1', 'netvm': b'type=vm sys-net', -# 'hvm': b'type=bool False', +# 'virt_mode': b'type=str pv', } for key, value in props.items(): self.app.expected_calls[ diff --git a/qubesadmin/tests/tools/qvm_start_gui.py b/qubesadmin/tests/tools/qvm_start_gui.py index cc0d068..b20503d 100644 --- a/qubesadmin/tests/tools/qvm_start_gui.py +++ b/qubesadmin/tests/tools/qvm_start_gui.py @@ -156,8 +156,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase): ('test-vm', 'admin.vm.property.Get', 'xid', None)] = \ b'0\x00default=False type=int 3000' self.app.expected_calls[ - ('test-vm', 'admin.vm.property.Get', 'hvm', None)] = \ - b'0\x00default=False type=bool False' + ('test-vm', 'admin.vm.property.Get', 'virt_mode', None)] = \ + b'0\x00default=False type=str pv' self.app.expected_calls[ ('test-vm', 'admin.vm.feature.CheckWithTemplate', 'no-monitor-layout', None)] = \ @@ -190,8 +190,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase): ('test-vm', 'admin.vm.property.Get', 'stubdom_xid', None)] = \ b'0\x00default=False type=int 3001' self.app.expected_calls[ - ('test-vm', 'admin.vm.property.Get', 'hvm', None)] = \ - b'0\x00default=False type=bool True' + ('test-vm', 'admin.vm.property.Get', 'virt_mode', None)] = \ + b'0\x00default=False type=str hvm' self.app.expected_calls[ ('test-vm', 'admin.vm.property.Get', 'debug', None)] = \ b'0\x00default=False type=bool False' @@ -230,8 +230,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase): ('test-vm', 'admin.vm.property.Get', 'stubdom_xid', None)] = \ b'0\x00default=False type=int 3001' self.app.expected_calls[ - ('test-vm', 'admin.vm.property.Get', 'hvm', None)] = \ - b'0\x00default=False type=bool True' + ('test-vm', 'admin.vm.property.Get', 'virt_mode', None)] = \ + b'0\x00default=False type=str hvm' self.app.expected_calls[ ('test-vm', 'admin.vm.property.Get', 'debug', None)] = \ b'0\x00default=False type=bool False' @@ -310,8 +310,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase): 'no-monitor-layout', None)] = \ b'2\x00QubesFeatureNotFoundError\x00\x00Feature not set\x00' self.app.expected_calls[ - ('test-vm', 'admin.vm.property.Get', 'hvm', None)] = \ - b'0\x00default=False type=bool True' + ('test-vm', 'admin.vm.property.Get', 'virt_mode', None)] = \ + b'0\x00default=False type=str hvm' self.app.expected_calls[ ('test-vm', 'admin.vm.property.Get', 'xid', None)] = \ b'0\x00default=False type=int 3000' diff --git a/qubesadmin/tools/qvm_ls.py b/qubesadmin/tools/qvm_ls.py index acb074e..10c7570 100644 --- a/qubesadmin/tools/qvm_ls.py +++ b/qubesadmin/tools/qvm_ls.py @@ -229,7 +229,7 @@ class FlagsColumn(Column): ret = 'd' if ret is not None: - if getattr(vm, 'hvm', False): + if getattr(vm, 'virt_mode', 'pv') == 'hvm': return ret.upper() return ret diff --git a/qubesadmin/tools/qvm_start_gui.py b/qubesadmin/tools/qvm_start_gui.py index 6275bf3..411227f 100644 --- a/qubesadmin/tools/qvm_start_gui.py +++ b/qubesadmin/tools/qvm_start_gui.py @@ -187,7 +187,7 @@ class GUILauncher(object): guid_cmd = self.common_guid_args(vm) guid_cmd.extend(['-d', str(vm.xid)]) - if vm.hvm: + if vm.virt_mode == 'hvm': guid_cmd.extend(['-n']) if vm.features.check_with_template('rpc-clipboard', False): @@ -231,7 +231,7 @@ class GUILauncher(object): if not vm.features.check_with_template('gui', True): return - if vm.hvm: + if vm.virt_mode == 'hvm': if force_stubdom or not os.path.exists(self.guid_pidfile(vm.xid)): if not os.path.exists(self.guid_pidfile(vm.stubdom_xid)): yield from self.start_gui_for_stubdomain(vm) @@ -297,7 +297,7 @@ class GUILauncher(object): '''Handler of 'domain-spawn' event, starts GUI daemon for stubdomain''' if not vm.features.check_with_template('gui', True): return - if vm.hvm and kwargs.get('start_guid', 'True') == 'True': + if vm.virt_mode == 'hvm' and kwargs.get('start_guid', 'True') == 'True': asyncio.ensure_future(self.start_gui_for_stubdomain(vm)) def on_domain_start(self, vm, _event, **kwargs): @@ -325,7 +325,7 @@ class GUILauncher(object): elif power_state == 'Transient': # it is still starting, we'll get 'domain-start' event when # fully started - if vm.hvm: + if vm.virt_mode == 'hvm': asyncio.ensure_future(self.start_gui_for_stubdomain(vm)) def register_events(self, events):