From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J0fci-0004iO-8p for qemu-devel@nongnu.org; Fri, 07 Dec 2007 11:00:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J0fch-0004iC-6s for qemu-devel@nongnu.org; Fri, 07 Dec 2007 11:00:19 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0fcg-0004i9-Vz for qemu-devel@nongnu.org; Fri, 07 Dec 2007 11:00:19 -0500 Received: from rv-out-0910.google.com ([209.85.198.187]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J0fcg-0000FC-7w for qemu-devel@nongnu.org; Fri, 07 Dec 2007 11:00:18 -0500 Received: by rv-out-0910.google.com with SMTP id g11so2768217rvb for ; Fri, 07 Dec 2007 08:00:16 -0800 (PST) Message-ID: <47596E0C.6050602@codemonkey.ws> Date: Fri, 07 Dec 2007 10:00:12 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] Real SCSI device passthrough (v3) References: <11970374183207@bull.net> <200712071522.54416.paul@codesourcery.com> <1197041399.4521.2.camel@frecb07144> In-Reply-To: <1197041399.4521.2.camel@frecb07144> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Cc: Paul Brook Laurent Vivier wrote: > Le vendredi 07 décembre 2007 à 15:22 +0000, Paul Brook a écrit : > >> On Friday 07 December 2007, Laurent Vivier wrote: >> >>> - acb->aiocb.aio_nbytes = nb_sectors * 512; >>> + if (nb_sectors < 0) >>> + acb->aiocb.aio_nbytes = -nb_sectors; >>> + else >>> + acb->aiocb.aio_nbytes = nb_sectors * 512; >>> >> Ugly hacks like this need at least a decent comment. >> > > Yes, you're right but I'm always wondering if it is the good way to do > what I want: read a number of bytes instead of a number of sectors. > Perhaps I should define a new function in the qemu AIO interface ? > I think the crux of the problem is that you're using the BlockDriver API for something that isn't actually a block driver. Regards, Anthony Liguori > There is another ugly hack, did you find it ? ;-) > > Laurent >