Skip to main content

VM Management with Libvirt and Virsh

Qualcomm platforms use Libvirt and Virsh for guest VM lifecycle management. Domain XML files define the VM configuration and are passed to virsh to create, start, and manage VMs.

Setup Steps

1. Enable libvirt daemons

2. Switch firewall backend to nftables

The ip_tables module is incompatible with PREEMPT_RT (its dependency NETFILTER_XTABLES_LEGACY requires !PREEMPT_RT). Use nftables instead:

3. Ensure build includes iproute2 and act_csum.ko

  • Add iproute2 to the image recipe (provides the tc utility required by nftables)
  • Enable CONFIG_NET_ACT_CSUM=m in the kernel config (provides act_csum.ko)

4. Enable vhost-net in QEMU build

Add vhost to the QEMU PACKAGECONFIG in meta-qcom-distro/conf/distro/include/qcom-base.inc:

5. Start default network and define VMs


Known Issues and Resolutions

Cause: virtqemud and virtnetworkd daemons and sockets are not running.Resolution:
Cause: NETFILTER_XTABLES_LEGACY depends on !PREEMPT_RT, so ip_tables.ko cannot be built on the RT kernel.Resolution: Set the libvirt network firewall backend to nftables in /etc/libvirt/network.conf:
Cause: iproute2 (which provides tc) and act_csum.ko are not included in the build.Resolution: Add iproute2 to the image recipe and enable CONFIG_NET_ACT_CSUM=m in the kernel config.
Cause: The vhost PACKAGECONFIG option is not enabled for QEMU.Resolution: Add vhost to PACKAGECONFIG:append:pn-qemu in qcom-base.inc (see Setup Step 4 above).

Sample Domain XML Files

Two reference domain XML files are provided — one for the real-time guest VM and one for the non-RT housekeeping guest VM.

rt-vm.xml — Key Configuration

hk-vm.xml — Key Configuration


NIC & SR-IOV

Intel X550 kernel config and IOMMU-map setup

RT with KVM

Back to overview