From 790ea58153b9ef1120a577d1a87a4ca2e988ee5c Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 1 Mar 2023 16:51:42 +0100 Subject: [PATCH] qemu: agent: Make fetching of 'can-offline' member from 'guest-query-vcpus' optional 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 Reviewed-by: Laine Stump --- src/qemu/qemu_agent.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index f20bc4e6a7..b5aa518d55 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -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; -- 2.47.2