----- Original Message ----- > On 12/12/2016 04:42 PM, Marc-André Lureau wrote: > > This shorten a bit the code. > > Grammar: > This shortens the code a bit. > > > > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > > --- > > qemu-char.c | 97 > > ++++++++++++++++++++----------------------------------------- > > 1 file changed, 31 insertions(+), 66 deletions(-) > > > > > name = g_strdup_printf("chardev-udp-%s", chr->label); > > qio_channel_set_name(QIO_CHANNEL(sioc), name); > > g_free(name); > > > > + s = g_new0(NetCharDriver, 1); > > + s->ioc = QIO_CHANNEL(sioc); > > + s->bufcnt = 0; > > + s->bufptr = 0; > > + chr->opaque = s; > > + /* be isn't opened until we get a connection */ > > + *be_opened = false; > > The assignments to 0 and false are redundant with the g_new0(), if you > want to drop them for even more code reduction. >
thanks, done > Reviewed-by: Eric Blake <ebl...@redhat.com> > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > >