[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH] qmp: Report path ambiguity error.
From: |
Andreas Färber |
Subject: |
Re: [Qemu-trivial] [PATCH] qmp: Report path ambiguity error. |
Date: |
Mon, 05 May 2014 11:26:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 05.05.2014 11:12, schrieb Michael Tokarev:
> 03.05.2014 12:38, Michael Tokarev wrote:
> []
>> --- a/qmp.c
>> +++ b/qmp.c
>> @@ -200,7 +200,9 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path,
>> Error **errp)
>>
>> obj = object_resolve_path(path, &ambiguous);
>> if (obj == NULL) {
>> - error_set(errp, QERR_DEVICE_NOT_FOUND, path);
>> + error_set(errp,
>> + ambiguous ? "Path '%s' is ambiguous" :
>> QERR_DEVICE_NOT_FOUND,
>> + path);
>> return NULL;
>> }
>
> I've applied this version.
Please undo. error_set() unlike error_setg() expects an ErrorClass
argument before the string. QERR_* macro contains *two* comma-separated
values, so it is on top filling in the device-not-found message as path
in the ambiguous case.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg