mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Extract CPU affinity test logic from test_cpu_affinity into a standalone _test_cpu_affinity helper that accepts a Guest reference. The helper verifies the host has at least 4 CPUs, boots a VM with affinity settings, and asserts vcpu0 is pinned to cores 0,2 and vcpu1 to cores 1,3. Add default_cpus_with_affinity_string() to Guest and default_cpus_with_affinity() to GuestCommand in test_infra to generate CPU arguments with affinity configuration. Update the test_cpu_affinity call site in common_parallel to use GuestFactory and delegate to the new helper, enabling reuse with different guest types. Signed-off-by: Muminul Islam <muislam@microsoft.com>