int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)

{

    Property *prop;

    int ret;



    prop = qdev_prop_find(dev, name);

    if (!prop) {

        fprintf(stderr, "property \"%s.%s\" not found\n",

                dev->info->name, name);

        return -1;

    }

    if (!prop->info->parse) {

        fprintf(stderr, "property \"%s.%s\" has no parser\n",

                dev->info->name, name);

        return -1;

    }

    ret = prop->info->parse(dev, prop, value);

    if (ret < 0) {

        switch (ret) {

        case -EEXIST:

            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",

                    dev->info->name, name, value);

            break;

        default:

        case -EINVAL:

            fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",

                    dev->info->name, name, value);

            break;

        case -ENOENT:

            fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",

                    dev->info->name, name, value);

            break;

        }

        return -1;

    }

    return 0;

}

int qdev_prop_parse(DeviceState *dev, const char *name, const char *value)

{

    Property *prop;

    int ret;



    prop = qdev_prop_find(dev, name);

    if (!prop) {

        fprintf(stderr, "property \"%s.%s\" not found\n",

                dev->info->name, name);

        return -1;

    }

    if (!prop->info->parse) {

        fprintf(stderr, "property \"%s.%s\" has no parser\n",

                dev->info->name, name);

        return -1;

    }

    ret = prop->info->parse(dev, prop, value);

    if (ret < 0) {

        switch (ret) {

        case -EEXIST:

            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",

                    dev->info->name, name, value);

            break;

        default:

        case -EINVAL:

            fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",

                    dev->info->name, name, value);

            break;

        case -ENOENT:

            fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",

                    dev->info->name, name, value);

            break;

        }

        return -1;

    }

    return 0;

}

int FUNC_0(DeviceState *VAR_0, const char *VAR_1, const char *VAR_2)

{

    Property *prop;

    int VAR_3;



    prop = qdev_prop_find(VAR_0, VAR_1);

    if (!prop) {

        fprintf(stderr, "property \"%s.%s\" not found\n",

                VAR_0->info->VAR_1, VAR_1);

        return -1;

    }

    if (!prop->info->parse) {

        fprintf(stderr, "property \"%s.%s\" has no parser\n",

                VAR_0->info->VAR_1, VAR_1);

        return -1;

    }

    VAR_3 = prop->info->parse(VAR_0, prop, VAR_2);

    if (VAR_3 < 0) {

        switch (VAR_3) {

        case -EEXIST:

            fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",

                    VAR_0->info->VAR_1, VAR_1, VAR_2);

            break;

        default:

        case -EINVAL:

            fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",

                    VAR_0->info->VAR_1, VAR_1, VAR_2);

            break;

        case -ENOENT:

            fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",

                    VAR_0->info->VAR_1, VAR_1, VAR_2);

            break;

        }

        return -1;

    }

    return 0;

}

int FUNC_0(DeviceState *VAR_0, const char *VAR_1, const char *VAR_2)
{ Property *prop; int VAR_3; prop = qdev_prop_find(VAR_0, VAR_1); if (!prop) { fprintf(stderr, "property \"%s.%s\" not found\n",
VAR_0->info->VAR_1, VAR_1); return -1; } if (!prop->info->parse) { fprintf(stderr, "property \"%s.%s\" has no parser\n",
VAR_0->info->VAR_1, VAR_1); return -1; } VAR_3 = prop->info->parse(VAR_0, prop, VAR_2); if (VAR_3 < 0) { switch (VAR_3) { case -EEXIST:
fprintf(stderr, "property \"%s.%s\": \"%s\" is already in use\n",
VAR_0->info->VAR_1, VAR_1, VAR_2); break; default:
case -EINVAL:
fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
VAR_0->info->VAR_1, VAR_1, VAR_2); break; case -ENOENT:
fprintf(stderr, "property \"%s.%s\": could not find \"%s\"\n",
VAR_0->info->VAR_1, VAR_1, VAR_2); break; } return -1; } return 0; }