From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya4a2-0001M0-MZ for qemu-devel@nongnu.org; Mon, 23 Mar 2015 11:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya4Zz-0006Oo-HC for qemu-devel@nongnu.org; Mon, 23 Mar 2015 11:47:54 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:39101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya4Zz-0006Oi-AY for qemu-devel@nongnu.org; Mon, 23 Mar 2015 11:47:51 -0400 Message-ID: <55103590.4060809@suse.com> Date: Mon, 23 Mar 2015 23:47:28 +0800 From: Lin Ma MIME-Version: 1.0 References: <1427105442-23484-1-git-send-email-lma@suse.com> <551001E3.3010304@redhat.com> In-Reply-To: <551001E3.3010304@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/2] object: Add can_be_deleted callback to TypeInfo and TypeImpl Reply-To: lma@suse.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Crosthwaite Cc: Igor Mammedov , "qemu-devel@nongnu.org Developers" , afaerber@suse.de 在 2015年03月23日 20:06, Paolo Bonzini 写道: > > 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... Well... Because I'm not familiar with qom very much, Let me dig more details about UserCreatable first :-) > >> 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 >