From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmtS3-0003f1-Ug for qemu-devel@nongnu.org; Fri, 18 Apr 2008 12:28:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmtS2-0003e1-ET for qemu-devel@nongnu.org; Fri, 18 Apr 2008 12:28:39 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmtS2-0003dx-8A for qemu-devel@nongnu.org; Fri, 18 Apr 2008 12:28:38 -0400 Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194] helo=il.qumranet.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JmtS2-0004O2-Cn for qemu-devel@nongnu.org; Fri, 18 Apr 2008 12:28:38 -0400 Message-ID: <4808CBDB.3030206@qumranet.com> Date: Fri, 18 Apr 2008 19:27:07 +0300 From: Avi Kivity MIME-Version: 1.0 References: <12084217752458-git-send-email-gcosta@redhat.com> In-Reply-To: <12084217752458-git-send-email-gcosta@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [kvm-devel] [PATCH 0/3] Qemu crashes with pci passthrough Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber de Oliveira Costa Cc: kvm-devel@lists.sourceforge.net, mtosatti@redhat.com, qemu-devel@nongnu.org, aurelien@aurel32.net Glauber de Oliveira Costa wrote: > Hi, > > I've got some qemu crashes while trying to passthrough an ide device > to a kvm guest. After some investigation, it turned out that > register_ioport_{read/write} will abort on errors instead of returning > a meaningful error. > > However, even if we do return an error, the asynchronous nature of pci > config space mapping updates makes it a little bit hard to treat. > > This series of patches basically treats errors in the mapping functions in > the pci layer. If anything goes wrong, we unregister the pci device, unmapping > any mappings that happened to be sucessfull already. > > After these patches are applied, a lot of warnings appears. And, you know, > everytime there is a warning, god kills a kitten. But I'm not planning on > touching the other pieces of qemu code for this until we set up (or not) in > this solution > > Comments are very welcome, specially from qemu folks (since it is a bit invasive) > > Have you considered, instead of rolling back the changes you already made before the failure, to have a function which checks if an ioport registration will be successful? This may simplify the code. -- Any sufficiently difficult bug is indistinguishable from a feature.