From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JprGg-0007yc-Pl for qemu-devel@nongnu.org; Sat, 26 Apr 2008 16:45:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JprGf-0007xT-B4 for qemu-devel@nongnu.org; Sat, 26 Apr 2008 16:45:10 -0400 Received: from [199.232.76.173] (port=60069 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JprGf-0007xP-0o for qemu-devel@nongnu.org; Sat, 26 Apr 2008 16:45:09 -0400 Received: from wf-out-1314.google.com ([209.85.200.174]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JprGe-00016K-Kx for qemu-devel@nongnu.org; Sat, 26 Apr 2008 16:45:08 -0400 Received: by wf-out-1314.google.com with SMTP id 28so3380151wff.4 for ; Sat, 26 Apr 2008 13:45:05 -0700 (PDT) Message-ID: <5d6222a80804261345x3a976797oc3bf6d090dcdff32@mail.gmail.com> Date: Sat, 26 Apr 2008 17:45:05 -0300 From: "Glauber Costa" Subject: Re: [Qemu-devel] [4261] Errors while registering ioports are not fatal (Glauber Costa). In-Reply-To: <200804262057.51230.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200804262026.06396.paul@codesourcery.com> <4813844C.7070308@codemonkey.ws> <200804262057.51230.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, paul@codesourcery.com On Sat, Apr 26, 2008 at 4:57 PM, Paul Brook wrote: > On Saturday 26 April 2008, Anthony Liguori wrote: > > Paul Brook wrote: > > > On Saturday 26 April 2008, Andrzej Zaborowski wrote: > > >> Revision: 4261 > > >> http://svn.sv.gnu.org/viewvc/?view=3Drev&root=3Dqemu&revi= sion=3D4261 > > >> Author: balrog > > >> Date: 2008-04-26 16:04:29 +0000 (Sat, 26 Apr 2008) > > >> > > >> Log Message: > > >> ----------- > > >> Errors while registering ioports are not fatal (Glauber Costa). > > > > > > Why shouldn't they be fatal? How can this be anything other than a > > > serious bug in the device emulation? > > > > I think the idea is that the device should fail to initialize rather t= he > > VM being destroyed. Consider the case of PCI hotplug. It's a > > recoverable error if register ioport fails during hot add. > > The errors that get suppressed aren't the sort of thing that should ever > happen. How exactly do you end up with an IO port that is not 1, 2 or 4 = bytes > in size? If this ever happens I want qemu do die right there and then. T= his > isn't just a failure, it is an indication that something is broken beyon= d > hope. > > Paul Errors in size are not the thing we=B4re trying to catch here. If preferred, they can still be fatal, which makes some sense. Problem is that some devices might use an ioport that is already registered. In the specific problem I had: * qemu statically register an ide controller, (can=B4t recall specific port numbers now) * kvm wants to passthrough a device, choosen by the user. It might be the case that this device is an IDE controller, which will use the same ports. Would it be better to test it, and not even register the device in the first place. Sure. I agree 120 % with this. But how? You won=B4t have the conflicting ioport registered until it is too late in the process, because all ports only get registered in update_mappings(). But now that I got your attention, if there is a better proposed solution for this case, I'll be happy to hear and implement it. > > --=20 Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act."