8 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
9 * See the COPYING.LIB file in the top-level directory.
13 #include "qemu/osdep.h"
14 #include "qapi/error.h"
15 #include "qemu-common.h"
16 #include "qapi/util.h"
18 int qapi_enum_parse(const char * const lookup[], const char *buf,
19 int max, int def, Error **errp)
27 for (i = 0; i < max; i++) {
28 if (!strcmp(buf, lookup[i])) {
33 error_setg(errp, "invalid parameter value: %s", buf);