From 74261b249f232802a2277340e51be8b8ac6c4cb9 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Thu, 4 Sep 2025 14:38:40 +0200 Subject: [PATCH] qemu: Always fetch disabled features in qemuMonitorJSONGetGuestCPU MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/qemu/qemu_monitor.c | 3 +-- src/qemu/qemu_monitor_json.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) 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; } -- 2.47.3