From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYhu-0005Eo-20 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:13:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUYhp-0005p0-42 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:12:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYho-0005oL-Sl for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:12:53 -0400 Message-ID: <541AB016.6030804@redhat.com> Date: Thu, 18 Sep 2014 12:12:38 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411032780-10692-1-git-send-email-arei.gonglei@huawei.com> <1411032780-10692-6-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1411032780-10692-6-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/19] libusb: using error_report instead of fprintf List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: luonengjun@huawei.com, peter.huangpeng@huawei.com, weidong.huang@huawei.com, kraxel@redhat.com, armbru@redhat.com Il 18/09/2014 11:32, arei.gonglei@huawei.com ha scritto: > From: Gonglei > > Signed-off-by: Gonglei > --- > hw/usb/host-libusb.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c > index 863be64..0650910 100644 > --- a/hw/usb/host-libusb.c > +++ b/hw/usb/host-libusb.c > @@ -275,7 +275,7 @@ static void usb_host_libusb_error(const char *func, int rc) > } else { > errname = "?"; > } > - fprintf(stderr, "%s: %d [%s]\n", func, rc, errname); > + error_report("%s: %d [%s]", func, rc, errname); > } > > /* ------------------------------------------------------------------------ */ > @@ -1376,14 +1376,13 @@ static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps, > if (rc < 0) { > usb_host_libusb_error("libusb_alloc_streams", rc); > } else if (rc != streams) { > - fprintf(stderr, > - "libusb_alloc_streams: got less streams then requested %d < %d\n", > - rc, streams); > + error_report("libusb_alloc_streams: got less streams " > + "then requested %d < %d", rc, streams); > } > > return (rc == streams) ? 0 : -1; > #else > - fprintf(stderr, "libusb_alloc_streams: error not implemented\n"); > + error_report("libusb_alloc_streams: error not implemented"); > return -1; > #endif > } > Reviewed-by: Paolo Bonzini