From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO66V-0003ve-Ur for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:04:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO66Q-0003WD-8n for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:04:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO66Q-0003W6-30 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:04:22 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A380419CF3B for ; Tue, 26 Jan 2016 16:04:21 +0000 (UTC) References: <1453817255-10287-1-git-send-email-kraxel@redhat.com> From: Eric Blake Message-ID: <56A798FF.5090409@redhat.com> Date: Tue, 26 Jan 2016 09:04:15 -0700 MIME-Version: 1.0 In-Reply-To: <1453817255-10287-1-git-send-email-kraxel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Eflrk9mojpLcPDN0QC4fu6EoOEuTJSKXP" Subject: Re: [Qemu-devel] [PATCH v2 1/5] console: add & use qemu_console_lookup_by_device_name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Cc: Marcelo Tosatti , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Eflrk9mojpLcPDN0QC4fu6EoOEuTJSKXP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/26/2016 07:07 AM, Gerd Hoffmann wrote: > We have two places needing this, and a third one will come shortly. > So factor things out into a helper function to reduce code duplication.= >=20 > Signed-off-by: Gerd Hoffmann > Reviewed-by: Daniel P. Berrange > --- No 0/5 cover letter? > include/ui/console.h | 2 ++ > ui/console.c | 23 +++++++++++++++++++++++ > ui/input.c | 15 ++++----------- > ui/vnc.c | 15 ++++----------- > 4 files changed, 33 insertions(+), 22 deletions(-) >=20 > +QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,= > + uint32_t head, Error *= *errp) > +{ > + DeviceState *dev; > + QemuConsole *con; > + > + dev =3D qdev_find_recursive(sysbus_get_default(), device_id); > + if (dev =3D=3D NULL) { I probably would have shortened to 'if (dev) {', but that's cosmetic and not mandated by HACKING. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Eflrk9mojpLcPDN0QC4fu6EoOEuTJSKXP 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/ iQEcBAEBCAAGBQJWp5j/AAoJEKeha0olJ0NqBloIAJSq5rwNsSoH8gh3yM9sTV/s PPMEOZCGxjmtMCmCfZ3qb1WdwaFbCsq+3zNKRvxFaFARfkICs3w9zs7VyuGq0I02 DUaoSI182m6+n4uFV0+MvSr29+cU4gAKStWykW24zEhtMYwYpGhQLUM+9ou99NCb zycU6bW4Yp7l67ltXQxLznp8S+SDBUn1R9HhYeJIEDyjC40c4cXCR97KVxcwiCe2 8ihZQ1nrH77q8c/xToy87s84462mGPO8dGxh9v/gQVf0uYvJ+HXoEDcDKxZx6qWO UBir2kkPMf/WazjfM0ssZT6nk+UhHSHzr3l2faym0qwy2BbJlM9ySelHpxGIDeY= =yfN9 -----END PGP SIGNATURE----- --Eflrk9mojpLcPDN0QC4fu6EoOEuTJSKXP--