Commit Graph

15 Commits

Author SHA1 Message Date
aliguori 03ff3ca30f 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
qemu-img, qemu-nbd, and QEMU to all share the same objects.

This also required getting qemu-nbd to be a bit more Windows friendly.  I also
changed the Windows block-raw to use normal IO instead of overlapping IO since
we don't actually do AIO yet on Windows.  I changed the various #if 0's to
 #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows.

After this patch, there are no longer any #ifdef's related to qemu-img and
qemu-nbd.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-15 15:51:35 +00:00
aliguori a3392f9b10 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
in every single tool.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5197 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-11 18:00:19 +00:00
aliguori 2c41a5f9e3 Make sure to read siginfo from signalfd
Otherwise, we'll idle at 100% cpu.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5195 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-11 14:32:27 +00:00
aliguori baf35cb902 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
fundamental problems with this approach and I believe eliminating the use of
signals is a good thing.

I've tested Windows and Linux using Windows and Linux guests.  I've also checked
for disk IO performance regressions.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5187 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-10 15:45:19 +00:00
blueswir1 543952ca93 Add missing FreeBSD #include (Juergen Lock)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5081 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-24 10:43:12 +00:00
blueswir1 128ab2ff50 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
2008-08-15 18:33:42 +00:00
blueswir1 414f0dab09 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
2008-08-15 18:20:52 +00:00
ths 2f7264888a 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
2008-07-03 11:47:46 +00:00
bellard bed5cc5207 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
2008-05-28 09:51:09 +00:00
blueswir1 6dd2db52a9 Revert 4367
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4377 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-07 15:26:22 +00:00
blueswir1 adcbebaa40 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
2008-05-06 17:26:59 +00:00
bellard 01534fe901 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
2008-01-06 18:53:07 +00:00
ths 985a03b0ce Real SCSI device passthrough (v4), by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3851 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-24 16:10:43 +00:00
balrog 33f002714b Add "cache" parameter to "-drive" (Laurent Vivier).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-24 14:33:24 +00:00
ths 223d4670a0 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
2007-12-15 17:28:36 +00:00