From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekVF-00055M-KV for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:08:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SekVA-0003sO-Te for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:08:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekVA-0003sD-LV for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:08:36 -0400 Message-ID: <4FD86699.8040105@redhat.com> Date: Wed, 13 Jun 2012 12:08:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <74685dbe793dcda72f02a4ef8f8fae68992dd813.1339578989.git.peter.crosthwaite@petalogix.com> In-Reply-To: <74685dbe793dcda72f02a4ef8f8fae68992dd813.1339578989.git.peter.crosthwaite@petalogix.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v0 4/8] object: create default canonical paths for orphans List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Peter A. G. Crosthwaite" Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, paul@codesourcery.com, edgar.iglesias@gmail.com, afaerber@suse.de, john.williams@petalogix.com, avi@redhat.com 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