Received: from [140.186.70.92] (port=52528 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P90tb-0001Mu-7X for qemu-devel@nongnu.org; Thu, 21 Oct 2010 15:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P90f0-0005vb-Me for qemu-devel@nongnu.org; Thu, 21 Oct 2010 15:18:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P90f0-0005vG-CH for qemu-devel@nongnu.org; Thu, 21 Oct 2010 15:18:46 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9LJIjoW003105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Oct 2010 15:18:45 -0400 Date: Thu, 21 Oct 2010 21:18:35 +0200 From: Alon Levy Subject: Re: [Qemu-devel] [PATCH 3/3] monitor: add usb_attach and usb_detach Message-ID: <20101021191835.GB7815@playa.redhat.com> References: <1287484411-13611-1-git-send-email-alevy@redhat.com> <1287484411-13611-4-git-send-email-alevy@redhat.com> <4CBD9E85.50908@redhat.com> <20101020142420.675fb9d3@doriath> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101020142420.675fb9d3@doriath> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Gerd Hoffmann , qemu-devel@nongnu.org On Wed, Oct 20, 2010 at 02:24:20PM -0200, Luiz Capitulino wrote: > On Tue, 19 Oct 2010 15:35:01 +0200 > Gerd Hoffmann wrote: > > > Hi, > > > > > + .help = "attach USB device 'bus.addr'", > > > > > +@item usb_attach @var{devname} > > > > /me sees a mismatch here. > > > > There is still the use case question. Also note that this might have > > unwanted side effects when drivers automagically attach/detach devices > > like usb-host. > > Alon, did you check this? I hope it doesn't blowup. I just did, I created bus usb-serial usb-hub id=hub1 usb-serial .. (6 more) usb-hub id=hub2 usb-serial (6 more) (verified the guest sees this tree using lsusb -t) I did usb_detach hub1, and as expected only the first usb-serial remained. I then did a usb_attach hub1, and no devices appeared. A second usb_attach gets the expected warning (you tried to attach a device twice). So It doesn't blow up, but an info qtree showed it's because the rest of the devices (those below hub1) were still attached. So I think the detach should take care to detach anything below. If after that attach still won't cause attach then hub attaches need fixing as well (it should be just causing attach for devices under it, since the whole protocol for an attach is already correctly implemented). > > > Having this purely for debugging/troubleshooting purposes would be fine > > with me, but the documentation should clearly say so. > > Is this useful in production or only in the development of new devices? If > it's the letter, then I would even prefer enabling them only when DEBUG > is enabled. >