On 02/22/2017 01:54 AM, Zhang Chen wrote: >> if (err) { >> result->status = REPLICATION_STATUS_ERROR; >> result->has_desc = true; >> result->desc = ...extract string from err >> } else { >> result->status = REPLICATION_STATUS_NORMAL; >> } >> >> by modifying the JSON [1] > > I got your point, but I don't understand this: > > result->desc = ...extract string from err > > Where we can get the string from err? > Can you give me a example?
See qmp_query_migrate (migration/migration.c) for similar code that populates an optional description member when an error is present: case MIGRATION_STATUS_FAILED: info->has_status = true; if (s->error) { info->has_error_desc = true; info->error_desc = g_strdup(error_get_pretty(s->error)); } break; -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature