1. 23 4月, 2010 3 次提交
    • C
      block: get rid of the BDRV_O_FILE flag · 6db95603
      Christoph Hellwig 提交于
      BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open.
      It affects two things:  first bdrv_open only searches for protocols using
      find_protocol instead of all image formats and host drivers.  We can easily
      move that to the caller and pass the found driver to bdrv_open.  Second
      it is used to not force a read-write open of a snapshot file.  But we never
      use bdrv_file_open to open snapshots and this behaviour doesn't make sense
      to start with.
      
      qemu-io abused the BDRV_O_FILE for it's growable option, switch it to
      using bdrv_file_open to make sure we only open files as growable were
      we can actually support that.
      
      This patch requires Kevin's "[PATCH] Replace calls of old bdrv_open" to
      be applied first.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6db95603
    • K
      Replace calls of old bdrv_open · d6e9098e
      Kevin Wolf 提交于
      What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
      callers of the old function are converted to the new one. In some places they
      even know the right format, so they should have used bdrv_open2 from the
      beginning.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d6e9098e
    • K
      blkdebug: Add events and rules · 8b9b0cc2
      Kevin Wolf 提交于
      Block drivers can trigger a blkdebug event whenever they reach a place where it
      could be useful to inject an error for testing/debugging purposes.
      
      Rules are read from a blkdebug config file and describe which action is taken
      when an event is triggered. For now this is only injecting an error (with a few
      options) or changing the state (which is an integer). Rules can be declared to
      be active only in a specific state; this way later rules can distiguish on
      which path we came to trigger their event.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8b9b0cc2
  2. 10 4月, 2010 3 次提交
  3. 17 3月, 2010 1 次提交
  4. 20 2月, 2010 1 次提交
  5. 11 2月, 2010 3 次提交
  6. 10 2月, 2010 1 次提交
  7. 27 1月, 2010 5 次提交
  8. 21 1月, 2010 1 次提交
  9. 20 1月, 2010 4 次提交
  10. 14 1月, 2010 3 次提交
  11. 26 12月, 2009 1 次提交
  12. 12 12月, 2009 2 次提交
  13. 04 12月, 2009 3 次提交
  14. 17 11月, 2009 1 次提交
    • L
      Expose a mechanism to trace block writes · 7cd1e32a
      lirans@il.ibm.com 提交于
      To support live migration without shared storage we need to be able to trace
      writes to disk while migrating. This Patch expose dirty block tracking per
      device to be polled from upper layer.
      
      Changes from v4:
      - Register dirty tracking for each block device.
      - Minor coding style issues.
      - Block.c will now manage a dirty bitmap per device once
        bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper
        layer (block-migration.c).
      Signed-off-by: NLiran Schour <lirans@il.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      7cd1e32a
  15. 09 11月, 2009 2 次提交
    • M
      Configurable block format whitelist · eb852011
      Markus Armbruster 提交于
      We have code for a quite a few block formats.  While I trust that all
      of these formats are useful at least for some people in some
      circumstances, some of them are of a kind that friends don't let
      friends use in production.
      
      This patch provides an optional block format whitelist, default off.
      If a whitelist is configured with --block-drv-whitelist, QEMU proper
      can use only whitelisted formats.  Other programs, like qemu-img, are
      not affected.
      
      Drivers for formats off the whitelist still participate in format
      probing, to ensure all programs probe exactly the same.  Without that,
      QEMU proper would be prone to treat images with a format off the
      whitelist as raw when the image's format is probed.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      eb852011
    • N
      Added readonly flag to -drive command · 59f2689d
      Naphtali Sprei 提交于
      This is a slightly revised patch for adding readonly flag to the -drive command.
      Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
      the readonly attribute of the drive to the guest OS, applied first.
      
      This enables sharing same image between guests, with readonly access.
      Implementaion mark the drive as read_only and changes the flags when actually opening the file.
      The readonly attribute of a qcow also passed to it's base file.
      For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag.
      
      Also, return error code from bdrv_truncate for readonly drive.
      Signed-off-by: NNaphtali Sprei <nsprei@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      59f2689d
  16. 28 10月, 2009 1 次提交
  17. 12 9月, 2009 1 次提交
    • B
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl 提交于
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  18. 11 9月, 2009 3 次提交
    • C
      block: add aio_flush operation · b2e12bc6
      Christoph Hellwig 提交于
      Instead stalling the VCPU while serving a cache flush try to do it
      asynchronously.  Use our good old helper thread pool to issue an
      asynchronous fdatasync for raw-posix.  Note that while Linux AIO
      implements a fdatasync operation it is not useful for us because
      it isn't actually implement in asynchronous fashion.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b2e12bc6
    • C
      block: add enable_write_cache flag · e900a7b7
      Christoph Hellwig 提交于
      Add a enable_write_cache flag in the block driver state, and use it to
      decide if we claim to have a volatile write cache that needs controlled
      flushing from the guest.  The flag is off if cache=writethrough is
      defined because O_DSYNC guarantees that every write goes to stable
      storage, and it is on for cache=none and cache=writeback.
      
      Both scsi-disk and ide now use the new flage, changing from their
      defaults of always off (ide) or always on (scsi-disk).
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e900a7b7
    • K
      Add bdrv_aio_multiwrite · 40b4f539
      Kevin Wolf 提交于
      One performance problem of qcow2 during the initial image growth are
      sequential writes that are not cluster aligned. In this case, when a first
      requests requires to allocate a new cluster but writes only to the first
      couple of sectors in that cluster, the rest of the cluster is zeroed - just
      to be overwritten by the following second request that fills up the cluster.
      
      Let's try to merge sequential write requests to the same cluster, so we can
      avoid to write the zero padding to the disk in the first place.
      
      As a nice side effect, also other formats take advantage of dealing with less
      and larger requests.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      40b4f539
  19. 28 8月, 2009 1 次提交
    • C
      raw-posix: add Linux native AIO support · 5c6c3a6c
      Christoph Hellwig 提交于
      Now that do have a nicer interface to work against we can add Linux native
      AIO support.  It's an extremly thing layer just setting up an iocb for
      the io_submit system call in the submission path, and registering an
      eventfd with the qemu poll handler to do complete the iocbs directly
      from there.
      
      This started out based on Anthony's earlier AIO patch, but after
      estimated 42,000 rewrites and just as many build system changes
      there's not much left of it.
      
      To enable native kernel aio use the aio=native sub-command on the
      drive command line.  I have also added an option to qemu-io to
      test the aio support without needing a guest.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      5c6c3a6c