static void object_set_link_property(Object *obj, Visitor *v, void *opaque,

                                     const char *name, Error **errp)

{

    Object **child = opaque;

    bool ambiguous = false;

    const char *type;

    char *path;



    type = object_property_get_type(obj, name, NULL);



    visit_type_str(v, &path, name, errp);



    if (*child) {

        object_unref(*child);

    }



    if (strcmp(path, "") != 0) {

        Object *target;



        target = object_resolve_path(path, &ambiguous);

        if (target) {

            gchar *target_type;



            target_type = g_strdup_printf("link<%s>",

                                          object_get_typename(OBJECT(target)));

            if (strcmp(target_type, type) == 0) {

                *child = target;

                object_ref(target);

            } else {

                error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, type);

            }



            g_free(target_type);

        } else {

            error_set(errp, QERR_DEVICE_NOT_FOUND, path);

        }

    } else {

        *child = NULL;

    }



    g_free(path);

}

static void object_set_link_property(Object *obj, Visitor *v, void *opaque,

                                     const char *name, Error **errp)

{

    Object **child = opaque;

    bool ambiguous = false;

    const char *type;

    char *path;



    type = object_property_get_type(obj, name, NULL);



    visit_type_str(v, &path, name, errp);



    if (*child) {

        object_unref(*child);

    }



    if (strcmp(path, "") != 0) {

        Object *target;



        target = object_resolve_path(path, &ambiguous);

        if (target) {

            gchar *target_type;



            target_type = g_strdup_printf("link<%s>",

                                          object_get_typename(OBJECT(target)));

            if (strcmp(target_type, type) == 0) {

                *child = target;

                object_ref(target);

            } else {

                error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, type);

            }



            g_free(target_type);

        } else {

            error_set(errp, QERR_DEVICE_NOT_FOUND, path);

        }

    } else {

        *child = NULL;

    }



    g_free(path);

}

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

                                     const char *VAR_3, Error **VAR_4)

{

    Object **child = VAR_2;

    bool ambiguous = false;

    const char *VAR_5;

    char *VAR_6;



    VAR_5 = object_property_get_type(VAR_0, VAR_3, NULL);



    visit_type_str(VAR_1, &VAR_6, VAR_3, VAR_4);



    if (*child) {

        object_unref(*child);

    }



    if (strcmp(VAR_6, "") != 0) {

        Object *target;



        target = object_resolve_path(VAR_6, &ambiguous);

        if (target) {

            gchar *target_type;



            target_type = g_strdup_printf("link<%s>",

                                          object_get_typename(OBJECT(target)));

            if (strcmp(target_type, VAR_5) == 0) {

                *child = target;

                object_ref(target);

            } else {

                error_set(VAR_4, QERR_INVALID_PARAMETER_TYPE, VAR_3, VAR_5);

            }



            g_free(target_type);

        } else {

            error_set(VAR_4, QERR_DEVICE_NOT_FOUND, VAR_6);

        }

    } else {

        *child = NULL;

    }



    g_free(VAR_6);

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, void *VAR_2,
const char *VAR_3, Error **VAR_4)
{ Object **child = VAR_2; bool ambiguous = false; const char *VAR_5; char *VAR_6; VAR_5 = object_property_get_type(VAR_0, VAR_3, NULL); visit_type_str(VAR_1, &VAR_6, VAR_3, VAR_4); if (*child) { object_unref(*child); } if (strcmp(VAR_6, "") != 0) { Object *target; target = object_resolve_path(VAR_6, &ambiguous); if (target) { gchar *target_type; target_type = g_strdup_printf("link<%s>",
object_get_typename(OBJECT(target))); if (strcmp(target_type, VAR_5) == 0) { *child = target; object_ref(target); } else { error_set(VAR_4, QERR_INVALID_PARAMETER_TYPE, VAR_3, VAR_5); } g_free(target_type); } else { error_set(VAR_4, QERR_DEVICE_NOT_FOUND, VAR_6); } } else { *child = NULL; } g_free(VAR_6); }