From 6647b2e2664f1472d2e305d6519a711210533559 Mon Sep 17 00:00:00 2001 From: Kunhui-Li Date: Mon, 18 Apr 2022 14:18:44 +0800 Subject: [PATCH] config_tools: add virtio gpu Virtio gpu device UI will be implemented after 3.0. As a workaround, this patch simply adds the virtio gpu entry in schema and launch script generation logic. Tracked-On: #7301 Signed-off-by: Kunhui-Li Reviewed-by: Junjie Mao --- misc/config_tools/launch_config/launch_cfg_gen.py | 4 ++++ misc/config_tools/schema/config.xsd | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index 94bbb3eb0..b688b7473 100755 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -300,6 +300,10 @@ 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) + # Passthrough PCI devices bdf_regex = re.compile("([0-9a-f]{2}):([0-1][0-9a-f]).([0-7])") for passthru_device in eval_xpath_all(vm_scenario_etree, ".//pci_devs/*/text()"): diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index ecd105629..642dc516e 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -464,6 +464,12 @@ mouse, and tablet. It sends Linux input layer events over virtio.The virtio-blk device presents a block device to the VM. Each virtio-blk device appears as a disk inside the VM. + + + The virtio GPU device presents a GPU device to the VM. + This feature enables you to view the VM's GPU output in the Service VM. + +