src/qemu/qemu_capabilities.c | 71 +++++++++++++++++++++++++++++++----- src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_command.c | 4 +- src/qemu/qemu_monitor.c | 9 +++-- src/qemu/qemu_monitor.h | 8 ++-- src/qemu/qemu_monitor_json.c | 13 ++++--- src/qemu/qemu_monitor_json.h | 10 ++--- 8 files changed, 88 insertions(+), 30 deletions(-)
"[PATCH v3 00/26] Implementing a MSHV (Microsoft Hypervisor) accelerator" patchset in qemu-devel mailing list introduces MSHV support within Qemu. With above patchset, Qemu guests can be started with `-accel mshv` option to use Microsoft Hypervisor (/dev/mshv) as the hypervisor. Retaining Libvirt's naming convention, this translates to `hyperv` domains. Below is an excerpt of the xml to use with this patcset: ``` <domain type='hyperv'> <name>qemu_msh_testv</name> <cpu mode='host-model'/> <os> <type machine='q35'>hvm</type> </os> ... ``` This patch set introduces the necessary changes within libvirt to support Qemu guest with hyperv (mshv) hypervisor. Known issue: ``` abs_builddir=/home/user/QEMU_MSHV/libvirt/build/tests abs_top_srcdir=/home/user/QEMU_MSHV/libvirt LD_LIBRARY_PATH=/home/user/QEMU_MSHV/libvirt/build/tests:/home/user/QEMU_MSHV/libvirt/build/src abs_srcdir=/home/user/QEMU_MSHV/libvirt/tests VIR_TEST_EXPENSIVE=0 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 LC_ALL=C LIBVIRT_AUTOSTART=0 G_DEBUG=fatal-warnings MALLOC_PERTURB_=255 abs_top_builddir=/home/user/QEMU_MSHV/libvirt/build /home/user/QEMU_MSHV/libvirt/build/tests/qemucapabilitiestest TEST: qemucapabilitiestest wrong expected command in /home/user/QEMU_MSHV/libvirt/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies:23538: : {"execute":"query-mshv","id":"libvirt-6"} expected {"execute":"qom-list-types","id":"libvirt-6"} ``` Could someone point me to the steps to regenerate the replies files to fix above issue? Praveen K Paladugu (4): qemu: introduce mshv capabilities qemu: probe mshv capabilities qemu: use mshv accel for hyperv domains qemu_cgroup: add /dev/mshv to default devices src/qemu/qemu_capabilities.c | 71 +++++++++++++++++++++++++++++++----- src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_command.c | 4 +- src/qemu/qemu_monitor.c | 9 +++-- src/qemu/qemu_monitor.h | 8 ++-- src/qemu/qemu_monitor_json.c | 13 ++++--- src/qemu/qemu_monitor_json.h | 10 ++--- 8 files changed, 88 insertions(+), 30 deletions(-) -- 2.50.1
On Thu, Aug 07, 2025 at 15:48:39 -0500, Praveen K Paladugu wrote: > "[PATCH v3 00/26] Implementing a MSHV (Microsoft Hypervisor) accelerator" [...] > Known issue: > > ``` > abs_builddir=/home/user/QEMU_MSHV/libvirt/build/tests abs_top_srcdir=/home/user/QEMU_MSHV/libvirt LD_LIBRARY_PATH=/home/user/QEMU_MSHV/libvirt/build/tests:/home/user/QEMU_MSHV/libvirt/build/src abs_srcdir=/home/user/QEMU_MSHV/libvirt/tests VIR_TEST_EXPENSIVE=0 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 LC_ALL=C LIBVIRT_AUTOSTART=0 G_DEBUG=fatal-warnings MALLOC_PERTURB_=255 abs_top_builddir=/home/user/QEMU_MSHV/libvirt/build /home/user/QEMU_MSHV/libvirt/build/tests/qemucapabilitiestest > TEST: qemucapabilitiestest > > wrong expected command in /home/user/QEMU_MSHV/libvirt/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies:23538: : {"execute":"query-mshv","id":"libvirt-6"} expected {"execute":"qom-list-types","id":"libvirt-6"} > ``` > Could someone point me to the steps to regenerate the replies files to fix above > issue? There are two possibilities how to approach this. First one is that you move this probe slightly further which will allow you to probe available commands first. You then can avoid the probe in cases when qemu doesn't yet support that command preventing you from the need to modify the old replies files. The test files can't really be re-generated as in some cases the old qemu versions no longer compile and parts of the file depend on the host setup. Nevertheless, we do have a tool to programatically modify those. The scripts/qemu-replies-tool.py has provisions which allow you to write code to add/remove sections in the .replies files. look for the 'modify_replies' method which already has an example adding some device data based on the version of qemu. You modify that code to put the json at the appropriate place and then either re-run the testsuite with VIR_TEST_REGENERATE_OUTPUT or run the tool with: ./scripts/qemu-replies-tool.py --regenerate --repliesdir tests/qemucapabilitiesdata/ Beware that you must run it exactly once, and then commit the changes and disable the modification code again, otherwise it'll likely try to re-add the stuff.
On Wed, Aug 20, 2025 at 14:24:19 +0200, Peter Krempa via Devel wrote: > On Thu, Aug 07, 2025 at 15:48:39 -0500, Praveen K Paladugu wrote: > > "[PATCH v3 00/26] Implementing a MSHV (Microsoft Hypervisor) accelerator" > > [...] > > > Known issue: > > > > ``` > > abs_builddir=/home/user/QEMU_MSHV/libvirt/build/tests abs_top_srcdir=/home/user/QEMU_MSHV/libvirt LD_LIBRARY_PATH=/home/user/QEMU_MSHV/libvirt/build/tests:/home/user/QEMU_MSHV/libvirt/build/src abs_srcdir=/home/user/QEMU_MSHV/libvirt/tests VIR_TEST_EXPENSIVE=0 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 LC_ALL=C LIBVIRT_AUTOSTART=0 G_DEBUG=fatal-warnings MALLOC_PERTURB_=255 abs_top_builddir=/home/user/QEMU_MSHV/libvirt/build /home/user/QEMU_MSHV/libvirt/build/tests/qemucapabilitiestest > > TEST: qemucapabilitiestest > > > > wrong expected command in /home/user/QEMU_MSHV/libvirt/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies:23538: : {"execute":"query-mshv","id":"libvirt-6"} expected {"execute":"qom-list-types","id":"libvirt-6"} > > ``` > > Could someone point me to the steps to regenerate the replies files to fix above > > issue? > > There are two possibilities how to approach this. > > First one is that you move this probe slightly further which will allow > you to probe available commands first. You then can avoid the probe in > cases when qemu doesn't yet support that command preventing you from the > need to modify the old replies files. > > The test files can't really be re-generated as in some cases the old > qemu versions no longer compile and parts of the file depend on the host > setup. > > Nevertheless, we do have a tool to programatically modify those. > The scripts/qemu-replies-tool.py has provisions which allow you to write > code to add/remove sections in the .replies files. look for the > 'modify_replies' method which already has an example adding some device > data based on the version of qemu. You modify that code to put the json > at the appropriate place and then either re-run the testsuite with > VIR_TEST_REGENERATE_OUTPUT or run the tool with: > > ./scripts/qemu-replies-tool.py --regenerate --repliesdir > tests/qemucapabilitiesdata/ > > > Beware that you must run it exactly once, and then commit the changes > and disable the modification code again, otherwise it'll likely try to > re-add the stuff. One more detail. You'll likely want to also add capabilities captured on an MSHV-enabled machine to see that the probing works. To do that you'll have to add a 'variant' of the capability dump. See tests/qemucapabilitiesdata/README.rst on how to do that.
© 2016 - 2025 Red Hat, Inc.