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>
return -1;
}
- /* if qemu doesn't support the info request, just carry on */
- if (rc == -2)
- return 0;
-
if (rc < 0)
return -1;
* 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,
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;