From: Christoph Hellwig <hch@lst.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic API
Date: Sat, 14 Mar 2009 15:33:27 +0100 [thread overview]
Message-ID: <20090314143327.GA26791@lst.de> (raw)
In-Reply-To: <1236862631-22918-2-git-send-email-avi@redhat.com>
On Thu, Mar 12, 2009 at 02:57:09PM +0200, Avi Kivity wrote:
> When a scsi device is backed by a scsi generic device instead of an
> ordinary host block device, the block API is abused in a couple of annoying
> ways:
>
> - nb_sectors is negative, and specifies a byte count instead of a sector count
> - offset is ignored, since scsi-generic is essentially a packet protocol
>
> This overloading makes hacking the block layer difficult. Remove it by
> introducing a new explicit API for scsi-generic devices. The new API
> is still backed by the old implementation, but at least the users are
> insulated.
Getting rid of this is good, I found tons of issues in that area
with the I/O path exerciser I wrote last week. Hower the way the new
API is designed somewhat gets in the way of my patch series to support
Gerd's native preadv/pwritev.
One thing I wonder is why we go through the block layer at all for SG.
It is actually backed by a char device that doesn't have semantics like
a block device at all, given that it can't be seekend and is accessed
at byte granularity. We could just go directly to the native Linus
syscalls from scsi-generic.c (or a scsi-generic-linux.c if we want
some level of abstraction). I'll cook up a patch trying that once I'm
back home.
next prev parent reply other threads:[~2009-03-14 14:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 12:57 [Qemu-devel] [PATCH 0/3] Remove ->bdrv_pread() internal block layer API (v2) Avi Kivity
2009-03-12 12:57 ` [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic API Avi Kivity
2009-03-14 14:33 ` Christoph Hellwig [this message]
2009-03-15 13:54 ` Avi Kivity
2009-03-15 14:43 ` Christoph Hellwig
2009-03-15 14:57 ` Avi Kivity
2009-03-15 15:06 ` Christoph Hellwig
2009-03-16 17:29 ` Jamie Lokier
2009-03-12 12:57 ` [Qemu-devel] [PATCH 2/3] Add internal scsi generic block API Avi Kivity
2009-03-12 12:57 ` [Qemu-devel] [PATCH 3/3] Drop internal bdrv_pread()/bdrv_pwrite() APIs Avi Kivity
2009-03-12 19:57 ` [Qemu-devel] Re: [PATCH 0/3] Remove ->bdrv_pread() internal block layer API (v2) Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2009-02-08 17:59 [Qemu-devel] [PATCH 0/3] Remove ->bdrv_pread() internal block layer API Avi Kivity
2009-02-08 17:59 ` [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic API Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090314143327.GA26791@lst.de \
--to=hch@lst.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.