static void qdev_set_legacy_property(DeviceState *dev, Visitor *v, void *opaque,

                                     const char *name, Error **errp)

{

    Property *prop = opaque;



    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }



    if (prop->info->parse) {

        Error *local_err = NULL;

        char *ptr = NULL;



        visit_type_str(v, &ptr, name, &local_err);

        if (!local_err) {

            int ret;

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

            if (ret != 0) {

                error_set(errp, QERR_INVALID_PARAMETER_VALUE,

                          name, prop->info->name);

            }

            g_free(ptr);

        } else {

            error_propagate(errp, local_err);

        }

    } else {

        error_set(errp, QERR_PERMISSION_DENIED);

    }

}

static void qdev_set_legacy_property(DeviceState *dev, Visitor *v, void *opaque,

                                     const char *name, Error **errp)

{

    Property *prop = opaque;



    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }



    if (prop->info->parse) {

        Error *local_err = NULL;

        char *ptr = NULL;



        visit_type_str(v, &ptr, name, &local_err);

        if (!local_err) {

            int ret;

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

            if (ret != 0) {

                error_set(errp, QERR_INVALID_PARAMETER_VALUE,

                          name, prop->info->name);

            }

            g_free(ptr);

        } else {

            error_propagate(errp, local_err);

        }

    } else {

        error_set(errp, QERR_PERMISSION_DENIED);

    }

}

static void FUNC_0(DeviceState *VAR_0, Visitor *VAR_1, void *VAR_2,

                                     const char *VAR_3, Error **VAR_4)

{

    Property *prop = VAR_2;



    if (VAR_0->state != DEV_STATE_CREATED) {

        error_set(VAR_4, QERR_PERMISSION_DENIED);

        return;

    }



    if (prop->info->parse) {

        Error *local_err = NULL;

        char *VAR_5 = NULL;



        visit_type_str(VAR_1, &VAR_5, VAR_3, &local_err);

        if (!local_err) {

            int VAR_6;

            VAR_6 = prop->info->parse(VAR_0, prop, VAR_5);

            if (VAR_6 != 0) {

                error_set(VAR_4, QERR_INVALID_PARAMETER_VALUE,

                          VAR_3, prop->info->VAR_3);

            }

            g_free(VAR_5);

        } else {

            error_propagate(VAR_4, local_err);

        }

    } else {

        error_set(VAR_4, QERR_PERMISSION_DENIED);

    }

}

static void FUNC_0(DeviceState *VAR_0, Visitor *VAR_1, void *VAR_2,
const char *VAR_3, Error **VAR_4)
{ Property *prop = VAR_2; if (VAR_0->state != DEV_STATE_CREATED) { error_set(VAR_4, QERR_PERMISSION_DENIED); return; } if (prop->info->parse) { Error *local_err = NULL; char *VAR_5 = NULL; visit_type_str(VAR_1, &VAR_5, VAR_3, &local_err); if (!local_err) { int VAR_6; VAR_6 = prop->info->parse(VAR_0, prop, VAR_5); if (VAR_6 != 0) { error_set(VAR_4, QERR_INVALID_PARAMETER_VALUE,
VAR_3, prop->info->VAR_3); } g_free(VAR_5); } else { error_propagate(VAR_4, local_err); } } else { error_set(VAR_4, QERR_PERMISSION_DENIED); } }