From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f96sq-0000KZ-B8 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 06:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f96sn-00010M-5x for qemu-devel@nongnu.org; Thu, 19 Apr 2018 06:33:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60132 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f96sm-00010E-W3 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 06:33:41 -0400 References: <20180329032149.44685-1-aik@ozlabs.ru> From: Paolo Bonzini Message-ID: <75bf706c-d2f2-e715-5b07-b651881e0a5e@redhat.com> Date: Thu, 19 Apr 2018 12:33:25 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH qemu] RFC: memory/hmp: Print owners/parents in "info mtree" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Markus Armbruster , Igor Mammedov On 19/04/2018 04:41, Alexey Kardashevskiy wrote: > it just seems to > be a real case and majority of object_get_canonical_path_component() users > do not test the returned pointer. > > =================== > diff --git a/qom/object.c b/qom/object.c > index 4677951..0c2d5c2 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -1645,7 +1645,9 @@ gchar *object_get_canonical_path_component(Object *obj) > GHashTableIter iter; > > g_assert(obj); > - g_assert(obj->parent != NULL); I agree but why wouldn't the caller have crashed anyway on this assertion? > as QMP crashes QEMU with this: > > {"execute": "qom-get", "arguments": {"path": > "/machine/unattached/device[3]/smram[0]", "property": "container"}} > > with the patch it returns: > > {'return': '//mem-container-smram[0]'} The root cause of this is that the accelerator object is not added to the QOM object tree. Paolo