[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument
> -----Original Message----- > From: Philippe Mathieu-Daudé [mailto:philmd@xxxxxxxxxx] > Sent: 20 February 2019 01:02 > To: qemu-devel@xxxxxxxxxx; Prasad J Pandit <pjp@xxxxxxxxxxxxxxxxx>; Marc- > André Lureau <marcandre.lureau@xxxxxxxxxx>; Paolo Bonzini > <pbonzini@xxxxxxxxxx> > Cc: Jason Wang <jasowang@xxxxxxxxxx>; Anthony Perard > <anthony.perard@xxxxxxxxxx>; qemu-ppc@xxxxxxxxxx; Stefan Berger > <stefanb@xxxxxxxxxxxxx>; David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>; Gerd > Hoffmann <kraxel@xxxxxxxxxx>; Zhang Chen <zhangckid@xxxxxxxxx>; xen- > devel@xxxxxxxxxxxxxxxxxxxx; Cornelia Huck <cohuck@xxxxxxxxxx>; Samuel > Thibault <samuel.thibault@xxxxxxxxxxxx>; Christian Borntraeger > <borntraeger@xxxxxxxxxx>; Amit Shah <amit@xxxxxxxxxx>; Li Zhijian > <lizhijian@xxxxxxxxxxxxxx>; Corey Minyard <minyard@xxxxxxx>; Michael S. > Tsirkin <mst@xxxxxxxxxx>; Paul Durrant <Paul.Durrant@xxxxxxxxxx>; Halil > Pasic <pasic@xxxxxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; > qemu-s390x@xxxxxxxxxx; Pavel Dovgalyuk <pavel.dovgaluk@xxxxxxxxx>; > Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> > Subject: [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument > > The single caller of xencons_send(), con_event() already use the > difference 'con->buffer.size - con->buffer.consumed'. > Deduplicate by passing the difference as an argument. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> > --- > hw/char/xen_console.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c > index 91f34ef06c..083b2c8e2a 100644 > --- a/hw/char/xen_console.c > +++ b/hw/char/xen_console.c > @@ -144,11 +144,10 @@ static void xencons_receive(void *opaque, const > uint8_t *buf, int len) > xen_pv_send_notify(&con->xendev); > } > > -static void xencons_send(struct XenConsole *con) > +static void xencons_send(struct XenConsole *con, ssize_t size) > { > - ssize_t len, size; > + ssize_t len; > > - size = con->buffer.size - con->buffer.consumed; > if (qemu_chr_fe_backend_connected(&con->chr)) { > len = qemu_chr_fe_write(&con->chr, > con->buffer.data + con->buffer.consumed, > @@ -280,10 +279,13 @@ static void con_disconnect(struct XenLegacyDevice > *xendev) > static void con_event(struct XenLegacyDevice *xendev) > { > struct XenConsole *con = container_of(xendev, struct XenConsole, > xendev); > + ssize_t size; > > buffer_append(con); > - if (con->buffer.size - con->buffer.consumed) > - xencons_send(con); > + size = con->buffer.size - con->buffer.consumed; > + if (size) { > + xencons_send(con, size); > + } You introduce this here, only to modify it in patch #12. Why not squash the two together? Paul > } > > /* -------------------------------------------------------------------- > */ > -- > 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |