From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWDw7-0007h1-Rr for qemu-devel@nongnu.org; Sun, 08 Feb 2009 12:59:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWDw5-0007eP-Ip for qemu-devel@nongnu.org; Sun, 08 Feb 2009 12:59:18 -0500 Received: from [199.232.76.173] (port=33233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWDw5-0007dv-5H for qemu-devel@nongnu.org; Sun, 08 Feb 2009 12:59:17 -0500 Received: from mx2.redhat.com ([66.187.237.31]:32857) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWDw4-0008Gr-1x for qemu-devel@nongnu.org; Sun, 08 Feb 2009 12:59:16 -0500 From: Avi Kivity Date: Sun, 8 Feb 2009 19:59:04 +0200 Message-Id: <1234115947-31622-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [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: Anthony Liguori , qemu-devel@nongnu.org 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. 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(-)