1. 03 2月, 2016 4 次提交
  2. 20 1月, 2016 1 次提交
    • K
      block: Inactivate BDS when migration completes · 76b1c7fe
      Kevin Wolf 提交于
      So far, live migration with shared storage meant that the image is in a
      not-really-ready don't-touch-me state on the destination while the
      source is still actively using it, but after completing the migration,
      the image was fully opened on both sides. This is bad.
      
      This patch adds a block driver callback to inactivate images on the
      source before completing the migration. Inactivation means that it goes
      to a state as if it was just live migrated to the qemu instance on the
      source (i.e. BDRV_O_INACTIVE is set). You're then supposed to continue
      either on the source or on the destination, which takes ownership of the
      image.
      
      A typical migration looks like this now with respect to disk images:
      
      1. Destination qemu is started, the image is opened with
         BDRV_O_INACTIVE. The image is fully opened on the source.
      
      2. Migration is about to complete. The source flushes the image and
         inactivates it. Now both sides have the image opened with
         BDRV_O_INACTIVE and are expecting the other side to still modify it.
      
      3. One side (the destination on success) continues and calls
         bdrv_invalidate_all() in order to take ownership of the image again.
         This removes BDRV_O_INACTIVE on the resuming side; the flag remains
         set on the other side.
      
      This ensures that the same image isn't written to by both instances
      (unless both are resumed, but then you get what you deserve). This is
      important because .bdrv_close for non-BDRV_O_INACTIVE images could write
      to the image file, which is definitely forbidden while another host is
      using the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      76b1c7fe
  3. 22 12月, 2015 1 次提交
  4. 18 12月, 2015 6 次提交
  5. 17 12月, 2015 1 次提交
  6. 12 11月, 2015 5 次提交
  7. 11 11月, 2015 2 次提交
    • A
      throttle: Use bs->throttle_state instead of bs->io_limits_enabled · a0d64a61
      Alberto Garcia 提交于
      There are two ways to check for I/O limits in a BlockDriverState:
      
      - bs->throttle_state: if this pointer is not NULL, it means that this
        BDS is member of a throttling group, its ThrottleTimers structure
        has been initialized and its I/O limits are ready to be applied.
      
      - bs->io_limits_enabled: if true it means that the throttle_state
        pointer is valid _and_ the limits are currently enabled.
      
      The latter is used in several places to check whether a BDS has I/O
      limits configured, but what it really checks is whether requests
      are being throttled or not. For example, io_limits_enabled can be
      temporarily set to false in cases like bdrv_read_unthrottled() without
      otherwise touching the throtting configuration of that BDS.
      
      This patch replaces bs->io_limits_enabled with bs->throttle_state in
      all cases where what we really want to check is the existence of I/O
      limits, not whether they are currently enabled or not.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a0d64a61
    • M
      block: Make bdrv_states public · c69a4dd8
      Max Reitz 提交于
      When inserting a BDS tree into a BB, we will need to add the root BDS to
      this list. Since we will want to do that in the blockdev-insert-medium
      implementation in blockdev.c, we will need access to it there.
      
      This patch is not exactly elegant, but bdrv_states will be removed in
      the future anyway because we no longer need it since we have BBs.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c69a4dd8
  8. 24 10月, 2015 7 次提交
  9. 20 10月, 2015 1 次提交
    • D
      coroutine: move into libqemuutil.a library · 10817bf0
      Daniel P. Berrange 提交于
      The coroutine files are currently referenced by the block-obj-y
      variable. The coroutine functionality though is already used by
      more than just the block code. eg migration code uses coroutine
      yield. In the future the I/O channel code will also use the
      coroutine yield functionality. Since the coroutine code is nicely
      self-contained it can be easily built as part of the libqemuutil.a
      library, making it widely available.
      
      The headers are also moved into include/qemu, instead of the
      include/block directory, since they are now part of the util
      codebase, and the impl was never in the block/ directory
      either.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10817bf0
  10. 16 10月, 2015 7 次提交
  11. 14 7月, 2015 2 次提交
    • K
      block: Fix backing file child when modifying graph · 80a1e130
      Kevin Wolf 提交于
      This patch moves bdrv_attach_child() from the individual places that add
      a backing file to a BDS to bdrv_set_backing_hd(), which is called by all
      of them. It also adds bdrv_detach_child() there.
      
      For normal operation (starting with one backing file chain and not
      changing it until the topmost image is closed) and live snapshots, this
      constitutes no change in behaviour.
      
      For all other cases, this is a fix for the bug that the old backing file
      was still referenced as a child, and the new one wasn't referenced.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      80a1e130
    • K
      block: Introduce bdrv_open_child() · b4b059f6
      Kevin Wolf 提交于
      It is the same as bdrv_open_image(), except that it doesn't only return
      success or failure, but the newly created BdrvChild object for the new
      child node.
      
      As the BdrvChild object already contains a BlockDriverState pointer (and
      this is supposed to become the only pointer so that bdrv_append() and
      friends can just change a single pointer in BdrvChild), the pbs
      parameter is removed for bdrv_open_child().
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      b4b059f6
  12. 02 7月, 2015 3 次提交