The QEMU monitor commmand query-cpus is deprecated starting with QEMU 2.12.0 because it can adversely affect the performance of a running virtual machine. This series enables libvirt to use the new query-cpus-fast interface if supported by the local QEMU instance and is required in order to support QEMU once the interface has been removed. query-cpus-fast doesn't return the halted state for a virtual CPU, meaning that the vcpu.<n>.halted value won't be reported with 'virsh domstats' anymore. This is OK, as stats values are not guaranteed to be reported under all circumstances and on all architectures. Upstream discussion consensus was that the halted state was problematic anyway, as it had different semantics per architecture. The only known exploitation happened for s390, for this architecture the halted state will be computed based on an architecture-specific cpu value returned in query-cpus-fast. v1 -> v2: ========= Patch changes: 1/6: - add Acked-by: Peter Krempa 2/6: - evaluate capability outside of monitor code (changes signatures of qemuMonitorGetCPUInfo and qemuMonitorGetCpuHalted) - remove ternary expressions as requested by review - remove Reviewed-bys due to code changes 3/6 - adapt test cases to changes above - remove Reviewed-bys due to code changes 4/6 - replace callbacks for architecture data extraction with direct function calls - remove Reviewed-bys due to code changes Viktor Mihajlovski (6): qemu: add capability detection for query-cpus-fast qemu: use query-cpus-fast in JSON monitor tests: add qemumonitorjson tests for query-cpus-fast qemu: add architecture-specific CPU info handling tests: add testcase for s390 query-cpus-fast qemu: refresh vcpu halted state only via query-cpus-fast src/qemu/qemu_capabilities.c | 4 +- src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_domain.c | 21 +++- src/qemu/qemu_monitor.c | 30 +++-- src/qemu/qemu_monitor.h | 7 +- src/qemu/qemu_monitor_json.c | 116 +++++++++++++++++-- src/qemu/qemu_monitor_json.h | 3 +- .../qemumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 ++ .../qemumonitorjson-cpuinfo-s390-fast-cpus.json | 21 ++++ .../qemumonitorjson-cpuinfo-s390-fast-hotplug.json | 21 ++++ .../qemumonitorjson-cpuinfo-s390-fast.data | 19 ++++ ...emumonitorjson-cpuinfo-x86-basic-pluggable.data | 5 + ...qemumonitorjson-cpuinfo-x86-full-fast-cpus.json | 71 ++++++++++++ ...umonitorjson-cpuinfo-x86-full-fast-hotplug.json | 115 +++++++++++++++++++ .../qemumonitorjson-cpuinfo-x86-full-fast.data | 109 ++++++++++++++++++ .../qemumonitorjson-cpuinfo-x86-node-full.data | 2 + tests/qemumonitorjsontest.c | 123 ++++++++++++++++----- tests/qemumonitortestutils.c | 6 + tests/qemumonitortestutils.h | 1 + 19 files changed, 625 insertions(+), 58 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data -- 1.9.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list