]> git.proxmox.com Git - qemu.git/commitdiff
qapi: input_type_enum(): fix error message
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 29 Jun 2012 17:25:01 +0000 (14:25 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 13 Jul 2012 16:46:55 +0000 (13:46 -0300)
The enum string is pointed to by 'enum_str' not 'name'. This bug
causes the error message to be:

{ "error": { "class": "InvalidParameter",
             "desc": "Invalid parameter 'null'",
             "data": { "name": "null" } } }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
qapi/qapi-visit-core.c

index ffffbf79aa11e013e8fd14ffb134faee6489b42c..705eca90aa6e869909a0aa9fed73daeb035d02ff 100644 (file)
@@ -298,7 +298,7 @@ void input_type_enum(Visitor *v, int *obj, const char *strings[],
     }
 
     if (strings[value] == NULL) {
-        error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
+        error_set(errp, QERR_INVALID_PARAMETER, enum_str);
         g_free(enum_str);
         return;
     }