1. 16 6月, 2015 10 次提交
  2. 15 6月, 2015 24 次提交
  3. 13 6月, 2015 1 次提交
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 8aeaa055
      Peter Maydell 提交于
      # gpg: Signature made Fri Jun 12 15:57:47 2015 BST using RSA key ID 81AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      
      * remotes/stefanha/tags/block-pull-request:
        qemu-iotests: expand test 093 to support group throttling
        throttle: Update throttle infrastructure copyright
        throttle: add the name of the ThrottleGroup to BlockDeviceInfo
        throttle: acquire the ThrottleGroup lock in bdrv_swap()
        throttle: Add throttle group support
        throttle: Add throttle group infrastructure tests
        throttle: Add throttle group infrastructure
        throttle: Extract timers from ThrottleState into a separate structure
        raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size
        Revert "iothread: release iothread around aio_poll"
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      8aeaa055
  4. 12 6月, 2015 5 次提交
    • K
      block: Fix reopen flag inheritance · 67251a31
      Kevin Wolf 提交于
      When reopening an image, the block layer already takes care to reopen
      bs->file as well with recalculated inherited flags. The same must happen
      for any other child (most notably missing before this patch: backing
      files).
      
      If bs->file (or any other child) didn't originally inherit from bs, e.g.
      because it was created separately and then only referenced, it must not
      inherit flags on reopen either, so check the inherited_from field before
      propagation the reopen down.
      
      VMDK already reopened its extents manually; this code can now be
      dropped.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      67251a31
    • K
      block: Add BlockDriverState.inherits_from · bddcec37
      Kevin Wolf 提交于
      Currently, the block layer assumes that any block node can have only one
      parent, and if it has a parent, that it inherits some options/flags from
      this parent.
      
      This is not true any more: With references used in block device
      creation, a single node can be used by multiple parents, or it can be
      created separately and not inherit flags from any parent.
      
      To handle reopens correctly, a node must know from which parent it
      inherited options. This patch adds the information to BlockDriverState.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      bddcec37
    • K
      block: Add list of children to BlockDriverState · 6e93e7c4
      Kevin Wolf 提交于
      This allows iterating over all children of a given BDS, not only
      including bs->file and bs->backing_hd, but also driver-specific
      ones like VMDK extents or Quorum children.
      
      For bdrv_swap(), the list of children of the swapped BDS stays at that
      BDS (because that's where the pointers stay as well). The list head
      moves and pointers to it must be fixed up therefore.
      
      The list of children in the parent of the swapped BDS is not affected by
      the swap. The contents of the BDS objects is swapped, so the existing
      pointer in the parent automatically points to the newly swapped in BDS.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      6e93e7c4
    • K
      queue.h: Add QLIST_FIX_HEAD_PTR() · ae816930
      Kevin Wolf 提交于
      If the head of a list has been moved to a different memory location, the
      le_prev link in the first list entry has to be fixed up. Provide a macro
      that implements this fixup.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      ae816930
    • K
      block: Drain requests before swapping nodes in bdrv_swap() · 6ee4ce1e
      Kevin Wolf 提交于
      bdrv_swap() requires that there are no requests in flight on either of
      the two devices. The request coroutine would work on the wrong
      BlockDriverState object (with bs->opaque even being interpreted as a
      different type potentially) and all sorts of bad things would result
      from this.
      
      The currently existing callers mostly ensure that there is no I/O
      pending on nodes that are swapped. In detail, this is:
      
      1. Live snapshots. This goes through qmp_transaction(), which calls
         bdrv_drain_all() before doing anything. The command is executed
         synchronously, so no new I/O can be issued concurrently.
      
      2. snapshot=on in bdrv_open(). We're in the middle of opening the image
         (both the original image and its temporary overlay), so there can't
         be any I/O in flight yet.
      
      3. Mirroring. bdrv_drain() is already used on the source device so that
         the mirror doesn't miss anything. However, the main loop runs between
         that and the bdrv_swap() (which is actually a bug, being addressed in
         another series), so there is a small window in which new I/O might be
         issued that would be in flight during bdrv_swap().
      
      It is safer to just drain the request queue of both devices in
      bdrv_swap() instead of relying on callers to do the right thing.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      6ee4ce1e