On a Thursday in 2025, Jiri Denemark via Devel wrote:
>When a domain starts we need to check what CPU features were enabled and
>if any of the features we asked for were disabled. Currently this
>requires more than 470 QMP commands (and the number is growing everytime
>QEMU adds a new feature or other property to the CPU object). Thanks to
>a new qom-list-get QMP command introduced by QEMU 7.1 we can replace all
>those commands with just a single one.
>
>On my host using a minimal domain with no devices the startup time went
>down to about 200 ms from 400 ms before this series.
>
>Jiri Denemark (14):
> qemu: Drop legacy probing of CPU features
> tests: Add a test for qemuMonitorJSONGetGuestCPU
> tests: Test qemuMonitorJSONGetGuestCPU with empty unavailable-features
> qemu: Generalize filtering in qemuMonitorJSONParsePropsList
> qemu: Move feature filtering to qemuMonitorJSONGetCPUProperties
> qemu: Parse properties list from any JSON array
> qemu: Use qom-list-get for checking enabled CPU features
> tests: Test qemuMonitorJSONGetGuestCPU with qom-get-list
> qemu: Add qemuMonitorJSONCPUDataAddFeatures helper
> qemu: Merge qemuMonitorJSONGetCPUData in qemuMonitorJSONGetGuestCPU
> qemu: Always fetch disabled features in qemuMonitorJSONGetGuestCPU
> qemu: Merge qemuMonitorJSONGetCPUDataDisabled in
> qemuMonitorJSONGetGuestCPU
> qemu: Let qemuMonitorJSONGetCPUProperties also return disabled
> features
> qemu: Don't query unavailable-features if qom-list-get is supported
>
> src/qemu/qemu_capabilities.c | 2 +
> src/qemu/qemu_capabilities.h | 1 +
> src/qemu/qemu_monitor.c | 43 +-
> src/qemu/qemu_monitor.h | 6 +-
> src/qemu/qemu_monitor_json.c | 383 +-
> src/qemu/qemu_monitor_json.h | 7 +-
> src/qemu/qemu_process.c | 20 +-
> .../caps_10.1.0_x86_64.xml | 1 +
> .../caps_10.2.0_x86_64.xml | 1 +
> .../get-guest-cpu-SierraForest-disabled.xml | 7 +
> .../get-guest-cpu-SierraForest-enabled.xml | 9 +
> .../get-guest-cpu-SierraForest-legacy.json | 8680 +++++++++++++++++
> .../get-guest-cpu-SierraForest.json | 2962 ++++++
> .../get-guest-cpu-SkylakeClient-disabled.xml | 2 +
> ...> get-guest-cpu-SkylakeClient-enabled.xml} | 10 +-
> .../get-guest-cpu-SkylakeClient-legacy.json | 8671 ++++++++++++++++
> .../get-guest-cpu-SkylakeClient.json | 2953 ++++++
> .../qemumonitorjson-getcpu-ecx.json | 57 -
> .../qemumonitorjson-getcpu-full.data | 5 -
> .../qemumonitorjson-getcpu-full.json | 46 -
> .../qemumonitorjson-getcpu-host.data | 6 -
> .../qemumonitorjson-getcpu-host.json | 45 -
> tests/qemumonitorjsontest.c | 191 +-
> 23 files changed, 23532 insertions(+), 576 deletions(-)
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SierraForest-disabled.xml
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SierraForest-enabled.xml
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SierraForest-legacy.json
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SierraForest.json
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SkylakeClient-disabled.xml
> rename tests/qemumonitorjsondata/{qemumonitorjson-getcpu-ecx.data => get-guest-cpu-SkylakeClient-enabled.xml} (53%)
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SkylakeClient-legacy.json
> create mode 100644 tests/qemumonitorjsondata/get-guest-cpu-SkylakeClient.json
> delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-ecx.json
> delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data
> delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.json
> delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data
> delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.json
>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Jano