From patchwork Wed Feb 20 01:02:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1045010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4440NG53NNz9s00 for ; Wed, 20 Feb 2019 12:27:58 +1100 (AEDT) Received: from localhost ([127.0.0.1]:57667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwGg0-0001w6-ID for incoming@patchwork.ozlabs.org; Tue, 19 Feb 2019 20:27:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwGR0-00059w-WF for qemu-devel@nongnu.org; Tue, 19 Feb 2019 20:12:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwGJ2-0001js-4w for qemu-devel@nongnu.org; Tue, 19 Feb 2019 20:04:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57526) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwGJ1-0001En-4r; Tue, 19 Feb 2019 20:04:11 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF7CF13A41; Wed, 20 Feb 2019 01:02:54 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 044781001DE2; Wed, 20 Feb 2019 01:02:34 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Prasad J Pandit , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini Date: Wed, 20 Feb 2019 02:02:07 +0100 Message-Id: <20190220010232.18731-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Feb 2019 01:02:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , Stefano Stabellini , Samuel Thibault , Li Zhijian , Amit Shah , "Michael S. Tsirkin" , Jason Wang , Cornelia Huck , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Paul Durrant , qemu-ppc@nongnu.org, Gerd Hoffmann , Pavel Dovgalyuk , Zhang Chen , Anthony Perard , xen-devel@lists.xenproject.org, Stefan Berger , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hi, This series convert the chardev::qemu_chr_write() to take unsigned length argument. To do so I went through all caller and checked if there are no negative value possible. I'm having headaches with the Xen backend, talking with Marc-André he suggested I ask help to the Xen maintainers. Since the series is becoming quite big, I splitted it: - part 1: convert qemu_chr_write() - part 2: convert IOReadHandler part 1 can be reviewed and merged without part 2. The git diffstat is not huge, but there are various chardev subsystems so many maintainers to ask for Ack. v2: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02396.html v1: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02200.html (from Prasad J Pandit) Changes requested by Paolo: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02294.html Please review, Phil. Philippe Mathieu-Daudé (25): chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc chardev: Assert IOCanReadHandler can not be negative chardev/wctablet: Use unsigned type to hold unsigned value chardev: Let qemu_chr_be_can_write() return a size_t types gdbstub: Use size_t for strlen() return value gdbstub: Use size_t to hold GDBState::last_packet_len gdbstub: Let put_buffer() use size_t ui/gtk: Remove pointless cast vhost-user: Express sizeof with size_t usb-redir: Verify usbredirparser_write get called with positive count xen: Let xencons_send() take a 'size' argument xen: Let buffer_append() return the size consumed RFC xen: Let buffer_append() return a size_t virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t spapr-vty: Let vty_putchars() use size_t tpm: Use size_t to hold sizes net/filter-mirror: Use size_t s390x/3270: Let insert_IAC_escape_char() use size_t s390/ebcdic: Use size_t to iterate over arrays s390x/sclp: Use a const variable to improve readability s390x/sclp: Use size_t in process_mdb() s390x/sclp: Let write_console_data() take a size_t hw/ipmi: Assert outlen > outpos chardev: Let qemu_chr_fe_write[_all] use size_t type argument chardev: Let qemu_chr_write[_all] use size_t chardev/baum.c | 6 +++--- chardev/char-fd.c | 6 +++--- chardev/char-fe.c | 4 ++-- chardev/char-io.c | 6 +++--- chardev/char-mux.c | 3 ++- chardev/char-pty.c | 8 ++++---- chardev/char-socket.c | 13 +++++++------ chardev/char-udp.c | 8 ++++---- chardev/char-win.c | 2 +- chardev/char.c | 15 +++++++++------ chardev/msmouse.c | 4 ++-- chardev/spice.c | 2 +- chardev/trace-events | 2 +- chardev/wctablet.c | 9 +++++---- gdbstub.c | 8 ++++---- hw/bt/hci-csr.c | 2 +- hw/char/sclpconsole-lm.c | 12 +++++++----- hw/char/spapr_vty.c | 2 +- hw/char/terminal3270.c | 7 ++++--- hw/char/virtio-console.c | 2 +- hw/char/xen_console.c | 24 +++++++++++++++--------- hw/ipmi/ipmi_bmc_extern.c | 3 ++- hw/tpm/tpm_emulator.c | 7 ++++--- hw/usb/redirect.c | 6 +++++- hw/virtio/vhost-user.c | 14 ++++++++------ include/chardev/char-fd.h | 2 +- include/chardev/char-fe.h | 4 ++-- include/chardev/char-io.h | 2 +- include/chardev/char.h | 4 ++-- include/hw/ppc/spapr_vio.h | 2 +- include/hw/s390x/ebcdic.h | 8 ++++---- include/hw/virtio/virtio-serial.h | 2 +- include/sysemu/replay.h | 2 +- net/filter-mirror.c | 2 +- replay/replay-char.c | 2 +- stubs/replay.c | 2 +- ui/console.c | 6 +++--- ui/gtk.c | 2 +- 38 files changed, 119 insertions(+), 96 deletions(-)