Received: from eggs.gnu.org ([2001:4830:134:3::10]:55283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcYT3-0004Cl-1G for qemu-devel@nongnu.org; Mon, 30 Mar 2015 08:07:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcYSx-0001JV-SI for qemu-devel@nongnu.org; Mon, 30 Mar 2015 08:06:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcYSx-0001JR-MW for qemu-devel@nongnu.org; Mon, 30 Mar 2015 08:06:51 -0400 Date: Mon, 30 Mar 2015 14:06:48 +0200 From: Igor Mammedov Message-ID: <20150330140648.2adb7174@nial.brq.redhat.com> In-Reply-To: <1427704589-7688-1-git-send-email-lma@suse.com> References: <1427704589-7688-1-git-send-email-lma@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 0/2] Add generic can_be_deleted to UserCreatableClass. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma Cc: pbonzini@redhat.com, peter.crosthwaite@xilinx.com, afaerber@suse.de, qemu-devel@nongnu.org On Mon, 30 Mar 2015 16:36:27 +0800 Lin Ma wrote: Paolo, Could you take it through your tree for 2.3, pls? > The patchset adds a generic can_be_deleted callback to UserCreatableClass. > It prevents removing a usercreatable object if the callback returns false. >=20 > Backends could implement the callback if it shoudn't be removed while it's > in use. >=20 > Thank Peter Crosthwaite, Paolo Bonzini, Andreas F=C3=A4rber and Igor Mamm= edov for > helping review. >=20 Reviewed-by: Igor Mammedov >=20 > ChangeLog: > V6: > Change prototype of user_creatable_can_be_deleted. > from bool user_creatable_can_be_deleted(Object *obj, Error **errp) > to bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp) >=20 > V5: > Use specific caster instead of dynamic cast in user_creatable_can_be_dele= ted. >=20 > V4: > Add function user_creatable_can_be_deleted to wrapper can_be_deleted meth= od. > Remove some unnecessary code. >=20 > V3: > Move the callback to the correct place: UserCreatableClass. > Move the backend callback implementation to hostmem.c. >=20 > V2: > Make it generic, add the can_be_deleted callback to TypeInfo and TypeImpl. > Implement the callback in hostmem-file.c and hostmem-ram.c. >=20 > V1: > Initial version, hard coded in object_del to prevent removing an in-use > host memory backend. >=20 >=20 > Lin Ma (2): > qom: Add can_be_deleted callback to UserCreatableClass > hostmem: Prevent removing an in-use memory backend >=20 > backends/hostmem.c | 14 ++++++++++++++ > include/qom/object_interfaces.h | 13 +++++++++++++ > qmp.c | 5 +++++ > qom/object_interfaces.c | 12 ++++++++++++ > 4 files changed, 44 insertions(+) >=20