From patchwork Fri Sep 25 14:55:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 34278 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EF0DDB7BB7 for ; Sat, 26 Sep 2009 00:56:32 +1000 (EST) Received: from localhost ([127.0.0.1]:34902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrCDl-0008L1-Jk for incoming@patchwork.ozlabs.org; Fri, 25 Sep 2009 10:56:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrCCw-0008De-4N for qemu-devel@nongnu.org; Fri, 25 Sep 2009 10:55:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrCCr-0008Cg-3e for qemu-devel@nongnu.org; Fri, 25 Sep 2009 10:55:37 -0400 Received: from [199.232.76.173] (port=56475 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrCCr-0008Cb-0b for qemu-devel@nongnu.org; Fri, 25 Sep 2009 10:55:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17276) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrCCq-0006mT-A4 for qemu-devel@nongnu.org; Fri, 25 Sep 2009 10:55:32 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8PEtV9S017048 for ; Fri, 25 Sep 2009 10:55:31 -0400 Received: from zweiblum.home.kraxel.org (vpn2-8-108.ams2.redhat.com [10.36.8.108]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n8PEtT32030033; Fri, 25 Sep 2009 10:55:30 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id E2ED1700E4; Fri, 25 Sep 2009 16:55:28 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 25 Sep 2009 16:55:28 +0200 Message-Id: <1253890528-4139-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH+SoB] unbreak usb pass-through on linux. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Changes: * Re-add the 'dev->fd = fd;' line which the qdev patches dropped by mistake. * call qdev_init() so the newly created usb device is plugged into a usb port and thus actually visible to the guest. Signed-off-by: Gerd Hoffmann Tested-by: Luiz Capitulino --- usb-linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index c434e4f..2b7b092 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -922,6 +922,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p dev->bus_num = bus_num; dev->addr = addr; + dev->fd = fd; /* read the device description */ dev->descr_len = read(fd, dev->descr, sizeof(dev->descr)); @@ -979,6 +980,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p hostdev_link(dev); + qdev_init(&d->qdev); return (USBDevice *) dev; fail: