Some architectures provide the query-cpu-definitions command,
but are set to always return a "GenericError" from it :-(
Catch this & treat it as if there was an empty list of CPUs
returned
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
+ if (ret == 0) {
+ /* Urgh, some QEMU architectures have the query-cpu-definitions
+ * command, but return 'GenericError' with string "Not supported",
+ * instead of simply omitting the command entirely :-(
+ */
+ if (qemuMonitorJSONHasError(reply, "GenericError")) {
+ ret = 0;
+ goto cleanup;
+ }
+ ret = qemuMonitorJSONCheckError(cmd, reply);
+ }
+
if (ret == 0)
ret = qemuMonitorJSONCheckError(cmd, reply);