From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aU0QW-0003QE-NY for qemu-devel@nongnu.org; Thu, 11 Feb 2016 18:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aU0QV-0005q2-LI for qemu-devel@nongnu.org; Thu, 11 Feb 2016 18:13:32 -0500 References: <1455129674-17255-1-git-send-email-berrange@redhat.com> <1455129674-17255-2-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <56BD1592.7030407@redhat.com> Date: Thu, 11 Feb 2016 16:13:22 -0700 MIME-Version: 1.0 In-Reply-To: <1455129674-17255-2-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ujFq59KoVIpVb3XJP885I5uLGND4Wcie7" Subject: Re: [Qemu-devel] [PATCH v6 01/16] 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 Cc: Paolo Bonzini , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ujFq59KoVIpVb3XJP885I5uLGND4Wcie7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/10/2016 11:40 AM, Daniel P. Berrange wrote: > 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 | 174 ++++++++++++++++++++++++++++++++= ++++++++ > vl.c | 68 ++-------------- > 6 files changed, 290 insertions(+), 175 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ujFq59KoVIpVb3XJP885I5uLGND4Wcie7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWvRWSAAoJEKeha0olJ0Nq4sMIAK4Ti/KKDKJnMDQDy4mtHBCP ieexWUGGFiFyqAvjqR5woGAfr/+PWqt8ZKYl6ESc6KtmtfPLDqymZecU8UHZbqRe jeh70/ZrTWxq7DqXEpS0nRH0F2weEwhGikG8PBsjUfIphUQcg0yQw4hu4tldwbyE hC6qL4amS2QCVdPaoufylAZxw9uI1ptvi1T8UmGC+Pv7W7YDZiIKodOFl6/WiL7U p6L+86gOFV8u+fJTe7eCrB+IgGvFLzclEYYEqA27/DqhMPDV0NyQBJaYAi5OTBcU aeo67yZI+U55vmg4SYD/kRaSlAteX+9DNbzg/tC/eRWktbOa8tZhQ6XMXtBwm7o= =UGQs -----END PGP SIGNATURE----- --ujFq59KoVIpVb3XJP885I5uLGND4Wcie7--