In order to hopefully address [libvirt#147] at long last, I've picked up Roman's patches from 2018 and attempted to forward-port them. More specifically, I've used the [roolebo/hvf-domain] branch as a starting point, since it seems to contain a few improvements over [v2] and was just easier to pick up. The code is mostly his own, so I've retained the existing authorship information, but I've dropped Reviewed-by tags for commits that have been modified in non-trivial ways. I've applied very minimal style tweaks along the way, but overall I've tried to modify the existing patches as little as possible. The new test cases, such as they are, pass, and no regressions to KVM support appear to have been introduced in the process. I don't currently have access to a machine running macOS, so I can't verify that it's actually possible to start a hardware-accelerated VM by myself, but a couple of users have confirmed that the new feature works. Changes from [v6]: * addressed review comments; * moved virQEMUCapsAccelStr() and friends closer to the existing virQEMUCapsGetAccel() since they are very similar in purpose; * squashed my "fixup!" commits into the original ones now that they have been reviewed. Changes from [v5]: * rebased on top of master, dealing with a couple of straightforward merge conflicts in the process; * moved NEWS entry to the 8.1.0 section. Changes from [v4]: * fixed an issue that prevented machine types from being probed correctly, effectively making the entire thing non functional; * only report HVF support as available when the guest architecture and the host architecture match. Changes from [v3]: * reintroduced the patch that was missing in the initial version of the forward-port; * converted the documentation to reStructuredText and trimmed it significantly; * reworked virQEMUCapsAccelStr() based on Dan's suggestions; * reworked macOS support in the test suite based on Dan's suggestions; * fixed a few minor issues found while doing the above. Changes from [v2]: * rebased on top of master; * added a couple of simple test cases. Useful links: * GitLab: [abologna/hvf] * CI: [pipeline] [libvirt#147] https://gitlab.com/libvirt/libvirt/-/issues/147 [roolebo/hvf-domain] https://github.com/roolebo/libvirt/tree/hvf-domain [abologna/hvf] https://gitlab.com/abologna/libvirt/-/commits/hvf [pipeline] https://gitlab.com/abologna/libvirt/-/pipelines/453678312 [v6] https://listman.redhat.com/archives/libvir-list/2022-January/msg00685.html [v5] https://listman.redhat.com/archives/libvir-list/2022-January/msg00411.html [v4] https://listman.redhat.com/archives/libvir-list/2022-January/msg00280.html [v3] https://listman.redhat.com/archives/libvir-list/2022-January/msg00131.html [v2] https://listman.redhat.com/archives/libvir-list/2018-November/msg00802.html Andrea Bolognani (5): qemu: Only probe KVM on Linux tests: Introduce testQemuHostOS tests: Add macOS support to testutilsqemu tests: Add macOS support to qemuxml2*test tests: Add HVF test cases Roman Bolshakov (13): qemu: Add KVM CPUs into cache only if KVM is present conf: Add hvf domain type qemu: Define hvf capability qemu: Query hvf capability on macOS qemu: Expose hvf domain type if hvf is supported qemu: Introduce virQEMUCapsAccelStr qemu: Introduce virQEMUCapsTypeIsAccelerated qemu: Introduce virQEMUCapsHaveAccel qemu: Correct CPU capabilities probing for hvf docs: Add hvf on QEMU driver page docs: Note hvf support for domain elements docs: Add support page for libvirt on macOS news: Mention hvf domain type NEWS.rst | 5 + docs/docs.html.in | 3 + docs/drvqemu.rst | 48 +++++- docs/formatdomain.rst | 22 +-- docs/index.html.in | 4 +- docs/macos.rst | 44 ++++++ docs/meson.build | 1 + docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 146 ++++++++++++++++-- src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 4 + src/qemu/qemu_process.c | 10 +- .../hvf-aarch64-virt-headless.args | 48 ++++++ .../hvf-aarch64-virt-headless.xml | 45 ++++++ .../hvf-x86_64-q35-headless.args | 47 ++++++ .../hvf-x86_64-q35-headless.x86_64-latest.err | 1 + .../hvf-x86_64-q35-headless.xml | 44 ++++++ tests/qemuxml2argvtest.c | 43 +++++- .../hvf-aarch64-virt-headless.xml | 94 +++++++++++ .../hvf-x86_64-q35-headless.xml | 97 ++++++++++++ tests/qemuxml2xmltest.c | 43 +++++- tests/testutilsqemu.c | 146 ++++++++++++++---- tests/testutilsqemu.h | 10 ++ 25 files changed, 845 insertions(+), 64 deletions(-) create mode 100644 docs/macos.rst create mode 100644 tests/qemuxml2argvdata/hvf-aarch64-virt-headless.args create mode 100644 tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml create mode 100644 tests/qemuxml2argvdata/hvf-x86_64-q35-headless.args create mode 100644 tests/qemuxml2argvdata/hvf-x86_64-q35-headless.x86_64-latest.err create mode 100644 tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml create mode 100644 tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.xml create mode 100644 tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.xml -- 2.34.1