1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemuMonitorJSONGetMemoryDeviceInfo: Don't return early on CommandNotFound

The qemuMonitorJSONGetMemoryDeviceInfo() command executes
'query-memory-devices' command and returns early if QEMU
doesn't know the command. Well, the command was introduced in
QEMU release 2.1 (specifically in commit v2.1.0-rc0~41^2~9) and
since the minimum required version is 2.11.0 we can be sure that
command will always exist.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2021-10-21 10:50:09 +02:00
parent dea2dcea72
commit 4c1d40915a
3 changed files with 2 additions and 12 deletions

View File

@ -8154,10 +8154,6 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
return -1;
}
/* if qemu doesn't support the info request, just carry on */
if (rc == -2)
return 0;
if (rc < 0)
return -1;

View File

@ -4079,9 +4079,8 @@ qemuMonitorSetIOThread(qemuMonitor *mon,
* Retrieve state and addresses of frontend memory devices present in
* the guest.
*
* Returns 0 on success and fills @info with a newly allocated struct; if the
* data can't be retrieved due to lack of support in qemu, returns -2. On
* other errors returns -1.
* Returns: 0 on success and fills @info with a newly allocated struct,
* -1 otherwise.
*/
int
qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon,

View File

@ -7788,11 +7788,6 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon,
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
ret = -2;
goto cleanup;
}
if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
goto cleanup;