From: Jiri Denemark Date: Thu, 4 Sep 2025 12:38:40 +0000 (+0200) Subject: qemu: Always fetch disabled features in qemuMonitorJSONGetGuestCPU X-Git-Tag: v11.8.0-rc1~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74261b249f232802a2277340e51be8b8ac6c4cb9;p=thirdparty%2Flibvirt.git qemu: Always fetch disabled features in qemuMonitorJSONGetGuestCPU The function is always called with both enabled and disabled pointers set. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index eec6905e9f..2fc883e8a6 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3703,8 +3703,7 @@ qemuMonitorGetGuestCPU(qemuMonitor *mon, QEMU_CHECK_MONITOR(mon); *enabled = NULL; - if (disabled) - *disabled = NULL; + *disabled = NULL; return qemuMonitorJSONGetGuestCPU(mon, arch, qomListGet, cpuQOMPath, translate, enabled, disabled); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 1a75c935cb..d6c5c26280 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6783,13 +6783,11 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, translate) < 0) return -1; - if (disabled && - qemuMonitorJSONGetCPUDataDisabled(mon, cpuQOMPath, translate, cpuDisabled) < 0) + if (qemuMonitorJSONGetCPUDataDisabled(mon, cpuQOMPath, translate, cpuDisabled) < 0) return -1; *enabled = g_steal_pointer(&cpuEnabled); - if (disabled) - *disabled = g_steal_pointer(&cpuDisabled); + *disabled = g_steal_pointer(&cpuDisabled); return 0; }