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. > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > Reviewed-by: Daniel P. Berrange <berra...@redhat.com> > ---
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(-) > > +QemuConsole *qemu_console_lookup_by_device_name(const char *device_id, > + uint32_t head, Error **errp) > +{ > + DeviceState *dev; > + QemuConsole *con; > + > + dev = qdev_find_recursive(sysbus_get_default(), device_id); > + if (dev == NULL) { I probably would have shortened to 'if (dev) {', but that's cosmetic and not mandated by HACKING. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature