From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWEyQ-0003lF-FI for qemu-devel@nongnu.org; Sun, 08 Feb 2009 14:05:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWEyO-0003hT-Eo for qemu-devel@nongnu.org; Sun, 08 Feb 2009 14:05:45 -0500 Received: from [199.232.76.173] (port=40414 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWEyO-0003hF-65 for qemu-devel@nongnu.org; Sun, 08 Feb 2009 14:05:44 -0500 Received: from mail-gx0-f19.google.com ([209.85.217.19]:43043) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWEyN-0005ho-Oy for qemu-devel@nongnu.org; Sun, 08 Feb 2009 14:05:43 -0500 Received: by gxk12 with SMTP id 12so1533526gxk.10 for ; Sun, 08 Feb 2009 11:05:39 -0800 (PST) Message-ID: <498F2CEC.40805@codemonkey.ws> Date: Sun, 08 Feb 2009 13:05:16 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1234115947-31622-1-git-send-email-avi@redhat.com> In-Reply-To: <1234115947-31622-1-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 0/3] Remove ->bdrv_pread() internal block layer API Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org Avi Kivity wrote: > The internal block layer API has a wart in the form of the > ->bdrv_pread() and ->bdrv_pwrite() methods. These duplicate > bdrv_read() and bdrv_write(), and are unnatural for a block > device in that they are not sector oriented. > > One of the reasons for their existence is the scsi-generic host support. > That is also a wart, as scsi-generic is really a packet (command/response) > rather than a block (random access to sectors) API. There is also the > wierd negative sector count == byte count thing. > Great stuff, this has always bugged me. Regards, Anthony Liguori > This patchset addresses these warts by adding a new API for scsi-generic > and dropping ->bdrv_pread() and bdrv_pwrite(). While the improvement > falls short of spectacular, it does make further hacking on the block > layer easier as there are fewer callbacks to worry about. > > Avi Kivity (3): > Add specialized block driver scsi generic API > Add internal scsi generic block API > Drop internal bdrv_pread()/bdrv_pwrite() APIs > > block-raw-posix.c | 50 +++++++++++++++++++++++++-- > block-raw-win32.c | 20 +++++++---- > block.c | 95 +++++++++++++++------------------------------------- > block.h | 8 ++++ > block_int.h | 14 +++++-- > hw/scsi-generic.c | 39 ++++++++++++--------- > 6 files changed, 126 insertions(+), 100 deletions(-) > >