|
| From: | Eric Blake |
| Subject: | Re: [Qemu-devel] [PATCH V7 2/2] Add a new qmp command to do checkpoint, query xen replication status |
| Date: | Wed, 22 Feb 2017 09:23:57 -0600 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
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
| [Prev in Thread] | Current Thread | [Next in Thread] |