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 <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-01 16:51:42 +01:00
parent 3ba5974034
commit 790ea58153

View 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;