From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQcFL-0003nV-Nq for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:48:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQcFK-0003Pu-Jr for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:47:59 -0500 References: <1454417864-18774-1-git-send-email-berrange@redhat.com> <1454417864-18774-2-git-send-email-berrange@redhat.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <56B0C194.8000508@suse.de> Date: Tue, 2 Feb 2016 15:47:48 +0100 MIME-Version: 1.0 In-Reply-To: <1454417864-18774-2-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 01/10] qom: add helpers for UserCreatable object types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org, Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , Markus Armbruster , qemu-block@nongnu.org Am 02.02.2016 um 13:57 schrieb Daniel P. Berrange: > The QMP monitor code has two helper methods object_add > and qmp_object_del that are called from several places > in the code (QMP, HMP and main emulator startup). >=20 > The HMP and main emulator startup code also share > further logic that extracts the qom-type & id > values from a qdict. >=20 > We soon need to use this logic from qemu-img, qemu-io > and qemu-nbd too, but don't want those to depend on > the monitor, nor do we want to duplicate the code. >=20 > To avoid this, move some code out of qmp.c and hmp.c > adding new methods to qom/object_interfaces.c >=20 > - user_creatable_add - takes a QDict holding a full > object definition & instantiates it > - user_creatable_add_type - takes an ID, type name, > and QDict holding object properties & instantiates > it > - user_creatable_add_opts - takes a QemuOpts holding > a full object definition & instantiates it > - user_creatable_add_opts_foreach - variant on > user_creatable_add_opts which can be directly used > in conjunction with qemu_opts_foreach. > - user_creatable_del - takes an ID and deletes the > corresponding object >=20 > The existing code is updated to use these new methods. >=20 > Signed-off-by: Daniel P. Berrange > --- > hmp.c | 52 +++--------- > include/monitor/monitor.h | 3 - > include/qom/object_interfaces.h | 92 ++++++++++++++++++++ > qmp.c | 76 ++--------------- > qom/object_interfaces.c | 180 ++++++++++++++++++++++++++++++++= ++++++++ > vl.c | 66 ++------------- > 6 files changed, 296 insertions(+), 173 deletions(-) No objections from my side, looks sane, but I'd appreciate Paolo/Stefan to ack since I wasn't really involved in that code. Regards, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Graham Norton; HRB 21284 (AG N=FC= rnberg)