]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Always fetch disabled features in qemuMonitorJSONGetGuestCPU
authorJiri Denemark <jdenemar@redhat.com>
Thu, 4 Sep 2025 12:38:40 +0000 (14:38 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 8 Sep 2025 13:32:48 +0000 (15:32 +0200)
The function is always called with both enabled and disabled pointers
set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c

index eec6905e9fb1dc41c9fb1f26ac1d737cd16648a9..2fc883e8a632f478b5dd94069a9746e6bb16a9dd 100644 (file)
@@ -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);
index 1a75c935cb75bb9c23cc14410611d43fe2b0ddae..d6c5c26280ef1bc1089904bd9f108d1dbfc19191 100644 (file)
@@ -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;
 }