render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
acda74
From 0173f19a17ac694fee1e2c0bbb4b89ba0ff85920 Mon Sep 17 00:00:00 2001
acda74
Message-Id: <0173f19a17ac694fee1e2c0bbb4b89ba0ff85920@dist-git>
acda74
From: Peter Krempa <pkrempa@redhat.com>
acda74
Date: Wed, 1 Mar 2023 16:51:42 +0100
acda74
Subject: [PATCH] qemu: agent: Make fetching of 'can-offline' member from
acda74
 'guest-query-vcpus' optional
acda74
acda74
The 'can-offline' member is optional according to agent's schema and in
acda74
fact in certain cases it's not returned. Libvirt then spams the logs
acda74
if something is polling the bulk guest stats API.
acda74
acda74
Noticed when going through oVirt logs which appears to call the bulk
acda74
stats API repeatedly.
acda74
acda74
Instead of requiring it we simply reply that the vCPU can't be offlined.
acda74
acda74
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
acda74
Reviewed-by: Laine Stump <laine@redhat.com>
acda74
(cherry picked from commit 790ea58153b9ef1120a577d1a87a4ca2e988ee5c)
acda74
https://bugzilla.redhat.com/show_bug.cgi?id=2174446
acda74
---
acda74
 src/qemu/qemu_agent.c | 8 ++------
acda74
 1 file changed, 2 insertions(+), 6 deletions(-)
acda74
acda74
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
acda74
index fa2c0bf915..72898d3fae 100644
acda74
--- a/src/qemu/qemu_agent.c
acda74
+++ b/src/qemu/qemu_agent.c
acda74
@@ -1366,12 +1366,8 @@ qemuAgentGetVCPUs(qemuAgent *agent,
acda74
             return -1;
acda74
         }
acda74
 
acda74
-        if (virJSONValueObjectGetBoolean(entry, "can-offline",
acda74
-                                         &in->offlinable) < 0) {
acda74
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
acda74
-                           _("'can-offline' missing in reply of guest-get-vcpus"));
acda74
-            return -1;
acda74
-        }
acda74
+        in->offlinable = false;
acda74
+        ignore_value(virJSONValueObjectGetBoolean(entry, "can-offline", &in->offlinable));
acda74
     }
acda74
 
acda74
     return ndata;
acda74
-- 
acda74
2.39.2
acda74