qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qmp: set accurate parameter name for error msg of device-list-properties
@ 2017-01-24 10:53 Lin Ma
  2017-01-24 16:57 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Ma @ 2017-01-24 10:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru

Signed-off-by: Lin Ma <lma@suse.com>
---
 qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qmp.c b/qmp.c
index 0028f0b..812db6c 100644
--- a/qmp.c
+++ b/qmp.c
@@ -531,7 +531,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
 
     klass = object_class_dynamic_cast(klass, TYPE_DEVICE);
     if (klass == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name", TYPE_DEVICE);
+        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_DEVICE);
         return NULL;
     }
 
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qmp: set accurate parameter name for error msg of device-list-properties
  2017-01-24 10:53 [Qemu-devel] [PATCH] qmp: set accurate parameter name for error msg of device-list-properties Lin Ma
@ 2017-01-24 16:57 ` Eric Blake
  2017-01-24 17:34   ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2017-01-24 16:57 UTC (permalink / raw)
  To: Lin Ma, qemu-devel; +Cc: armbru

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

On 01/24/2017 04:53 AM, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@suse.com>
> ---

The commit message is rather sparse; is there an easy formula for
triggering the error message, to give more context about the change?

>  qmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qmp.c b/qmp.c
> index 0028f0b..812db6c 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -531,7 +531,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
>  
>      klass = object_class_dynamic_cast(klass, TYPE_DEVICE);
>      if (klass == NULL) {
> -        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name", TYPE_DEVICE);
> +        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_DEVICE);
>          return NULL;
>      }
>  
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qmp: set accurate parameter name for error msg of device-list-properties
  2017-01-24 16:57 ` Eric Blake
@ 2017-01-24 17:34   ` Markus Armbruster
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2017-01-24 17:34 UTC (permalink / raw)
  To: Eric Blake; +Cc: Lin Ma, qemu-devel

Eric Blake <eblake@redhat.com> writes:

> On 01/24/2017 04:53 AM, Lin Ma wrote:
>> Signed-off-by: Lin Ma <lma@suse.com>
>> ---
>
> The commit message is rather sparse; is there an easy formula for
> triggering the error message, to give more context about the change?

Try this:
-> { "execute": "device-list-properties", "arguments": { "typename": "accel" } }
<- {"error": {"class": "GenericError", "desc": "Parameter 'name' expects device"}}

Type "accel" exists, but it's not a subtype of TYPE_DEVICE.

Perhaps:

    qmp: Fix argument name in error message of device-list-properties

    The argument is called "typename", not "name".

>>  qmp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/qmp.c b/qmp.c
>> index 0028f0b..812db6c 100644
>> --- a/qmp.c
>> +++ b/qmp.c
>> @@ -531,7 +531,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
>>  
>>      klass = object_class_dynamic_cast(klass, TYPE_DEVICE);
>>      if (klass == NULL) {
>> -        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name", TYPE_DEVICE);
>> +        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_DEVICE);
>>          return NULL;
>>      }

Incomplete, the next one needs the same change:

        if (object_class_is_abstract(klass)) {
            error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name",
                       "non-abstract device type");
            return NULL;
        }

Reproducer:
-> { "execute": "device-list-properties", "arguments": { "typename": "pci-qxl" } }
<- {"error": {"class": "GenericError", "desc": "Parameter 'name' expects non-abstract device type"}}

Please fix this one, too.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-24 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 10:53 [Qemu-devel] [PATCH] qmp: set accurate parameter name for error msg of device-list-properties Lin Ma
2017-01-24 16:57 ` Eric Blake
2017-01-24 17:34   ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).