diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index fe38f6df9582063b4b80277fd0114c586b5c1570..9f673bf2c8846c5013d2138c9ccb2178193a933a 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -1009,14 +1009,12 @@ static const char * qemuAgentStringifyError(virJSONValuePtr error) { const char *klass = virJSONValueObjectGetString(error, "class"); - const char *detail = NULL; + const char *detail = virJSONValueObjectGetString(error, "desc"); /* The QMP 'desc' field is usually sufficient for our generic - * error reporting needs. + * error reporting needs. However, if not present, translate + * the class into something readable. */ - if (klass) - detail = virJSONValueObjectGetString(error, "desc"); - if (!detail) detail = qemuAgentStringifyErrorClass(klass);