Pinning and setting real-time priority for the VCPUs of a VM on KVM

this is just a memory note, do not expect explanations.

With the VM off, dump its config:

# virsh dumpxml f31-x64-inheritance > inheritance

Then, bellow:

<vcpu placement="static">4</vcpu>

add these parameters to set the priority FIFO 1, and pin one vCPU to one CPU:

  <cputune>
    <vcpusched vcpus='0-3' scheduler='fifo' priority='1'/>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='6'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>

and reload the config:

# virsh define inheritance