diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index 7c4668013..05ed0a396 100755 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -373,9 +373,19 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id script.add_virtual_device("virtio-blk", options=os.path.join(f"${{{var}}}", rootfs_img)) script.add_deinit_command(f"unmount_partition ${{{var}}}") - for virtio_gpu in eval_xpath_all(vm_scenario_etree, ".//virtio_devices/gpu[text() != '']/text()"): - if virtio_gpu is not None: - script.add_virtual_device("virtio-gpu", options=virtio_gpu) + for gpu_etree in eval_xpath_all(vm_scenario_etree, ".//virtio_devices/gpu"): + display_type = eval_xpath(gpu_etree, "./display_type[text() != '']/text()") + params = list() + for display_etree in eval_xpath_all(gpu_etree, "./displays/display"): + if display_type == "Window": + window_resolutions = eval_xpath(display_etree, "./window_resolutions/text()") + horizontal_offset = eval_xpath(display_etree, "./horizontal_offset/text()") + vertical_offset = eval_xpath(display_etree, "./vertical_offset/text()") + params.append(f"geometry={window_resolutions}+{horizontal_offset}+{vertical_offset}") + if display_type == "Full screen": + monitor_id = eval_xpath(display_etree, "./monitor_id/text()") + params.append(f"geometry=fullscreen:{monitor_id}") + script.add_virtual_device("virtio-gpu", options=",".join(params)) for vsock in eval_xpath_all(vm_scenario_etree, ".//virtio_devices/vsock[text() != '']/text()"): script.add_virtual_device("vhost-vsock", options="cid="+vsock)