Statistics
| Branch: | Revision:

root / block-raw-posix.c @ 41db4607

History | View | Annotate | Download (35.9 kB)

# Date Author Comment
221f715d 03/28/2009 07:28 pm aliguori

new scsi-generic abstraction, use SG_IO (Christoph Hellwig)

Okay, I started looking into how to handle scsi-generic I/O in the
new world order.

I think the best is to use the SG_IO ioctl instead of the read/write
interface as that allows us to support scsi passthrough on disk/cdrom...

9f23011a 03/28/2009 10:37 am blueswir1

FreeBSD host physical cdrom fixes

This improves physical cdrom support on FreeBSD hosts to be almost as
good as on Linux, with the only notable exception that you still need to
either have the guest itself eject the disc if you want to take it
out/change it, or do a change command in the monitor after taking out...

537a1d4b 03/13/2009 05:12 am aliguori

Fix regression introduced by r6824

The changes introduced by r6824 broke a subtle, and admittedly obscure, aspect
of the block API. While bdrv_{pread,pwrite} return the number of bytes read
or written upon success, bdrv_{read,write} returns a zero upon success....

eda578e5 03/12/2009 09:57 pm aliguori

Drop internal bdrv_pread()/bdrv_pwrite() APIs (Avi Kivity)

Now that scsi generic no longer uses bdrv_pread() and bdrv_pwrite(), we can
drop the corresponding internal APIs, which overlap bdrv_read()/bdrv_write()
and, being byte oriented, are unnatural for a block device....

04eeb8b6 03/12/2009 09:57 pm aliguori

Add internal scsi generic block API (Avi Kivity)

Add an internal API for the generic block layer to send scsi generic commands
to block format driver. This means block format drivers no longer need
to consider overloaded nb_sectors parameters.

Signed-off-by: Avi Kivity <>...

179a2c19 03/08/2009 10:23 am blueswir1

Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configure

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162

e60f469c 03/08/2009 12:00 am aurel32

Use C99 initializers for BlockDriver methods

Consistently use the C99 named initializer format for the BlockDriver
methods to make the method table more readable and more easily
extensible.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Aurelien Jarno <>...

c5e97233 03/07/2009 10:06 pm blueswir1

Support for DragonFly BSD (Hasso Tepper)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162

7a11b22e 02/26/2009 06:40 pm aliguori

fix raw_aio_remove (Stefano Stabellini)

Hi all,
this small patch fixes a bug in the list iteration of raw_aio_remove.
Cheers,

Stefano

Signed-off-by: Stefano Stabellini <>
Signed-off-by: Anthony Liguori <>...

3ec88e80 02/06/2009 12:05 am aliguori

block: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162

22bf1458 01/29/2009 07:02 pm aliguori

fix raw_aio_read\write error handling (Stefano Stabellini)

Currently when qemu_paio_read or qemu_paio_write return an error we call
qemu_aio_release without removing the request from the list.
I know that in the current implementation qemu_paio_write\read don't return...

55f11ca3 01/24/2009 01:54 pm blueswir1

Rename sigev_signo to avoid FreeBSD problems (Juergen Lock)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6414 c046a42c-6fe2-441c-8c8c-71466251a162

c9db92fc 01/17/2009 08:49 am blueswir1

Use kill instead of sigqueue: re-enables AIO on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6360 c046a42c-6fe2-441c-8c8c-71466251a162

31b1a7b4 01/16/2009 12:35 am aliguori

global s/fflush(logfile)/qemu_log_flush()/ (Eduardo Habkost)

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6339 c046a42c-6fe2-441c-8c8c-71466251a162

93fcfe39 01/16/2009 12:34 am aliguori

Convert references to logfile/loglevel to use qemu_log*() macros

This is a large patch that changes all occurrences of logfile/loglevel
global variables to use the new qemu_log*() macros.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Anthony Liguori <>...

4141d4c2 01/15/2009 10:44 pm aliguori

Return -errno on write failure (Gleb Natapov)

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6324 c046a42c-6fe2-441c-8c8c-71466251a162

3c529d93 12/12/2008 06:41 pm aliguori

Replace posix-aio with custom thread pool

glibc implements posix-aio as a thread pool and imposes a number of limitations.

1) it limits one request per-file descriptor. we hack around this by dup()'ing
file descriptors which is hideously ugly

2) it's impossible to add new interfaces and we need a vectored read/write...

e20e830b 11/13/2008 09:23 pm aliguori

block: make raw aio signaling non-blocking (Gerd Hoffman)

This patch switches the read handle of the signaling pipe into
non-blocking mode. This avoids unwanted blocking reads and also
allows to read all bytes out of the signaling pipe in case we got
signaled more that once before the handler ran....

7ab064d2 10/14/2008 09:14 pm aliguori

Fix previous commit (spotted by Robert Riebisch).

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5487 c046a42c-6fe2-441c-8c8c-71466251a162

f6465578 10/14/2008 09:00 pm aliguori

Define O_DSYNC as O_SYNC if necessary.

O_DSYNC isn't available on OS X.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5486 c046a42c-6fe2-441c-8c8c-71466251a162

9f7965c7 10/14/2008 05:42 pm aliguori

Expand cache= option and use write-through caching by default

This patch changes the cache= option to accept none, writeback, or writethough
to control the host page cache behavior. By default, writethrough caching is
now used which internally is implemented by using O_DSYNC to open the disk...

9e472e10 10/08/2008 10:50 pm aliguori

Fix IO performance regression in sparc

Replace signalfd with signal handler/pipe. There is no way to interrupt
the CPU execution loop when a file descriptor becomes readable. This
results in a large performance regression in sparc emulation during
bootup....

674a24ac 10/03/2008 10:00 pm blueswir1

Fix warning about missing return value

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5405 c046a42c-6fe2-441c-8c8c-71466251a162

27463101 09/27/2008 11:58 pm aliguori

Make compatfd fallback more robust

Be more friendly when signalfd() fails, and also add configure checks to detect
that syscall(SYS_signalfd) actually works. malc pointed out that some installs
do not have /usr/include/linux headers that are in sync with the glibc headers...

acce87f9 09/26/2008 07:12 pm aliguori

Really fix the BSD build this time

struct aioinit isn't defined on BSD it appears so we need to guard everything
in an #if defined(linux).

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5325 c046a42c-6fe2-441c-8c8c-71466251a162

0d0ab49a 09/26/2008 07:04 pm aliguori

Fix build on non-Linux unices

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5324 c046a42c-6fe2-441c-8c8c-71466251a162

53538725 09/26/2008 06:59 pm aliguori

Implement an fd pool to get real AIO with posix-aio

This patch implements a simple fd pool to allow many AIO requests with
posix-aio. The result is significantly improved performance (identical to that
reported for linux-aio) for both cache=on and cache=off....

997306fc 09/26/2008 06:52 pm aliguori

Fix build on FreeBSD

__GLIBC_PREREQ is defined in such a way that the ! cannot be used in front of
it on FreeBSD. Also, -lpthread is not implied by the build and we definitely
use it for compatfd support.

While at it, I added a default initialization for posix-aio that seems to...

82889986 09/23/2008 05:57 am aliguori

Relax posix-aio restrictions on newer glibcs

RedHat 9 shipped glibc 2.3. Modern versions of glibc do not have the aio thread
exit issue that the comment references. This patch adjusts the check to only
limit aio_init on glibc versions < 2.4.

Signed-off-by: Anthony Liguori <>...

a76bab49 09/22/2008 10:17 pm aliguori

Refactor AIO to allow multiple AIO implementations

This patch refactors the AIO layer to allow multiple AIO implementations. It's
only possible because of the recent signalfd() patch.

Right now, the AIO infrastructure is pretty specific to the block raw backend....

ad02ad6f 09/22/2008 05:49 pm aliguori

Do not allow AIO to be inited multiple times

This prevents two signalfd() threads from being spawned. This problem was
originally spotted by Blue Swirl.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5289 c046a42c-6fe2-441c-8c8c-71466251a162

2acf5af0 09/16/2008 04:21 pm aliguori

block-raw is not a protocol

The protocol_name "file" was added to the block driver when async IO was
introduced. This can be used to select that a file is treated as a raw
device instead of probing for the type. However, protocols are not subject
to path interpretation which cases qcow2 images with raw base images to not...

08af02e2 09/15/2008 07:48 pm aliguori

Make sure to define fd_open when not on Linux

My previous commit broke the build. This was spotted by C.W. Betts.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5231 c046a42c-6fe2-441c-8c8c-71466251a162

03ff3ca3 09/15/2008 06:51 pm aliguori

Use common objects for qemu-img and qemu-nbd

Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
code. It's ugly and causes us to have to build multiple object files for
linking against qemu and the tools.

This patch introduces a new file, qemu-tool.c which contains enough for...

a3392f9b 09/11/2008 09:00 pm aliguori

Only build compatfd when using AIO and make sure to always init AIO

OpenBSD doesn't use AIO so don't try to build compatfd when not using AIO.

Also make sure to call qemu_aio_init() from bdrv_init. Everything that uses
bdrv calls bdrv_init so it makes sense to init aio from there instead of...

2c41a5f9 09/11/2008 05:32 pm aliguori

Make sure to read siginfo from signalfd

Otherwise, we'll idle at 100% cpu.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5195 c046a42c-6fe2-441c-8c8c-71466251a162

baf35cb9 09/10/2008 06:45 pm aliguori

Use signalfd() to work around signal/select race

This patch introduces signalfd() to work around the signal/select race in
checking for AIO completions. For platforms that don't support signalfd(), we
emulate it with threads.

There was a long discussion about this approach. I don't believe there are any...

543952ca 08/24/2008 01:43 pm blueswir1

Add missing FreeBSD #include (Juergen Lock)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5081 c046a42c-6fe2-441c-8c8c-71466251a162

128ab2ff 08/15/2008 09:33 pm blueswir1

Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162

414f0dab 08/15/2008 09:20 pm blueswir1

Use AIO only if host supports it (based on OpenBSD patches by Todd T. Fries)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5010 c046a42c-6fe2-441c-8c8c-71466251a162

2f726488 07/03/2008 02:47 pm ths

Add a parameter to disable host cache, by Laurent Vivier.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4836 c046a42c-6fe2-441c-8c8c-71466251a162

bed5cc52 05/28/2008 12:51 pm bellard

Align file accesses with cache=off (O_DIRECT) (Kevin Wolf, Laurent Vivier)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4599 c046a42c-6fe2-441c-8c8c-71466251a162

6dd2db52 05/07/2008 06:26 pm blueswir1

Revert 4367

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4377 c046a42c-6fe2-441c-8c8c-71466251a162

adcbebaa 05/06/2008 08:26 pm blueswir1

Align file accesses with cache=off (Kevin Wolf, Laurent Vivier)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4367 c046a42c-6fe2-441c-8c8c-71466251a162

01534fe9 01/06/2008 08:53 pm bellard

restore original values for ai.aio_threads and ai.aio_num

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3896 c046a42c-6fe2-441c-8c8c-71466251a162

985a03b0 12/24/2007 06:10 pm ths

Real SCSI device passthrough (v4), by Laurent Vivier.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3851 c046a42c-6fe2-441c-8c8c-71466251a162

33f00271 12/24/2007 04:33 pm balrog

Add "cache" parameter to "-drive" (Laurent Vivier).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162

223d4670 12/15/2007 07:28 pm ths

Split block-raw.c into block-raw-posix.c and block-raw-win32.c, by
Anthony Liguori.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3814 c046a42c-6fe2-441c-8c8c-71466251a162