Two of the qemu kvm_features (kvm-poll-control and kvm-pv-ipi) were only
emitted when on or when off respectively, rather than handling the full
tri-state for each (on, off, absent). This meant that config like
<poll-control state='off'/> was a no-op, equivalent to not specifying
poll-control at all, which fails to prevent QEMU from enabling it based
on its own internal defaults.

In particular, this meant that having both <cpu mode='host-passthrough'>
and <poll-control state='off'/> would cause the latter to be ignored,
since libvirt would emit no explicit kvm-poll-control arg, and QEMU
defaults to enabling most KVM features when CPU passthrough is enabled.

Fix these two cases such that explicit on/off are both respected. The
`hidden` and `hint-dedicated` options are left as-is, since these really
do only make sense in the `on` direction; QEMU will never automatically
enable them.

Chris Riches (2):
  qemu: Emit explicit kvm-poll-control=off when disabled
  qemu: Emit explicit kvm-pv-ipi=on when enabled

 src/qemu/qemu_command.c                            | 14 ++++++++++----
 .../kvm-features-off.x86_64-latest.args            |  2 +-
 .../kvm-features.x86_64-latest.args                |  2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.43.0

Reply via email to