1. 09 7月, 2012 1 次提交
  2. 15 6月, 2012 6 次提交
  3. 10 5月, 2012 1 次提交
  4. 05 4月, 2012 6 次提交
  5. 12 3月, 2012 1 次提交
    • S
      block: handle -EBUSY in bdrv_commit_all() · e8877497
      Stefan Hajnoczi 提交于
      Monitor operations that manipulate image files must not execute while a
      background job (like image streaming) is in progress.  This prevents
      corruptions from happening when two pieces of code are manipulating the
      image file without knowledge of each other.
      
      The monitor "commit" command raises QERR_DEVICE_IN_USE when
      bdrv_commit() returns -EBUSY but "commit all" has no error handling.
      This is easy to fix, although note that we do not deliver a detailed
      error about which device was busy in the "commit all" case.
      Suggested-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e8877497
  6. 29 2月, 2012 2 次提交
    • J
      qapi: Introduce blockdev-group-snapshot-sync command · 8802d1fd
      Jeff Cody 提交于
      This is a QAPI/QMP only command to take a snapshot of a group of
      devices. This is similar to the blockdev-snapshot-sync command, except
      blockdev-group-snapshot-sync accepts a list devices, filenames, and
      formats.
      
      It is attempted to keep the snapshot of the group atomic; if the
      creation or open of any of the new snapshots fails, then all of
      the new snapshots are abandoned, and the name of the snapshot image
      that failed is returned.  The failure case should not interrupt
      any operations.
      
      Rather than use bdrv_close() along with a subsequent bdrv_open() to
      perform the pivot, the original image is never closed and the new
      image is placed 'in front' of the original image via manipulation
      of the BlockDriverState fields.  Thus, once the new snapshot image
      has been successfully created, there are no more failure points
      before pivoting to the new snapshot.
      
      This allows the group of disks to remain consistent with each other,
      even across snapshot failures.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Acked-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8802d1fd
    • H
      block: add a transfer rate for floppy types · f8d3d128
      Hervé Poussineau 提交于
      Floppies must be read at a specific transfer rate, depending of its own format.
      Update floppy description table to include required transfer rate.
      Signed-off-by: NHervé Poussineau <hpoussin@reactos.org>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f8d3d128
  7. 23 2月, 2012 2 次提交
  8. 09 2月, 2012 1 次提交
    • S
      block: add .bdrv_co_write_zeroes() interface · f08f2dda
      Stefan Hajnoczi 提交于
      The ability to zero regions of an image file is a useful primitive for
      higher-level features such as image streaming or zero write detection.
      
      Image formats may support an optimized metadata representation instead
      of writing zeroes into the image file.  This allows zero writes to be
      potentially faster than regular write operations and also preserve
      sparseness of the image file.
      
      The .bdrv_co_write_zeroes() interface should be implemented by block
      drivers that wish to provide efficient zeroing.
      
      Note that this operation is different from the discard operation, which
      may leave the contents of the region indeterminate.  That means
      discarded blocks are not guaranteed to contain zeroes and may contain
      junk data instead.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f08f2dda
  9. 26 1月, 2012 2 次提交
    • M
      block: add bdrv_find_backing_image · e8a6bb9c
      Marcelo Tosatti 提交于
      Add bdrv_find_backing_image: given a BlockDriverState pointer, and an id,
      traverse the backing image chain to locate the id.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e8a6bb9c
    • S
      block: make copy-on-read a per-request flag · 470c0504
      Stefan Hajnoczi 提交于
      Previously copy-on-read could only be enabled for all requests to a
      block device.  This means requests coming from the guest as well as
      QEMU's internal requests would perform copy-on-read when enabled.
      
      For image streaming we want to support finer-grained behavior than just
      populating the image file from its backing image.  Image streaming
      supports partial streaming where a common backing image is preserved.
      In this case guest requests should not perform copy-on-read because they
      would indiscriminately copy data which should be left in a backing image
      from the backing chain.
      
      Introduce a per-request flag for copy-on-read so that a block device can
      process both regular and copy-on-read requests.  Overlapping reads and
      writes still need to be serialized for correctness when copy-on-read is
      happening, so add an in-flight reference count to track this.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      470c0504
  10. 15 12月, 2011 1 次提交
  11. 14 12月, 2011 1 次提交
  12. 05 12月, 2011 5 次提交
  13. 22 11月, 2011 1 次提交
    • A
      block: allow migration to work with image files (v3) · 0f15423c
      Anthony Liguori 提交于
      Image files have two types of data: immutable data that describes things like
      image size, backing files, etc. and mutable data that includes offset and
      reference count tables.
      
      Today, image formats aggressively cache mutable data to improve performance.  In
      some cases, this happens before a guest even starts.  When dealing with live
      migration, since a file is open on two machines, the caching of meta data can
      lead to data corruption.
      
      This patch addresses this by introducing a mechanism to invalidate any cached
      mutable data a block driver may have which is then used by the live migration
      code.
      
      NB, this still requires coherent shared storage.  Addressing migration without
      coherent shared storage (i.e. NFS) requires additional work.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      0f15423c
  14. 11 11月, 2011 1 次提交
    • P
      block: add eject request callback · 025ccaa7
      Paolo Bonzini 提交于
      Recent versions of udev always keep the tray locked so that the kernel
      can observe "eject request" events (aka tray button presses) even on
      discs that aren't mounted.  Add support for these events in the ATAPI
      and SCSI cd drive device models.
      
      To let management cope with the behavior of udev, an event should also
      be added for "tray opened/closed".  This way, after issuing an "eject"
      command, management can poll until the guests actually reacts to the
      command.  They can then issue the "change" command after the tray has been
      opened, or try with "eject -f" after a (configurable?) timeout.  However,
      with this patch and the corresponding support in the device models,
      at least it is possible to do a manual two-step eject+change sequence.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      025ccaa7
  15. 27 10月, 2011 3 次提交
  16. 21 10月, 2011 2 次提交
  17. 11 10月, 2011 1 次提交
    • L
      block: Keep track of devices' I/O status · 28a7282a
      Luiz Capitulino 提交于
      This commit adds support to the BlockDriverState type to keep track
      of devices' I/O status.
      
      There are three possible status: BDRV_IOS_OK (no error), BDRV_IOS_ENOSPC
      (no space error) and BDRV_IOS_FAILED (any other error). The distinction
      between no space and other errors is important because a management
      application may want to watch for no space in order to extend the
      space assigned to the VM and put it to run again.
      
      Qemu devices supporting the I/O status feature have to enable it
      explicitly by calling bdrv_iostatus_enable() _and_ have to be
      configured to stop the VM on errors (ie. werror=stop|enospc or
      rerror=stop).
      
      In case of multiple errors being triggered in sequence only the first
      one is stored. The I/O status is always reset to BDRV_IOS_OK when the
      'cont' command is issued.
      
      Next commits will add support to some devices and extend the
      query-block/info block commands to return the I/O status information.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      28a7282a
  18. 12 9月, 2011 3 次提交