Am 17.06.2014 15:28, schrieb Peter Crosthwaite: > On Thu, Jun 12, 2014 at 2:49 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> diff --git a/qom/object.c b/qom/object.c >> index e146ae5..ddf781e 100644 >> --- a/qom/object.c >> +++ b/qom/object.c >> @@ -1575,22 +1575,31 @@ void object_property_add_alias(Object *obj, const >> char *name, >> { >> AliasProperty *prop; >> ObjectProperty *target_prop; >> + gchar *prop_type; >> >> target_prop = object_property_find(target_obj, target_name, errp); >> if (!target_prop) { >> return; >> } >> >> + if (object_property_is_child(target_prop)) { >> + prop_type = g_strdup_printf("link%s", target_prop->type + 5); > > strlen("child") ?
+1 > Or some comment to explain the magic 5. > > Otherwise: > > Reviewed-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> > > Longer term, should "child" and "link" be macrofied and these > hardcoded strlen's be fixed to avoid difficult developer traps if > anyone ever tries to change the literal strings? I think my preference would be a helper function that returns the T from link<T> (non-dup'ed), which could then here be used as "link<%s>". The issue with a constant is that elsewhere 6 would be used. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg