From: Peter Krempa Date: Wed, 1 Mar 2023 15:51:42 +0000 (+0100) Subject: qemu: agent: Make fetching of 'can-offline' member from 'guest-query-vcpus' optional X-Git-Tag: v9.2.0-rc1~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=790ea58153b9ef1120a577d1a87a4ca2e988ee5c;p=thirdparty%2Flibvirt.git 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 --- 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;