qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic A


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH 1/3] Add specialized block driver scsi generic API
Date: Sat, 14 Mar 2009 15:33:27 +0100
User-agent: Mutt/1.3.28i

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]