Revision 5d9d3f47 qom/object.c

b/qom/object.c
296 296
    object_initialize_with_type(data, type);
297 297
}
298 298

  
299
static inline bool object_property_is_child(ObjectProperty *prop)
300
{
301
    return strstart(prop->type, "child<", NULL);
302
}
303

  
304
static inline bool object_property_is_link(ObjectProperty *prop)
305
{
306
    return strstart(prop->type, "link<", NULL);
307
}
308

  
299 309
static void object_property_del_all(Object *obj)
300 310
{
301 311
    while (!QTAILQ_EMPTY(&obj->properties)) {
......
318 328
    ObjectProperty *prop;
319 329

  
320 330
    QTAILQ_FOREACH(prop, &obj->properties, node) {
321
        if (strstart(prop->type, "child<", NULL) && prop->opaque == child) {
331
        if (object_property_is_child(prop) && prop->opaque == child) {
322 332
            object_property_del(obj, prop->name, errp);
323 333
            break;
324 334
        }
......
1008 1018
        g_assert(obj->parent != NULL);
1009 1019

  
1010 1020
        QTAILQ_FOREACH(prop, &obj->parent->properties, node) {
1011
            if (!strstart(prop->type, "child<", NULL)) {
1021
            if (!object_property_is_child(prop)) {
1012 1022
                continue;
1013 1023
            }
1014 1024

  
......
1042 1052
        return NULL;
1043 1053
    }
1044 1054

  
1045
    if (strstart(prop->type, "link<", NULL)) {
1055
    if (object_property_is_link(prop)) {
1046 1056
        return *(Object **)prop->opaque;
1047
    } else if (strstart(prop->type, "child<", NULL)) {
1057
    } else if (object_property_is_child(prop)) {
1048 1058
        return prop->opaque;
1049 1059
    } else {
1050 1060
        return NULL;
......
1087 1097
    QTAILQ_FOREACH(prop, &parent->properties, node) {
1088 1098
        Object *found;
1089 1099

  
1090
        if (!strstart(prop->type, "child<", NULL)) {
1100
        if (!object_property_is_child(prop)) {
1091 1101
            continue;
1092 1102
        }
1093 1103

  

Also available in: Unified diff