qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general
@ 2009-05-20  8:07 Christoph Hellwig
  2009-05-20 14:41 ` M. Warner Losh
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-05-20  8:07 UTC (permalink / raw)
  To: nolan, qemu-devel

Didn't FreeBSD do away with block device nodes in the 4.x release cycle?

In that case we will never allow to create host devices on FreeBSD
with this code.

Also I think we should allow creating the host devices on all supported
operating systems.  For Linux we should use block devices, for FreeBSD
always char devices.  For the other BSDs and Solaris do we allow only
block or also the raw char devices?  Not sure if they actually support
O_DIRECT for block devices nodes which pretty much is a Linux-ism so
for cache=none at least we should probably open the raw nodes..

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general
  2009-05-20  8:07 [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general Christoph Hellwig
@ 2009-05-20 14:41 ` M. Warner Losh
  2009-05-20 15:03   ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: M. Warner Losh @ 2009-05-20 14:41 UTC (permalink / raw)
  To: hch; +Cc: nolan, qemu-devel

In message: <20090520080723.GA2957@lst.de>
            Christoph Hellwig <hch@lst.de> writes:
: Didn't FreeBSD do away with block device nodes in the 4.x release cycle?

Yes.  Block devices are a quaint relic of the past, and aren't
needed. :)

: In that case we will never allow to create host devices on FreeBSD
: with this code.

Yes, on FreeBSD, just use the char dev.

: Also I think we should allow creating the host devices on all supported
: operating systems.  For Linux we should use block devices, for FreeBSD
: always char devices.  For the other BSDs and Solaris do we allow only
: block or also the raw char devices?  Not sure if they actually support
: O_DIRECT for block devices nodes which pretty much is a Linux-ism so
: for cache=none at least we should probably open the raw nodes..

Other BSDs still have block devices.  O_DIRECT is supported in at
least NetBSD (and FreeBSD).

Warner

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general
  2009-05-20 14:41 ` M. Warner Losh
@ 2009-05-20 15:03   ` Christoph Hellwig
  2009-05-20 16:24     ` M. Warner Losh
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-05-20 15:03 UTC (permalink / raw)
  To: M. Warner Losh; +Cc: nolan, qemu-devel

On Wed, May 20, 2009 at 08:41:24AM -0600, M. Warner Losh wrote:
> : Also I think we should allow creating the host devices on all supported
> : operating systems.  For Linux we should use block devices, for FreeBSD
> : always char devices.  For the other BSDs and Solaris do we allow only
> : block or also the raw char devices?  Not sure if they actually support
> : O_DIRECT for block devices nodes which pretty much is a Linux-ism so
> : for cache=none at least we should probably open the raw nodes..
> 
> Other BSDs still have block devices.  O_DIRECT is supported in at
> least NetBSD (and FreeBSD).

Well, O_DIRECT on block devices.  On Linux a block device opened with
O_DIRECT is the equivalent to the traditional BSD raw devices.  My last
look at freebsd was that there is no support for buffered access to block
device at all since the removal of the block device nodes.  And I wonder
if NetBSD support that concept even if it generally does support
O_DIRECT.

It seems like our option parsing for host devices currently is pretty
Linux-specific :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general
  2009-05-20 15:03   ` Christoph Hellwig
@ 2009-05-20 16:24     ` M. Warner Losh
  0 siblings, 0 replies; 4+ messages in thread
From: M. Warner Losh @ 2009-05-20 16:24 UTC (permalink / raw)
  To: hch; +Cc: nolan, qemu-devel

In message: <20090520150320.GA2844@lst.de>
            Christoph Hellwig <hch@lst.de> writes:
: On Wed, May 20, 2009 at 08:41:24AM -0600, M. Warner Losh wrote:
: > : Also I think we should allow creating the host devices on all supported
: > : operating systems.  For Linux we should use block devices, for FreeBSD
: > : always char devices.  For the other BSDs and Solaris do we allow only
: > : block or also the raw char devices?  Not sure if they actually support
: > : O_DIRECT for block devices nodes which pretty much is a Linux-ism so
: > : for cache=none at least we should probably open the raw nodes..
: > 
: > Other BSDs still have block devices.  O_DIRECT is supported in at
: > least NetBSD (and FreeBSD).
: 
: Well, O_DIRECT on block devices.  On Linux a block device opened with
: O_DIRECT is the equivalent to the traditional BSD raw devices.  My last
: look at freebsd was that there is no support for buffered access to block
: device at all since the removal of the block device nodes.

Well, it depends on what you mean by buffered.  O_DIRECT is supposed
to bypass the buffer cache, at least on FreeBSD:
     O_DIRECT may be used to minimize or eliminate the cache effects of read-
     ing and writing.  The system will attempt to avoid caching the data you
     read or write.  If it cannot avoid caching the data, it will minimize the
     impact the data has on the cache.  Use of this flag can drastically
     reduce performance if not used with care.
so when accessing the device directly, you will still have buffer
cache participation in read/write unless you specify this flag.  In
which case, that's reduced as far as possible.

The main difference between the char devices and the block devices is
that the char devices can only read/write full blocks, while the block
devices used to be able to write 44 bytes at offset 33 if you wanted.

Warner

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-20 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20  8:07 [Qemu-devel] block/raw-posix.c:hdev_create() on FreeBSD and in general Christoph Hellwig
2009-05-20 14:41 ` M. Warner Losh
2009-05-20 15:03   ` Christoph Hellwig
2009-05-20 16:24     ` M. Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).