Il 13/06/2012 11:38, Peter A. G. Crosthwaite ha scritto:
> Create a default canonical path for an object which doesnt have one. This
> is a workaround for a bug probably buried deep with qdev as objects should
> always have valid canonical paths, but the need came about with the
> petalogix_ml605_mmu platform, the ethernet and dma devices as created by
> qdev have bogus paths (apparently).

We already do this in qdev_init_nofail:

    if (!OBJECT(dev)->parent) {
        static int unattached_count = 0;
        gchar *name = g_strdup_printf("device[%d]", unattached_count++);

        object_property_add_child(container_get(qdev_get_machine(),
                                                "/unattached"),
                                  name, OBJECT(dev), NULL);
        g_free(name);
    }

Probably we should move this piece to a function qdev_attach, so that
you can call it before object_property_set_link.

Alternatively, we could make object_property_set_link bypass the
canonical paths and write the pointer directly, but I think this would
be bad.

Paolo

Reply via email to