From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYdn-0000lf-7n for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUYdi-0004FR-E1 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:08:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYdi-0004EX-6D for qemu-devel@nongnu.org; Thu, 18 Sep 2014 06:08:38 -0400 Message-ID: <541AAF0F.4000909@redhat.com> Date: Thu, 18 Sep 2014 12:08:15 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411032780-10692-1-git-send-email-arei.gonglei@huawei.com> <1411032780-10692-3-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1411032780-10692-3-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/19] usb-bus: convert USBDeviceClass init to realize 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: > @@ -460,7 +460,7 @@ static void usb_serial_event(void *opaque, int event) > break; > case CHR_EVENT_OPENED: > if (!s->dev.attached) { > - usb_device_attach(&s->dev); > + usb_device_attach(&s->dev, NULL); After this patch, this stops printing the error if the attach fails. Please add qerror_report_err. > } > break; > case CHR_EVENT_CLOSED: > @@ -489,7 +489,7 @@ static int usb_serial_initfn(USBDevice *dev) > usb_serial_handle_reset(dev); > > if (s->cs->be_open && !dev->attached) { > - usb_device_attach(dev); > + usb_device_attach(dev, NULL); This too. Please add qerror_report_err here too and, in this case, please make patch 12 pass the errp instead of using qerror_report_err. Paolo > } > return 0;