static void set_pointer(Object *obj, Visitor *v, Property *prop,

                        int (*parse)(DeviceState *dev, const char *str, void **ptr),

                        const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Error *local_err = NULL;

    void **ptr = qdev_get_prop_ptr(dev, prop);

    char *str;

    int ret;



    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }



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

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    if (!*str) {

        g_free(str);

        *ptr = NULL;

        return;

    }

    ret = parse(dev, str, ptr);

    error_set_from_qdev_prop_error(errp, ret, dev, prop, str);

    g_free(str);

}

static void set_pointer(Object *obj, Visitor *v, Property *prop,

                        int (*parse)(DeviceState *dev, const char *str, void **ptr),

                        const char *name, Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Error *local_err = NULL;

    void **ptr = qdev_get_prop_ptr(dev, prop);

    char *str;

    int ret;



    if (dev->state != DEV_STATE_CREATED) {

        error_set(errp, QERR_PERMISSION_DENIED);

        return;

    }



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

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }

    if (!*str) {

        g_free(str);

        *ptr = NULL;

        return;

    }

    ret = parse(dev, str, ptr);

    error_set_from_qdev_prop_error(errp, ret, dev, prop, str);

    g_free(str);

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, Property *VAR_2,

                        int (*VAR_3)(DeviceState *VAR_4, const char *VAR_9, void **VAR_9),

                        const char *VAR_7, Error **VAR_8)

{

    DeviceState *VAR_4 = DEVICE(VAR_0);

    Error *local_err = NULL;

    void **VAR_9 = qdev_get_prop_ptr(VAR_4, VAR_2);

    char *VAR_9;

    int VAR_9;



    if (VAR_4->state != DEV_STATE_CREATED) {

        error_set(VAR_8, QERR_PERMISSION_DENIED);

        return;

    }



    visit_type_str(VAR_1, &VAR_9, VAR_7, &local_err);

    if (local_err) {

        error_propagate(VAR_8, local_err);

        return;

    }

    if (!*VAR_9) {

        g_free(VAR_9);

        *VAR_9 = NULL;

        return;

    }

    VAR_9 = VAR_3(VAR_4, VAR_9, VAR_9);

    error_set_from_qdev_prop_error(VAR_8, VAR_9, VAR_4, VAR_2, VAR_9);

    g_free(VAR_9);

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, Property *VAR_2,
int (*VAR_3)(DeviceState *VAR_4, const char *VAR_9, void **VAR_9),
const char *VAR_7, Error **VAR_8)
{ DeviceState *VAR_4 = DEVICE(VAR_0); Error *local_err = NULL; void **VAR_9 = qdev_get_prop_ptr(VAR_4, VAR_2); char *VAR_9; int VAR_9; if (VAR_4->state != DEV_STATE_CREATED) { error_set(VAR_8, QERR_PERMISSION_DENIED); return; } visit_type_str(VAR_1, &VAR_9, VAR_7, &local_err); if (local_err) { error_propagate(VAR_8, local_err); return; } if (!*VAR_9) { g_free(VAR_9); *VAR_9 = NULL; return; } VAR_9 = VAR_3(VAR_4, VAR_9, VAR_9); error_set_from_qdev_prop_error(VAR_8, VAR_9, VAR_4, VAR_2, VAR_9); g_free(VAR_9); }