mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
qemu: agent: remove redundant checks
virJSONValueObjectGetArray returns NULL if the object with the supplied key is not an array. Calling virJSONValueIsArray right after is redundant. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
parent
2820ee5229
commit
f08349247c
@ -1444,12 +1444,6 @@ qemuAgentGetVCPUs(qemuAgentPtr agent,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virJSONValueIsArray(data)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Malformed guest-get-vcpus data array"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ndata = virJSONValueArraySize(data);
|
||||
|
||||
*info = g_new0(qemuAgentCPUInfo, ndata);
|
||||
@ -2314,12 +2308,6 @@ qemuAgentGetUsers(qemuAgentPtr agent,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!virJSONValueIsArray(data)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Malformed guest-get-users data array"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ndata = virJSONValueArraySize(data);
|
||||
|
||||
if (virTypedParamsAddUInt(params, nparams, maxparams,
|
||||
|
Loading…
Reference in New Issue
Block a user