From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbVBE-0000g4-Mo for qemu-devel@nongnu.org; Fri, 27 Mar 2015 10:24:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbVB9-0002l3-67 for qemu-devel@nongnu.org; Fri, 27 Mar 2015 10:24:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbVB8-0002kv-UP for qemu-devel@nongnu.org; Fri, 27 Mar 2015 10:24:07 -0400 Date: Fri, 27 Mar 2015 15:24:02 +0100 From: Igor Mammedov Message-ID: <20150327152402.57b2f844@nial.brq.redhat.com> In-Reply-To: <55146D0F.6040309@redhat.com> References: <1427388174-30915-1-git-send-email-imammedo@redhat.com> <55146D0F.6040309@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] fix assertion in "info memory-devices" if memdev isn't accessible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de, lma@suse.com On Thu, 26 Mar 2015 21:33:19 +0100 Paolo Bonzini wrote: > > > On 26/03/2015 17:42, Igor Mammedov wrote: > > + mdevid = object_property_get_str(OBJECT(dimm->hostmem), "id", > > + &error_abort); > > + mdevpath = g_strdup_printf("/objects/%s", mdevid); > > + g_free(mdevid); > > + mdev = object_resolve_path_type(mdevpath, TYPE_MEMORY_BACKEND, > > + NULL); > > You can add a backend with id xyz, remove it, and add another with the > same id, right? right, but in the end it compares pointers to hostmem so it safe. but can_be_deleted() is more generic hence more preferred. > > I think the can_be_deleted solution is better and not more invasive, > even for 2.3. > > Paolo >