1. 02 7月, 2015 1 次提交
    • F
      block: Add bdrv_get_block_status_above · ba3f0e25
      Fam Zheng 提交于
      Like bdrv_is_allocated_above, this function follows the backing chain until seeing
      BDRV_BLOCK_ALLOCATED.  Base is not included.
      
      Reimplement bdrv_is_allocated on top.
      
      [Initialized bdrv_co_get_block_status_above() ret to 0 to silence
      mingw64 compiler warning about the unitialized variable.  assert(bs !=
      base) prevents that case but I suppose the program could be compiled
      with -DNDEBUG.
      --Stefan]
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ba3f0e25
  2. 12 6月, 2015 3 次提交
  3. 29 5月, 2015 1 次提交
    • J
      qapi: add dirty bitmap status · 9abe3bdc
      John Snow 提交于
      Bitmaps can be in a handful of different states with potentially
      more to come as we tool around with migration and persistence patches.
      
      Management applications may need to know why certain bitmaps are
      unavailable for various commands, e.g. busy in another operation,
      busy being migrated, etc.
      
      Right now, all we offer is BlockDirtyInfo's boolean member 'frozen'.
      Instead of adding more booleans, replace it by an enumeration member
      'status' with values 'active' and 'frozen'.  Then add new value
      'disabled'.
      
      Incompatible change.  Fine because the changed part hasn't been
      released so far.
      Suggested-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      9abe3bdc
  4. 22 5月, 2015 1 次提交
    • D
      block: minimal bounce buffer alignment · 4196d2f0
      Denis V. Lunev 提交于
      The patch introduces new concept: minimal memory alignment for bounce
      buffers. Original so called "optimal" value is actually minimal required
      value for aligment. It should be used for validation that the IOVec
      is properly aligned and bounce buffer is not required.
      
      Though, from the performance point of view, it would be better if
      bounce buffer or IOVec allocated by QEMU will be aligned stricter.
      
      The patch does not change any alignment value yet.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1431441056-26198-2-git-send-email-den@openvz.org
      CC: Paolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4196d2f0
  5. 28 4月, 2015 11 次提交
  6. 17 3月, 2015 1 次提交
  7. 10 3月, 2015 1 次提交
  8. 27 2月, 2015 1 次提交
    • F
      block: Forbid bdrv_set_aio_context outside BQL · 2e5b887c
      Fam Zheng 提交于
      Even if the caller has both the old and the new AioContext's, there can
      be a deadlock, due to the leading bdrv_drain_all.
      
      Suppose there are four io threads (A, B, A0, B0) with A and B owning a
      BDS for each (bs_a, bs_b); Now A wants to move bs_a to iothread A0, and
      B wants to move bs_b to B0, at the same time:
      
        iothread A                           iothread B
      --------------------------------------------------------------------------
        aio_context_acquire(A0) /* OK */     aio_context_acquire(B0) /* OK */
        bdrv_set_aio_context(bs_a, A0)       bdrv_set_aio_context(bs_b, B0)
        -> bdrv_drain_all()                  -> bdrv_drain_all()
           -> acquire A /* OK */               -> acquire A /* blocked */
           -> acquire B /* blocked */          -> acquire B
           ...                                 ...
      
      Deadlock happens because A is waiting for B, and B is waiting for A.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1423969591-23646-2-git-send-email-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2e5b887c
  9. 16 2月, 2015 1 次提交
  10. 07 2月, 2015 2 次提交
  11. 13 1月, 2015 4 次提交
    • F
      block: Split BLOCK_OP_TYPE_COMMIT to BLOCK_OP_TYPE_COMMIT_{SOURCE, TARGET} · bb00021d
      Fam Zheng 提交于
      Like BLOCK_OP_TYPE_BACKUP_SOURCE and BLOCK_OP_TYPE_BACKUP_TARGET,
      block-commit involves two asymmetric devices.
      
      This change is not user-visible (yet), because commit only works with
      device names.
      
      But once we enable backing reference in blockdev-add, or specifying
      node-name in block-commit command, we don't want the user to start two
      commit jobs on the same backing chain, which will corrupt things because
      of the final bdrv_swap.
      
      Before we have per category blockers, splitting this type is still
      better.
      
      [Resolved virtio-blk dataplane conflict by replacing
      BLOCK_OP_TYPE_COMMIT with both BLOCK_OP_TYPE_COMMIT_{SOURCE, TARGET}.
      They are safe since the block job runs in the same AioContext as the
      dataplane IOThread.
      --Stefan]
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      bb00021d
    • V
      block: fix spoiling all dirty bitmaps by mirror and migration · c4237dfa
      Vladimir Sementsov-Ogievskiy 提交于
      Mirror and migration use dirty bitmaps for their purposes, and since
      commit [block: per caller dirty bitmap] they use their own bitmaps, not
      the global one. But they use old functions bdrv_set_dirty and
      bdrv_reset_dirty, which change all dirty bitmaps.
      
      Named dirty bitmaps series by Fam and Snow are affected: mirroring and
      migration will spoil all (not related to this mirroring or migration)
      named dirty bitmaps.
      
      This patch fixes this by adding bdrv_set_dirty_bitmap and
      bdrv_reset_dirty_bitmap, which change concrete bitmap. Also, to prevent
      such mistakes in future, old functions bdrv_(set,reset)_dirty are made
      static, for internal block usage.
      Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@parallels.com>
      CC: John Snow <jsnow@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      CC: Denis V. Lunev <den@openvz.org>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1417081246-3593-1-git-send-email-vsementsov@parallels.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c4237dfa
    • M
      block: JSON filenames and relative backing files · 9f07429e
      Max Reitz 提交于
      When using a relative backing file name, qemu needs to know the
      directory of the top image file. For JSON filenames, such a directory
      cannot be easily determined (e.g. how do you determine the directory of
      a qcow2 BDS directly on top of a quorum BDS?). Therefore, do not allow
      relative filenames for the backing file of BDSs only having a JSON
      filename.
      
      Furthermore, BDS::exact_filename should be used whenever possible. If
      BDS::filename is not equal to BDS::exact_filename, the former will
      always be a JSON object.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9f07429e
    • M
      block: Get full backing filename from string · 0a82855a
      Max Reitz 提交于
      Introduce bdrv_get_full_backing_filename_from_filename(), a function
      which takes the name of the backed file and a potentially relative
      backing filename to produce the full (absolute) backing filename.
      
      Use this function from bdrv_get_full_backing_filename().
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0a82855a
  12. 13 12月, 2014 1 次提交
  13. 12 12月, 2014 1 次提交
    • M
      vmdk: Fix error for JSON descriptor file names · 5c98415b
      Max Reitz 提交于
      If vmdk blindly tries to use path_combine() using bs->file->filename as
      the base file name, this will result in a bad error message for JSON
      file names when calling bdrv_open(). It is better to only try
      bs->file->exact_filename; if that is empty, bs->file->filename will be
      useless for path_combine() and an error should be emitted (containing
      bs->file->filename because desc_file_path (which is
      bs->file->exact_filename) is empty).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 1417615043-26174-2-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      5c98415b
  14. 10 12月, 2014 2 次提交
  15. 11 11月, 2014 1 次提交
  16. 03 11月, 2014 3 次提交
    • S
      block: add bdrv_drain() · 5b98db0a
      Stefan Hajnoczi 提交于
      Now that op blockers are in use, we can ensure that no other sources are
      generating I/O on a BlockDriverState.  Therefore it is possible to drain
      requests for a single BDS.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 1413889440-32577-7-git-send-email-stefanha@redhat.com
      5b98db0a
    • M
      block: Add status callback to bdrv_amend_options() · 77485434
      Max Reitz 提交于
      Depending on the changed options and the image format,
      bdrv_amend_options() may take a significant amount of time. In these
      cases, a way to be informed about the operation's status is desirable.
      
      Since the operation is rather complex and may fundamentally change the
      image, implementing it as AIO or a coroutine does not seem feasible. On
      the other hand, implementing it as a block job would be significantly
      more difficult than a simple callback and would not add benefits other
      than progress report to the amending operation, because it should not
      actually be run as a block job at all.
      
      A callback may not be very pretty, but it's very easy to implement and
      perfectly fits its purpose here.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NBenoît Canet <benoit.canet@nodalink.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1414404776-4919-2-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      77485434
    • M
      qcow2: Optimize bdrv_make_empty() · 94054183
      Max Reitz 提交于
      bdrv_make_empty() is currently only called if the current image
      represents an external snapshot that has been committed to its base
      image; it is therefore unlikely to have internal snapshots. In this
      case, bdrv_make_empty() can be greatly sped up by emptying the L1 and
      refcount table (while having the dirty flag set, which only works for
      compat=1.1) and creating a trivial refcount structure.
      
      If there are snapshots or for compat=0.10, fall back to the simple
      implementation (discard all clusters).
      
      [Applied s/clusters/cluster/ typo fix suggested by Eric Blake
      --Stefan]
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1414159063-25977-4-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      94054183
  17. 23 10月, 2014 1 次提交
  18. 20 10月, 2014 4 次提交