On 02/22/2017 11:23 PM, Eric Blake wrote:
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;

I will fix it in next version.

Thanks
Zhang Chen



--
Thanks
Zhang Chen




Reply via email to