1. 16 2月, 2015 1 次提交
  2. 07 2月, 2015 2 次提交
  3. 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
  4. 13 12月, 2014 1 次提交
  5. 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
  6. 10 12月, 2014 2 次提交
  7. 11 11月, 2014 1 次提交
  8. 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
  9. 23 10月, 2014 1 次提交
  10. 20 10月, 2014 7 次提交
  11. 22 9月, 2014 1 次提交
    • F
      block: Add bdrv_aio_cancel_async · 02c50efe
      Fam Zheng 提交于
      This is the async version of bdrv_aio_cancel, which doesn't block the
      caller. It guarantees that the cb is called either before returning or
      some time later.
      
      bdrv_aio_cancel can base on bdrv_aio_cancel_async, later we can convert
      all .io_cancel implementations to .io_cancel_async, and the aio_poll is
      the common logic. In the end, .io_cancel can be dropped.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      02c50efe
  12. 10 9月, 2014 3 次提交
    • B
      block: Make the block accounting functions operate on BlockAcctStats · 5366d0c8
      Benoît Canet 提交于
      This is the next step for decoupling block accounting functions from
      BlockDriverState.
      In a future commit the BlockAcctStats structure will be moved from
      BlockDriverState to the device models structures.
      
      Note that bdrv_get_stats was introduced so device models can retrieve the
      BlockAcctStats structure of a BlockDriverState without being aware of it's
      layout.
      This function should go away when BlockAcctStats will be embedded in the device
      models structures.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Michael Tokarev <mjt@tls.msk.ru>
      CC: John Snow <jsnow@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5366d0c8
    • B
      block: Extract the block accounting code · 5e5a94b6
      Benoît Canet 提交于
      The plan is to add new accounting metrics (latency, invalid requests, failed
      requests, queue depth) and block.c is overpopulated so it will be better to work
      in a separate module.
      
      Moreover the long term plan is to have statistics in each of the BDS of the graph
      for metrology purpose; this means that the device model statistics must move from
      the topmost BDS to the device model.
      
      So we need to decouple the statistic code from BlockDriverState.
      
      This is another argument for the extraction of the code in a separate module.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Benoit Canet <benoit@irqsave.net>
      CC: Fam Zheng <famz@redhat.com>
      CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5e5a94b6
    • B
      block: Extract the BlockAcctStats structure · 0ddd0ad9
      Benoît Canet 提交于
      Extract the block accounting statistics into a structure so the block device
      models can hold them in the future.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0ddd0ad9
  13. 20 8月, 2014 1 次提交
    • M
      block: Add bdrv_refresh_filename() · 91af7014
      Max Reitz 提交于
      Some block devices may not have a filename in their BDS; and for some,
      there may not even be a normal filename at all. To work around this, add
      a function which tries to construct a valid filename for the
      BDS.filename field.
      
      If a filename exists or a block driver is able to reconstruct a valid
      filename (which is placed in BDS.exact_filename), this can directly be
      used.
      
      If no filename can be constructed, we can still construct an options
      QDict which is then converted to a JSON object and prefixed with the
      "json:" pseudo protocol prefix. The QDict is placed in
      BDS.full_open_options.
      
      For most block drivers, this process can be done automatically; those
      that need special handling may define a .bdrv_refresh_filename() method
      to fill BDS.exact_filename and BDS.full_open_options themselves.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      91af7014
  14. 15 8月, 2014 2 次提交
  15. 18 7月, 2014 1 次提交
  16. 07 7月, 2014 1 次提交
  17. 01 7月, 2014 2 次提交
  18. 28 6月, 2014 2 次提交
  19. 23 6月, 2014 1 次提交
  20. 16 6月, 2014 2 次提交
  21. 04 6月, 2014 1 次提交