Re: [PATCH i-g-t 01/10] tools/vmtb: Update QEMU parameters

Bernatowicz, Marcin
2026-03-10T10:23:28Z

On 2/24/2026 8:50 AM, Adam Miszczak wrote:
> 1. Enable SSH access to VM/Guest OS
>
> Add QEMU options to open guest SSH connection:
> - enable default emulated NIC
> - redirect host's TCP port 10000+N connections to
> guest's SSH server on port 22
> (where N is booted VM number, starting from 0)
>
> For example, login to VM0 (from host) as:
> $ ssh -p 10000 gta@localhost
>
> 2. Enable migration based on VFIO driver
>
> Set 'enable-migration' option introducing QEMU VF migration support.
>
> VF migration is supported by a vendor specific VFIO driver (xe-vfio-pci).
> In case of regular 'vfio-pci', QEMU command option 'enable-migration'
> should not be explicitly enabled to prevent VM start failure:
> 'vfio 0000:00:02.1: VFIO migration is not supported in kernel'
>
> 3. Disable QEMU emulated VGA card
>
> Disable standard emulated VGA on QEMU VMs to avoid issues
> emerging from a bochs DRM driver.
> Standard VGA is enumerated as PCI device BDF 00:02.0
> on minor 0 (drm/card0) - this causes troubles with VirtualMachine class
> reserving card0 for passed VF.
> Also, bochs driver obscures guest dmesg with verbose debug logs.
>
> Signed-off-by: Adam Miszczak <adam.miszczak@linux.intel.com>
> ---
> tools/vmtb/bench/machines/virtual/vm.py | 14 ++++++++++----
> tools/vmtb/vmm_flows/conftest.py | 25 +++++++++++++++----------
> 2 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/tools/vmtb/bench/machines/virtual/vm.py b/tools/vmtb/bench/machines/virtual/vm.py
> index e75de590d..9f4ca1de7 100644
> --- a/tools/vmtb/bench/machines/virtual/vm.py
> +++ b/tools/vmtb/bench/machines/virtual/vm.py
> @@ -1,5 +1,5 @@
> # SPDX-License-Identifier: MIT
> -# Copyright © 2024 Intel Corporation
> +# Copyright © 2024-2026 Intel Corporation
>
> import base64
> import json
> @@ -58,7 +58,8 @@ class VirtualMachine(MachineInterface):
>
> return timeout_wrapper
>
> - def __init__(self, vm_number: int, backing_image: str, driver: str, igt_config: VmtbIgtConfig) -> None:
> + def __init__(self, vm_number: int, backing_image: str, driver: str,
> + igt_config: VmtbIgtConfig, vf_migration_support: bool) -> None:
> self.vf_bdf: typing.Optional[str] = None
> self.process: typing.Optional[subprocess.Popen] = None
> self.vmnum: int = vm_number
> @@ -68,6 +69,7 @@ class VirtualMachine(MachineInterface):
> self.qmp_sockpath = posixpath.join('/tmp', f'mon{self.vmnum}.sock')
> self.drm_driver_name: str = driver
> self.igt_config: VmtbIgtConfig = igt_config
> + self.vf_migration: bool = vf_migration_support
>
> if not posixpath.exists(backing_image):
> logger.error('No image for VM%s', self.vmnum)
> @@ -153,6 +155,9 @@ class VirtualMachine(MachineInterface):
> '-vnc', f':{self.vmnum}',
> '-serial', 'stdio',
> '-m', '4096',
> + '-vga', 'none',
> + '-net', 'nic',
> + '-net', f'user,hostfwd=tcp::{10000 + self.vmnum}-:22',
> '-drive', f'file={self.image if not self.migrate_destination_vm else self.migrate_source_image}',
> '-chardev', f'socket,path={self.questagent_sockpath},server=on,wait=off,id=qga{self.vmnum}',
> '-device', 'virtio-serial',
> @@ -161,8 +166,9 @@ class VirtualMachine(MachineInterface):
> '-mon', f'chardev=mon{self.vmnum},mode=control']
>
> if self.vf_bdf:
> - command.extend(['-enable-kvm', '-cpu', 'host'])
> - command.extend(['-device', f'vfio-pci,host={self.vf_bdf},enable-migration=on'])
> + command.extend(['-enable-kvm', '-cpu', 'host', '-device', f'vfio-pci,host={self.vf_bdf}'])
> + if self.vf_migration:
> + command[-1] += ',enable-migration=on'
>
> if self.migrate_destination_vm:
> # If VM is migration destination - run in stopped/prelaunch state (explicit resume required)
> diff --git a/tools/vmtb/vmm_flows/conftest.py b/tools/vmtb/vmm_flows/conftest.py
> index 7b6eacd51..675312253 100644
> --- a/tools/vmtb/vmm_flows/conftest.py
> +++ b/tools/vmtb/vmm_flows/conftest.py
> @@ -1,26 +1,25 @@
> # SPDX-License-Identifier: MIT
> -# Copyright © 2024 Intel Corporation
> +# Copyright © 2024-2026 Intel Corporation
>
> import json
> import logging
> import re
> import typing
> -
> from dataclasses import dataclass
> from pathlib import Path
>
> import pytest
>
> from bench import exceptions
> -from bench.helpers.helpers import (modprobe_driver, modprobe_driver_check)
> -from bench.helpers.log import HOST_DMESG_FILE
> -from bench.configurators.vgpu_profile_config import VgpuProfileConfigurator, VfSchedulingMode
> from bench.configurators.vgpu_profile import VgpuProfile
> +from bench.configurators.vgpu_profile_config import (VfSchedulingMode,
> + VgpuProfileConfigurator)
> from bench.configurators.vmtb_config import VmtbConfigurator
> -from bench.machines.host import Host, Device
> +from bench.helpers.helpers import modprobe_driver, modprobe_driver_check
> +from bench.helpers.log import HOST_DMESG_FILE
> +from bench.machines.host import Device, Host
> from bench.machines.virtual.vm import VirtualMachine
>
> -
> logger = logging.getLogger('Conftest')
>
>
> @@ -89,15 +88,20 @@ class VmmTestingSetup:
> self.host.load_drivers()
> self.host.discover_devices()
>
> + # VF migration requires vendor specific VFIO driver (e.g. xe-vfio-pci)
> + vf_migration_support: bool = self.host.is_driver_loaded(f'{self.host.drm_driver_name}-vfio-pci')
> +
> logger.info("\nDUT info:"
> "\n\tCard index: %s"
> "\n\tPCI BDF: %s "
> "\n\tDevice ID: %s (%s)"
> - "\n\tHost DRM driver: %s",
> + "\n\tHost DRM driver: %s"
> + "\n\tVF migration support: %s",
> self.host.dut_index,
> self.get_dut().pci_info.bdf,
> self.get_dut().pci_info.devid, self.get_dut().gpu_model,
> - self.get_dut().driver.get_name())
> + self.get_dut().driver.get_name(),
> + vf_migration_support)
>
> self.vgpu_profile: VgpuProfile = self.get_vgpu_profile()
>
> @@ -105,7 +109,8 @@ class VmmTestingSetup:
> self.vms: typing.List[VirtualMachine] = [
> VirtualMachine(vm_idx, self.guest_os_image,
> vmtb_config.get_guest_config().driver,
> - vmtb_config.get_guest_config().igt_config)
> + vmtb_config.get_guest_config().igt_config,
> + vf_migration_support)
> for vm_idx in range(min(self.vgpu_profile.num_vfs, self.testing_config.max_num_vms))]
LGTM,
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>
> def get_vgpu_profile(self) -> VgpuProfile: