From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlee4-0007PF-Sj for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlee0-0000Iv-Pu for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:04:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlee0-0000Ir-KS for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:04:08 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id F41B392475 for ; Mon, 12 Oct 2015 15:04:07 +0000 (UTC) References: <1444637004-20195-1-git-send-email-pbonzini@redhat.com> <1444637004-20195-4-git-send-email-pbonzini@redhat.com> From: Eric Blake Message-ID: <561BCBE6.4020000@redhat.com> Date: Mon, 12 Oct 2015 09:04:06 -0600 MIME-Version: 1.0 In-Reply-To: <1444637004-20195-4-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ivobmWReC0UBURXntVLf0JXBTFE1LwJPI" Subject: Re: [Qemu-devel] [PATCH 03/21] qemu-char: add create to register_char_driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ivobmWReC0UBURXntVLf0JXBTFE1LwJPI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/12/2015 02:03 AM, Paolo Bonzini wrote: > Having creation as a member of the CharDriver struct removes the need > to export functions for qemu-char.c's usage. After the conversion, > chardev backends implemented outside qemu-char.c will not need a stub > creation function anymore. >=20 > Ultimately all drivers will be converted. For now, support the case > where cd->create =3D=3D NULL. >=20 > Signed-off-by: Paolo Bonzini > --- > backends/baum.c | 3 +- > backends/msmouse.c | 3 +- > backends/testdev.c | 3 +- > include/sysemu/char.h | 4 +- > qemu-char.c | 213 ++++++++++++++++++++++++++++--------------= -------- > spice-qemu-char.c | 4 +- > ui/console.c | 3 +- > 7 files changed, 133 insertions(+), 100 deletions(-) The diff is a bit ugly because of reindentation, but seems sane. > =20 > void register_char_driver(const char *name, ChardevBackendKind kind, > - void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error *= *errp)) > + void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error *= *errp), > + CharDriverState *(*create)(const char *id, ChardevBackend *bac= kend, > + ChardevReturn *ret, Error **errp)) A typedef (or two) for the function pointer(s) would make this a bit easier to write. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ivobmWReC0UBURXntVLf0JXBTFE1LwJPI 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/ iQEcBAEBCAAGBQJWG8vmAAoJEKeha0olJ0NqHU8H/iKHjvOlVU4F/omE//ZgUv91 jltcW6tAcN/RCNyRjBWEMbbbspnvZooktrY/nhuy6lPYEOr5fctFx8Me+V6NYW5k RwzrCCoFnQq/PeOv8DeVX9Dl2CFf7Y7L0oIMxJLB9gpUpcs9tVg04U41YBUHfCql E1RDSl5ty4goCsvN3I8HG7E/k5Khv/GLyjeBf8wRpkrltjvuHBvoj9WqLXD9vmZd H8MdiN6quGyfSCyWNh8zrEsDROp+HVlUc9OPGCgQib0qB9lI6f1z8uPc9ssIRu0G Wyx0l27o7/jl5yoI/VwpcE1HZ7a1uSzs2/CMC1vlbwymTdYjE96j6CUga+hdz7k= =ZpGc -----END PGP SIGNATURE----- --ivobmWReC0UBURXntVLf0JXBTFE1LwJPI--