]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: agent: Make fetching of 'can-offline' member from 'guest-query-vcpus' optional
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Mar 2023 15:51:42 +0000 (16:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 2 Mar 2023 08:23:33 +0000 (09:23 +0100)
The 'can-offline' member is optional according to agent's schema and in
fact in certain cases it's not returned. Libvirt then spams the logs
if something is polling the bulk guest stats API.

Noticed when going through oVirt logs which appears to call the bulk
stats API repeatedly.

Instead of requiring it we simply reply that the vCPU can't be offlined.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_agent.c

index f20bc4e6a75fd63434e69e4f82888115bc5135ee..b5aa518d559d3450129876316a2dd75f3edd94a2 100644 (file)
@@ -1366,12 +1366,8 @@ qemuAgentGetVCPUs(qemuAgent *agent,
             return -1;
         }
 
-        if (virJSONValueObjectGetBoolean(entry, "can-offline",
-                                         &in->offlinable) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("'can-offline' missing in reply of guest-get-vcpus"));
-            return -1;
-        }
+        in->offlinable = false;
+        ignore_value(virJSONValueObjectGetBoolean(entry, "can-offline", &in->offlinable));
     }
 
     return ndata;