On 01/10/2017 11:47 AM, Marc-André Lureau wrote: > Number and kinds of backends is known at compile-time, use a fixed-sized > static array to simplify iterations & lookups.
This part is okay; > Add an alias field to the > CharDriver structure to cover the cases where we previously registered a > driver twice under two names. but this part belongs in the 5/20 commit message. > > Signed-off-by: Marc-André Lureau <[email protected]> > --- > qemu-char.c | 68 > ++++++++++++++++++++++++++++++------------------------------- > 1 file changed, 34 insertions(+), 34 deletions(-) > @@ -4143,15 +4144,17 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts > *opts, > goto err; > } > > - for (i = backends; i; i = i->next) { > - cd = i->data; > - > + for (i = 0; i < ARRAY_SIZE(backends); i++) { > + cd = backends[i]; > @@ -4368,11 +4371,15 @@ qmp_prepend_backend(ChardevBackendInfoList *list, > const char *name) > ChardevBackendInfoList *qmp_query_chardev_backends(Error **errp) > { > ChardevBackendInfoList *backend_list = NULL; > - CharDriver *c; > - GSList *i; > + const CharDriver *c; > + int i; > + > + for (i = 0; i < ARRAY_SIZE(backends); i++) { > + c = backends[i]; > + if (!c) { Worth using the name 'cd' everywhere for consistency? Reviewed-by: Eric Blake <[email protected]> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
