1. 08 4月, 2009 1 次提交
  2. 06 4月, 2009 2 次提交
    • A
      Fix the build for --disable-aio · 8185d2c9
      aliguori 提交于
      This was reported by malc.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6993 c046a42c-6fe2-441c-8c8c-71466251a162
      8185d2c9
    • A
      Add host_device support to qemu-img. (Nolan Leake) · 93c65b47
      aliguori 提交于
      This patch allows the use a host_device as the destination for "qemu-img
      convert".
      
      I added a ->bdrv_create function host_device.  It merely verifies that
      the device exists and is large enough.
      
      A check is needed in the qemu-img convert loop to ensure that we write
      out all 0 sectors to the host_device.  Otherwise they end up with stale
      garbage where all zero sectors were expected.
      
      I also made the check against bdrv_is_allocated enabled for everything
      _except_ host devices, since there is no point in making the block
      backend write a bunch of zeros just so that we can memcmp them
      immediately afterwards.  Host devices can't benefit from this because
      there is no way to differentiate between a sector being unallocated
      because it was never written, or because it was written with all zeros
      and then made a trip through qemu-img convert.
      
      Finally, there is an unrelated fix for a typo in the error message
      printed if the destination device does not support ->bdrv_create.
      
      Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6978 c046a42c-6fe2-441c-8c8c-71466251a162
      93c65b47
  3. 31 3月, 2009 1 次提交
  4. 29 3月, 2009 1 次提交
    • A
      new scsi-generic abstraction, use SG_IO (Christoph Hellwig) · 221f715d
      aliguori 提交于
      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
      devices, too.  See Hannes patch on the kvm list from August for an
      example.
      
      Now that we always do ioctls we don't need another abstraction than
      bdrv_ioctl for the synchronous requests for now, and for asynchronous
      requests I've added a aio_ioctl abstraction keeping it simple.
      
      Long-term we might want to move the ops to a higher-level abstraction
      and let the low-level code fill out the request header, but I'm lazy
      enough to leave that to the people trying to support scsi-passthrough
      on a non-Linux OS.
      
      Tested lightly by issuing various sg_ commands from sg3-utils in a guest
      to a host CDROM device.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6895 c046a42c-6fe2-441c-8c8c-71466251a162
      221f715d
  5. 28 3月, 2009 1 次提交
    • B
      FreeBSD host physical cdrom fixes · 9f23011a
      blueswir1 提交于
      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
      a disc in case a guest cannot eject it itself - otherwise the guest may
      continue using state (like size) of the old disc.
      Signed-off-by: NJuergen Lock <nox@jelal.kn-bremen.de>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6888 c046a42c-6fe2-441c-8c8c-71466251a162
      9f23011a
  6. 13 3月, 2009 3 次提交
  7. 08 3月, 2009 3 次提交
  8. 27 2月, 2009 1 次提交
  9. 06 2月, 2009 1 次提交
  10. 30 1月, 2009 1 次提交
  11. 24 1月, 2009 1 次提交
  12. 17 1月, 2009 1 次提交
  13. 16 1月, 2009 3 次提交
  14. 13 12月, 2008 1 次提交
    • A
      Replace posix-aio with custom thread pool · 3c529d93
      aliguori 提交于
      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
      operation to properly support a zero-copy API.
      
      What has been suggested to me by glibc folks, is to implement whatever new
      interfaces we want and then it can eventually be proposed for standardization.
      This requires that we implement our own posix-aio implementation though.
      
      This patch implements posix-aio using pthreads.  It immediately eliminates the
      need for fd pooling.
      
      It performs at least as well as the current posix-aio code (in some
      circumstances, even better).
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5996 c046a42c-6fe2-441c-8c8c-71466251a162
      3c529d93
  15. 14 11月, 2008 1 次提交
  16. 15 10月, 2008 2 次提交
  17. 14 10月, 2008 1 次提交
    • A
      Expand cache= option and use write-through caching by default · 9f7965c7
      aliguori 提交于
      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
      images.  When using -snapshot, writeback is used by default since data integrity
      it not at all an issue.
      
      cache=none has the same behavior as cache=off previously.  The later syntax is
      still supported by now deprecated.  I also cleaned up the O_DIRECT
      implementation to avoid many of the #ifdefs.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
      9f7965c7
  18. 09 10月, 2008 1 次提交
    • A
      Fix IO performance regression in sparc · 9e472e10
      aliguori 提交于
      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.
         
      This patch switches us to signal handler/pipe which was originally
      suggested by Ian Jackson.  The signal handler lets us interrupt the
      CPU emulation loop while the write to a pipe lets us avoid the
      select/signal race condition.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5451 c046a42c-6fe2-441c-8c8c-71466251a162
      9e472e10
  19. 04 10月, 2008 1 次提交
  20. 28 9月, 2008 1 次提交
    • A
      Make compatfd fallback more robust · 27463101
      aliguori 提交于
      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
      so why SYS_signalfd is defined, it's #defined to _NR_signalfd which is not
      defined in the /usr/include/linux header.
      
      While this is a distro bug, it doesn't hurt to do a more thorough job in
      detection.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5334 c046a42c-6fe2-441c-8c8c-71466251a162
      27463101
  21. 27 9月, 2008 2 次提交
  22. 26 9月, 2008 2 次提交
    • A
      Implement an fd pool to get real AIO with posix-aio · 53538725
      aliguori 提交于
      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.
      
      The fundamental problem with posix-aio is that it limits itself to one thread
      per-file descriptor.  I don't know why this is, but this patch provides a simple
      mechanism to work around this (duplicating the file descriptor).
      
      This isn't a great solution, but it seems like a reasonable intermediate step
      between posix-aio and a custom thread-pool to replace it.
      
      Ryan Harper will be posting some performance analysis he did comparing posix-aio
      with fd pooling against linux-aio.  The size of the posix-aio thread pool and
      the fd pool were largely determined by him based on this analysis.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5323 c046a42c-6fe2-441c-8c8c-71466251a162
      53538725
    • A
      Fix build on FreeBSD · 997306fc
      aliguori 提交于
      __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
      perform well in our testing.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5322 c046a42c-6fe2-441c-8c8c-71466251a162
      997306fc
  23. 23 9月, 2008 2 次提交
    • A
      Relax posix-aio restrictions on newer glibcs · 82889986
      aliguori 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5304 c046a42c-6fe2-441c-8c8c-71466251a162
      82889986
    • A
      Refactor AIO to allow multiple AIO implementations · a76bab49
      aliguori 提交于
      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.
      For other block devices to implement AIO, the qemu_aio_wait function must
      support registration.  This patch introduces a new function,
      qemu_aio_set_fd_handler, which can be used to register a file descriptor to be
      called back.  qemu_aio_wait() now polls a set of file descriptors registered
      with this function until one becomes readable or writable.
      
      This patch should allow the implementation of alternative AIO backends (via a
      thread pool or linux-aio) and AIO backends in non-traditional block devices
      (like NBD).
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5297 c046a42c-6fe2-441c-8c8c-71466251a162
      a76bab49
  24. 22 9月, 2008 1 次提交
  25. 16 9月, 2008 2 次提交
  26. 15 9月, 2008 1 次提交
    • A
      Use common objects for qemu-img and qemu-nbd · 03ff3ca3
      aliguori 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
      03ff3ca3
  27. 12 9月, 2008 1 次提交
  28. 11 9月, 2008 1 次提交