tldr: Similarly to CPU host-model, let's have one for hyperv features. A lot of preparation work is done in patches 01-16. Actual feature is then implemented in patches 18-19. When testing the feature out, I got an error from QEMU because the new mode enabled hv-stimer but we did not have hv-time which is required. I wonder what other dependencies there are and whether we should implement the rest of enlightenments. Then, I'm not so sure about domcaps XML. I've invented '<defaults/>' element and put some child elements under it, e.g.: <hyperv supported='yes'> <enum name='features'/> <defaults> <spinlocks>4095</spinlocks> <stimer_direct>on</stimer_direct> <tlbflush_direct>on</tlbflush_direct> <tlbflush_extended>on</tlbflush_extended> <vendor_id>Linux KVM Hv</vendor_id> </defaults> </hyperv> Speak your mind if you have better idea, or even just dislike it. And finally, I went with 'host-model': <features> <hyperv mode='host-model'/> </features> because I wanted to keep it consisent with CPU: <cpu mode='host-model'/> but in the corresponding Jira ticket, somebody suggested mode='host'. I can argue both ways. Resolves: https://issues.redhat.com/browse/RHEL-114003 Michal Prívozník (20): virxml: Introduce virXPathTristateSwitch() virxml: Introduce virXPathTristateBool() qemu: Use virXPathTristateBool() domain_conf: Move format of hyperv features into a function domain_conf: Use virXMLFormatElement() to format hyperv features qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET() qemu_command: Move hyperv cmd line generation into a function qemu_command: Prefer virBufferAddLit() in qemuBuildCpuHypervCommandLine() libxl: Simplify setting HyperV features conf: More hyperv related members into a single struct docs: Drop remark on now unsupported version of QEMU conf: Report default hyperv values in domain capabilities qemu_capabilities: Format and parse new hyperv domcaps members qemu_capabilities: Fetch new hyperv domcaps hyperv: Support hv-time enlightenment NEWS: Document new hyperv enlightenment qemu_caps: Introduce virQEMUCapsGetHypervCapabilities() conf: Introduce hyperv host-model mode qemu_process: Populate hyperv features for host-model NEWS: Document new host-model hyperv mode NEWS.rst | 12 + docs/formatdomain.rst | 8 + docs/formatdomaincaps.rst | 9 +- src/conf/domain_capabilities.c | 61 ++++- src/conf/domain_capabilities.h | 11 + src/conf/domain_conf.c | 222 ++++++++++-------- src/conf/domain_conf.h | 17 +- src/conf/schemas/domaincaps.rng | 29 +++ src/conf/schemas/domaincommon.rng | 8 + src/conf/virconftypes.h | 2 + src/cpu/cpu_x86.c | 5 + src/cpu/cpu_x86_data.h | 1 + src/libvirt_private.syms | 4 + src/libxl/libxl_conf.c | 72 +++--- src/qemu/qemu_capabilities.c | 107 ++++++++- src/qemu/qemu_capabilities.h | 3 + src/qemu/qemu_command.c | 157 +++++++------ src/qemu/qemu_domain.c | 16 +- src/qemu/qemu_process.c | 62 ++++- src/util/virxml.c | 68 ++++++ src/util/virxml.h | 10 + .../qemu_10.0.0-q35.x86_64+amdsev.xml | 8 + .../domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 8 + .../qemu_10.0.0-tcg.x86_64+amdsev.xml | 8 + .../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 8 + .../qemu_10.0.0.x86_64+amdsev.xml | 8 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 8 + .../qemu_10.1.0-q35.x86_64+inteltdx.xml | 8 + .../domaincapsdata/qemu_10.1.0-q35.x86_64.xml | 8 + .../qemu_10.1.0-tcg.x86_64+inteltdx.xml | 8 + .../domaincapsdata/qemu_10.1.0-tcg.x86_64.xml | 8 + .../qemu_10.1.0.x86_64+inteltdx.xml | 8 + tests/domaincapsdata/qemu_10.1.0.x86_64.xml | 8 + .../domaincapsdata/qemu_10.2.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_10.2.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_10.2.0.x86_64.xml | 8 + .../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 8 + .../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 8 + .../domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 8 + .../domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 8 + .../domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 8 + .../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 8 + tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 8 + .../qemu_9.2.0-q35.x86_64+amdsev.xml | 8 + .../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 8 + .../qemu_9.2.0-tcg.x86_64+amdsev.xml | 8 + .../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 8 + .../qemu_9.2.0.x86_64+amdsev.xml | 8 + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 8 + .../caps_10.0.0_x86_64+amdsev.xml | 6 + .../caps_10.0.0_x86_64.xml | 6 + .../caps_10.1.0_x86_64+inteltdx.xml | 6 + .../caps_10.1.0_x86_64.xml | 6 + .../caps_10.2.0_x86_64.xml | 6 + .../caps_8.0.0_x86_64.xml | 6 + .../caps_8.1.0_x86_64.xml | 6 + .../caps_8.2.0_x86_64.xml | 6 + .../caps_9.0.0_x86_64.xml | 6 + .../caps_9.1.0_x86_64.xml | 6 + .../caps_9.2.0_x86_64+amdsev.xml | 6 + .../caps_9.2.0_x86_64.xml | 6 + .../hyperv-host-model.x86_64-latest.args | 32 +++ .../hyperv-host-model.x86_64-latest.xml | 33 +++ tests/qemuxmlconfdata/hyperv-host-model.xml | 27 +++ .../hyperv-passthrough.x86_64-latest.xml | 3 +- .../qemuxmlconfdata/hyperv.x86_64-latest.args | 2 +- .../qemuxmlconfdata/hyperv.x86_64-latest.xml | 1 + tests/qemuxmlconfdata/hyperv.xml | 1 + tests/qemuxmlconftest.c | 1 + 77 files changed, 1099 insertions(+), 245 deletions(-) create mode 100644 tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/hyperv-host-model.xml -- 2.49.1