Pcornel
Virtualization · KVM / QEMU

libvirt

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

Back to the Topic

Answer

Treat libvirt as desired/persistent domain configuration plus runtime orchestration over a hypervisor driver; persistent XML, live runtime state and the underlying QEMU process can differ.

Remember

  • libvirt ≠ hypervisor.
  • Persistent domain XML ≠ live domain configuration after runtime-only changes.
  • Domain Active ≠ guest/application healthy.
  • A libvirt API success may prove management action completion without proving the resulting workload outcome.

First checks

  • virsh uri — connection URI
  • virsh list --all — domains
  • virsh net-list --all; virsh pool-list --all — networks and pools

Commands

virsh

Verify in this order

client → libvirt → QEMU/KVM

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 → libvirt reference map

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → libvirt 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=3791

Confirmation

Confirm action

Continue?