Pcornel
Virtualization · KVM / QEMU

PCI Passthrough

Cheat sheet · https://pcornel.dk/topic.php?topic=3801

Back to the Topic

Answer

Safe assignment requires firmware/IOMMU support, viable isolation groups, host driver detachment, VFIO ownership, QEMU device assignment and a working guest driver.

Remember

  • IOMMU enabled ≠ device isolated safely.
  • Device bound to VFIO ≠ guest successfully owns it.
  • Guest device visible ≠ workload uses it correctly.
  • Passthrough can restrict migration, snapshots or reset behavior depending on device support.

First checks

  • virsh nodedev-list --cap pci — PCI devices
  • virsh nodedev-detach pci_0000_01_00_0 — detach to vfio
  • virsh dumpxml <vm> | grep -A5 hostdev — assigned

Verify in this order

host PCI device → vfio → QEMU → guest

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

KVM / QEMU → PCI Passthrough reference map

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → PCI Passthrough definition or configuration is presentConfigured state does not prove runtime behavior
RuntimeRelevant KVM/QEMU/libvirt object or process is active without matching errorsRuntime state does not prove dependencies or guest outcome
DependencyHost CPU/memory, storage, network or device backend required by this path is healthyLocal success does not prove the next boundary
AcceptanceOriginal guest/application test succeeds after the change or observationRequired for end-to-end closure

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3801

Confirmation

Confirm action

Continue?