From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya18Q-0004tP-GQ for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:07:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya18M-0001f7-WB for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:07:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya18M-0001eU-Ot for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:07:06 -0400 Message-ID: <551001E3.3010304@redhat.com> Date: Mon, 23 Mar 2015 13:06:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1427105442-23484-1-git-send-email-lma@suse.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] object: Add can_be_deleted callback to TypeInfo and TypeImpl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Lin Ma Cc: Igor Mammedov , "qemu-devel@nongnu.org Developers" On 23/03/2015 11:36, Peter Crosthwaite wrote: > I don't think TypeInfo is the right place for this. You can however > define function hooks for Object in ObjectClass. See the unparent > field of ObjectClass for a precedent. In this case, the right place could be UserCreatable. Alternatively... > But is a better way to do this to add error handling to > object_unparent API and override object_unparent for your device in > question to throw the error? Then your change doesn't have to be > limited to QMP. ... this is also a good choice. Paolo